diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-03 00:02:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-03 00:02:39 +0000 |
commit | 6f532a988e5c02fcb271fb65e9e7b83f0147d3f2 (patch) | |
tree | b9b79b03a66871db15badc5c78e2c883139d60ab /lib/Analysis/ConstantFolding.cpp | |
parent | 6caced956460ec360c79dc7d20e872fba1b73583 (diff) |
use higher level APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68351 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | lib/Analysis/ConstantFolding.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp index d4457b3031..ac2670a163 100644 --- a/lib/Analysis/ConstantFolding.cpp +++ b/lib/Analysis/ConstantFolding.cpp @@ -571,10 +571,9 @@ llvm::canConstantFoldCallTo(const Function *F) { default: break; } - const ValueName *NameVal = F->getValueName(); - if (NameVal == 0) return false; - const char *Str = NameVal->getKeyData(); - unsigned Len = NameVal->getKeyLength(); + if (!F->hasName()) return false; + const char *Str = F->getNameStart(); + unsigned Len = F->getNameLen(); // 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 @@ -675,10 +674,9 @@ static Constant *ConstantFoldBinaryFP(double (*NativeFP)(double, double), Constant * llvm::ConstantFoldCall(Function *F, Constant* const* Operands, unsigned NumOperands) { - const ValueName *NameVal = F->getValueName(); - if (NameVal == 0) return 0; - const char *Str = NameVal->getKeyData(); - unsigned Len = NameVal->getKeyLength(); + if (!F->hasName()) return 0; + const char *Str = F->getNameStart(); + unsigned Len = F->getNameLen(); const Type *Ty = F->getReturnType(); if (NumOperands == 1) { |