diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-06-07 19:05:06 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-06-07 19:05:06 +0000 |
commit | 22a5b298201d62daea3e06718469d8ad017895e1 (patch) | |
tree | fcbdcb7e5e1adbd679c817a6699fe07866503b1e /lib/Analysis/IPA | |
parent | 6c8099243a0d8ff710e8f657628a8bea99b5dd07 (diff) | |
download | external_llvm-22a5b298201d62daea3e06718469d8ad017895e1.zip external_llvm-22a5b298201d62daea3e06718469d8ad017895e1.tar.gz external_llvm-22a5b298201d62daea3e06718469d8ad017895e1.tar.bz2 |
Create new accessors to get arguments for call/invoke instructions. It breaks
encapsulation to force the users of these classes to know about the internal
data structure of the Operands structure. It also can lead to errors, like in
the MSIL writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA')
-rw-r--r-- | lib/Analysis/IPA/GlobalsModRef.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index b14afa3..fa5edfc 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -252,13 +252,13 @@ bool GlobalsModRef::AnalyzeUsesOfPointer(Value *V, } else if (CallInst *CI = dyn_cast<CallInst>(*UI)) { // Make sure that this is just the function being called, not that it is // passing into the function. - for (unsigned i = 1, e = CI->getNumOperands(); i != e; ++i) - if (CI->getOperand(i) == V) return true; + for (unsigned i = 0, e = CI->getNumArgOperands(); i != e; ++i) + if (CI->getArgOperand(i) == V) return true; } else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) { // Make sure that this is just the function being called, not that it is // passing into the function. - for (unsigned i = 0, e = II->getNumOperands() - 3; i != e; ++i) - if (II->getOperand(i) == V) return true; + for (unsigned i = 0, e = II->getNumArgOperands(); i != e; ++i) + if (II->getArgOperand(i) == V) return true; } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(*UI)) { if (CE->getOpcode() == Instruction::GetElementPtr || CE->getOpcode() == Instruction::BitCast) { |