diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-12-12 10:57:20 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-12-12 10:57:20 +0000 |
commit | a56f5581ecb6ba741645a74bfa399f4bdf5b2f71 (patch) | |
tree | 08da21d83817f0bd858b038105fb053cfe1475c4 /lib/VMCore | |
parent | d45fbe62270eaf826419b93f1da66f1850f37faf (diff) | |
download | external_llvm-a56f5581ecb6ba741645a74bfa399f4bdf5b2f71.zip external_llvm-a56f5581ecb6ba741645a74bfa399f4bdf5b2f71.tar.gz external_llvm-a56f5581ecb6ba741645a74bfa399f4bdf5b2f71.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AutoUpgrade.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index 6bdb115..ef29f71 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -41,15 +41,16 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { 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; |