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 | 44a7a380aa9fbb303f57f4f8269062b7b56be980 (patch) | |
tree | 844e2b9e276bd18c2aa3d7ea9c99dfd4ab20a45d /lib/Analysis/ConstantFolding.cpp | |
parent | bbf9a5845acf35167211128b1b4b1b81d38ccb31 (diff) |
Fix PR5551 by not ignoring the top level constantexpr when
folding a load from constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 4b0b9a54c7..eaf90d014f 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/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(); |