[llvm-commits] [poolalloc] r126532 - /poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Fri Feb 25 15:37:46 PST 2011
Author: aggarwa4
Date: Fri Feb 25 17:37:46 2011
New Revision: 126532
URL: http://llvm.org/viewvc/llvm-project?rev=126532&view=rev
Log:
call (bitcast F to ...) () should not cause F to
be considered address taken, as that value is never
really stored, and used elsewhere.
Modified:
poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp
Modified: poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp?rev=126532&r1=126531&r2=126532&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp (original)
+++ poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp Fri Feb 25 17:37:46 2011
@@ -48,8 +48,14 @@
if(isAddressTaken(U))
return true;
} else {
- // FIXME handle bitcasts to see if the resultant value
- // is ever used in an address taken fashion
+ if (Constant *C = dyn_cast<Constant>(U)) {
+ if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
+ if (CE->getOpcode() == Instruction::BitCast) {
+ return isAddressTaken(CE);
+ }
+ }
+ }
+
return true;
}
More information about the llvm-commits
mailing list