[llvm-commits] [llvm] r146368 - /llvm/trunk/lib/VMCore/AutoUpgrade.cpp

Chandler Carruth chandlerc at gmail.com
Mon Dec 12 02:57:20 PST 2011


Author: chandlerc
Date: Mon Dec 12 04:57:20 2011
New Revision: 146368

URL: http://llvm.org/viewvc/llvm-project?rev=146368&view=rev
Log:
Don't rely in there being one argument before we've actually identified
a function to upgrade. Also, simplify the code a bit at the expense of
one line.

Modified:
    llvm/trunk/lib/VMCore/AutoUpgrade.cpp

Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=146368&r1=146367&r2=146368&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original)
+++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Mon Dec 12 04:57:20 2011
@@ -41,15 +41,16 @@
   switch (Name[0]) {
   default: break;
   case 'c': {
-    Type *Tys[] = { F->arg_begin()->getType() };
     if (Name.startswith("ctlz.") && F->arg_size() == 1) {
       F->setName(Name + ".old");
-      NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::ctlz, Tys);
+      NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::ctlz,
+                                        F->arg_begin()->getType());
       return true;
     }
     if (Name.startswith("cttz.") && F->arg_size() == 1) {
       F->setName(Name + ".old");
-      NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::cttz, Tys);
+      NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::cttz,
+                                        F->arg_begin()->getType());
       return true;
     }
     break;





More information about the llvm-commits mailing list