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 | 206f75e7d2a80b95921eff749d5668f78f4b5016 (patch) | |
| tree | beb2c0e86ee79ac705ee4b72ef5f6faadf9b8145 /llvm/lib/Analysis | |
| parent | ddb2e9f7f79594750a6cee996d650ea8c50c87a6 (diff) | |
| download | bcm5719-llvm-206f75e7d2a80b95921eff749d5668f78f4b5016.tar.gz bcm5719-llvm-206f75e7d2a80b95921eff749d5668f78f4b5016.zip  | |
use higher level APIs.
llvm-svn: 68351
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 14 | 
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index d4457b30318..ac2670a163e 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/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) {  | 

