diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-14 09:23:33 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-14 09:23:33 +0000 |
| commit | 600c6fa13de5c407dc36dbb0ab73807868741ae0 (patch) | |
| tree | 49817b316c4fdaa56d9d16ebf2555303d1a990e0 /lib/Transforms/IPO/DeadArgumentElimination.cpp | |
| parent | 93338c197185f946619794ce011ec27b5b6250e2 (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/IPO/DeadArgumentElimination.cpp')
| -rw-r--r-- | lib/Transforms/IPO/DeadArgumentElimination.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 666db7e8d74b8..e480dadca8913 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -175,15 +175,8 @@ bool DAE::DeleteDeadVarargs(Function &Fn) { if (Fn.isDeclaration() || !Fn.hasLocalLinkage()) return false; // Ensure that the function is only directly called. - for (Value::use_iterator I = Fn.use_begin(), E = Fn.use_end(); I != E; ++I) { - // If this use is anything other than a call site, give up. - CallSite CS = CallSite::get(*I); - Instruction *TheCall = CS.getInstruction(); - if (!TheCall) return false; // Not a direct call site? - - // The addr of this function is passed to the call. - if (!CS.isCallee(I)) return false; - } + if (Fn.hasAddressTaken()) + return false; // Okay, we know we can transform this function if safe. Scan its body // looking for calls to llvm.vastart. |
