diff options
| author | Gabor Greif <ggreif@gmail.com> | 2010-03-20 21:00:25 +0000 |
|---|---|---|
| committer | Gabor Greif <ggreif@gmail.com> | 2010-03-20 21:00:25 +0000 |
| commit | febf6ab718bcb41c00c060a5320d449faaf88d26 (patch) | |
| tree | 2cb2c9692b16e50b14fee5df5314faaf5c94632c /llvm/lib | |
| parent | 322cbff3d3a5f48ad64df98ba460abdb1929bca2 (diff) | |
| download | bcm5719-llvm-febf6ab718bcb41c00c060a5320d449faaf88d26.tar.gz bcm5719-llvm-febf6ab718bcb41c00c060a5320d449faaf88d26.zip | |
Add a setCalledFunction member to InvokeInst (like in CallInst)
and use this (as well as getCalledValue) to access the callee,
instead of {g|s}etOperand(0).
llvm-svn: 99084
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/IPO/GlobalOpt.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp index 7b1e9c0efdd..d8e97a26ada 100644 --- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp +++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp @@ -622,12 +622,12 @@ static bool AllUsesOfValueWillTrapIfNull(Value *V, return false; // Storing the value. } } else if (CallInst *CI = dyn_cast<CallInst>(*UI)) { - if (CI->getOperand(0) != V) { + if (CI->getCalledValue() != V) { //cerr << "NONTRAPPING USE: " << **UI; return false; // Not calling the ptr } } else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) { - if (II->getOperand(0) != V) { + if (II->getCalledValue() != V) { //cerr << "NONTRAPPING USE: " << **UI; return false; // Not calling the ptr } diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index bdb46ebd1a6..65f2e15d278 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -820,7 +820,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { // We cannot remove an invoke, because it would change the CFG, just // change the callee to a null pointer. - cast<InvokeInst>(OldCall)->setOperand(0, + cast<InvokeInst>(OldCall)->setCalledFunction( Constant::getNullValue(CalleeF->getType())); return 0; } |

