[llvm-branch-commits] [llvm-branch] r99396 - /llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/Scalar/SCCP.cpp
Gabor Greif
ggreif at gmail.com
Wed Mar 24 03:33:54 PDT 2010
Author: ggreif
Date: Wed Mar 24 05:33:54 2010
New Revision: 99396
URL: http://llvm.org/viewvc/llvm-project?rev=99396&view=rev
Log:
pull r99395 from trunk
Modified:
llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/Scalar/SCCP.cpp (contents, props changed)
Modified: llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/Scalar/SCCP.cpp?rev=99396&r1=99395&r2=99396&view=diff
==============================================================================
--- llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/Scalar/SCCP.cpp Wed Mar 24 05:33:54 2010
@@ -1705,28 +1705,30 @@
}
-static bool AddressIsTaken(GlobalValue *GV) {
+static bool AddressIsTaken(const GlobalValue *GV) {
// Delete any dead constantexpr klingons.
GV->removeDeadConstantUsers();
- for (Value::use_iterator UI = GV->use_begin(), E = GV->use_end();
- UI != E; ++UI)
- if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
+ for (Value::use_const_iterator UI = GV->use_begin(), E = GV->use_end();
+ UI != E; ++UI) {
+ const User *U = *UI;
+ if (const StoreInst *SI = dyn_cast<StoreInst>(U)) {
if (SI->getOperand(0) == GV || SI->isVolatile())
return true; // Storing addr of GV.
- } else if (isa<InvokeInst>(*UI) || isa<CallInst>(*UI)) {
+ } else if (isa<InvokeInst>(U) || isa<CallInst>(U)) {
// Make sure we are calling the function, not passing the address.
if (UI.getOperandNo() != 0)
return true;
- } else if (LoadInst *LI = dyn_cast<LoadInst>(*UI)) {
+ } else if (const LoadInst *LI = dyn_cast<LoadInst>(U)) {
if (LI->isVolatile())
return true;
- } else if (isa<BlockAddress>(*UI)) {
+ } else if (isa<BlockAddress>(U)) {
// blockaddress doesn't take the address of the function, it takes addr
// of label.
} else {
return true;
}
+ }
return false;
}
Propchange: llvm/branches/ggreif/InvokeInst-operands/lib/Transforms/Scalar/SCCP.cpp
------------------------------------------------------------------------------
svn:mergeinfo = /llvm/trunk/lib/Transforms/Scalar/SCCP.cpp:99084,99395
More information about the llvm-branch-commits
mailing list