summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AutoUpgrade.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-12-12 10:57:20 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-12-12 10:57:20 +0000
commitd4a02403b329b789523bde1ba003538b980277c7 (patch)
tree0f33f1d78e18bc5a9b7723dd0aaf45333492cbb5 /llvm/lib/VMCore/AutoUpgrade.cpp
parentbb4189db23c30ea66b36f147375c383c3f9430f8 (diff)
downloadbcm5719-llvm-d4a02403b329b789523bde1ba003538b980277c7.tar.gz
bcm5719-llvm-d4a02403b329b789523bde1ba003538b980277c7.zip
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. llvm-svn: 146368
Diffstat (limited to 'llvm/lib/VMCore/AutoUpgrade.cpp')
-rw-r--r--llvm/lib/VMCore/AutoUpgrade.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/AutoUpgrade.cpp b/llvm/lib/VMCore/AutoUpgrade.cpp
index 6bdb115a9aa..ef29f71d173 100644
--- a/llvm/lib/VMCore/AutoUpgrade.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud