diff options
author | Gabor Greif <ggreif@gmail.com> | 2009-01-23 21:17:04 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2009-01-23 21:17:04 +0000 |
commit | 40b65c898d1f259593997b1ac14c4c018ad513f7 (patch) | |
tree | a8508dc6d5ffaa23c5b17cb1e99aef2f8663b37d /lib | |
parent | a36791da41cf4f635e50077b290676b873836bda (diff) | |
download | external_llvm-40b65c898d1f259593997b1ac14c4c018ad513f7.zip external_llvm-40b65c898d1f259593997b1ac14c4c018ad513f7.tar.gz external_llvm-40b65c898d1f259593997b1ac14c4c018ad513f7.tar.bz2 |
use CallSite::isCalle instead of slow getOperandNo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/IPO/DeadArgumentElimination.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 9d7980c..dd5fce6 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -182,7 +182,7 @@ bool DAE::DeleteDeadVarargs(Function &Fn) { if (!TheCall) return false; // Not a direct call site? // The addr of this function is passed to the call. - if (I.getOperandNo() != 0) return false; + if (!CS.isCallee(I)) return false; } // Okay, we know we can transform this function if safe. Scan its body @@ -438,13 +438,13 @@ void DAE::SurveyFunction(Function &F) { for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) { // If the function is PASSED IN as an argument, its address has been // taken. - if (I.getOperandNo() != 0) { + CallSite CS = CallSite::get(*I); + if (!CS.getInstruction() || !CS.isCallee(I)) { MarkLive(F); return; } // If this use is anything other than a call site, the function is alive. - CallSite CS = CallSite::get(*I); Instruction *TheCall = CS.getInstruction(); if (!TheCall) { // Not a direct call site? MarkLive(F); |