[llvm-commits] [llvm] r68351 - /llvm/trunk/lib/Analysis/ConstantFolding.cpp

Chris Lattner sabre at nondot.org
Thu Apr 2 17:02:39 PDT 2009


Author: lattner
Date: Thu Apr  2 19:02:39 2009
New Revision: 68351

URL: http://llvm.org/viewvc/llvm-project?rev=68351&view=rev
Log:
use higher level APIs.

Modified:
    llvm/trunk/lib/Analysis/ConstantFolding.cpp

Modified: llvm/trunk/lib/Analysis/ConstantFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ConstantFolding.cpp?rev=68351&r1=68350&r2=68351&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ConstantFolding.cpp (original)
+++ llvm/trunk/lib/Analysis/ConstantFolding.cpp Thu Apr  2 19:02:39 2009
@@ -571,10 +571,9 @@
   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 @@
 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) {





More information about the llvm-commits mailing list