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 | 7574ef3ac4a66f9e79a631c8fce43d9d61027794 (patch) | |
tree | 0430218fa927a3ec9c97451e9e714f3352877c83 /llvm/lib/Analysis/ConstantFolding.cpp | |
parent | d771b793fe75e32fc581ae2478c6cb7096c44905 (diff) | |
download | bcm5719-llvm-7574ef3ac4a66f9e79a631c8fce43d9d61027794.tar.gz bcm5719-llvm-7574ef3ac4a66f9e79a631c8fce43d9d61027794.zip |
Handle functions with no name better.
llvm-svn: 40926
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 2422c4870aa..9599a900f26 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/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(); |