diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-04 06:29:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-04 06:29:29 +0000 |
commit | 1ddfd9f96cae0aabb20f025bc6993ede3976caa5 (patch) | |
tree | 47640ef8799fa54c9b8da1d11475867fb4c096fa /llvm/lib | |
parent | 5c9e7b16a5ae83fda7aa3f9dd0736ec7b0b9edf2 (diff) | |
download | bcm5719-llvm-1ddfd9f96cae0aabb20f025bc6993ede3976caa5.tar.gz bcm5719-llvm-1ddfd9f96cae0aabb20f025bc6993ede3976caa5.zip |
Fix PR5551 by not ignoring the top level constantexpr when
folding a load from constant.
llvm-svn: 90545
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 4b0b9a54c77..eaf90d014ff 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -432,7 +432,7 @@ Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C, // Instead of loading constant c string, use corresponding integer value // directly if string length is small enough. std::string Str; - if (TD && GetConstantStringInfo(CE->getOperand(0), Str) && !Str.empty()) { + if (TD && GetConstantStringInfo(CE, Str) && !Str.empty()) { unsigned StrLen = Str.length(); const Type *Ty = cast<PointerType>(CE->getType())->getElementType(); unsigned NumBits = Ty->getPrimitiveSizeInBits(); |