diff options
author | Chris Lattner <sabre@nondot.org> | 2007-08-08 16:07:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-08-08 16:07:23 +0000 |
commit | a099b6c7bb574f22bc002e0b3c65c25abccca1d5 (patch) | |
tree | 8ec41db4a9cb2b4421ab35b4cca2d2c0235da5b0 /lib | |
parent | 24c2e5cf7e926452ea5875d027ec0d24d9c19e39 (diff) | |
download | external_llvm-a099b6c7bb574f22bc002e0b3c65c25abccca1d5.zip external_llvm-a099b6c7bb574f22bc002e0b3c65c25abccca1d5.tar.gz external_llvm-a099b6c7bb574f22bc002e0b3c65c25abccca1d5.tar.bz2 |
Handle functions with no name better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index 2422c48..9599a90 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -327,9 +327,9 @@ llvm::canConstantFoldCallTo(Function *F) { } const ValueName *NameVal = F->getValueName(); + if (NameVal == 0) return false; const char *Str = NameVal->getKeyData(); unsigned Len = NameVal->getKeyLength(); - if (Len == 0) return false; // In these cases, the check of the length is required. We don't want to // return true for a name like "cos\0blah" which strcmp would return equal to @@ -414,6 +414,7 @@ static Constant *ConstantFoldBinaryFP(double (*NativeFP)(double, double), Constant * llvm::ConstantFoldCall(Function *F, Constant** Operands, unsigned NumOperands) { const ValueName *NameVal = F->getValueName(); + if (NameVal == 0) return 0; const char *Str = NameVal->getKeyData(); unsigned Len = NameVal->getKeyLength(); |