summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-upgrade/UpgradeParser.y
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-04-07 13:45:04 +0000
committerDuncan Sands <baldrick@free.fr>2008-04-07 13:45:04 +0000
commit813384951e274b03dec8d0b15d9671533461d7bc (patch)
treefb84aae6dc12900ee3de908d9b44f1602cbc6940 /llvm/tools/llvm-upgrade/UpgradeParser.y
parent1416ebf1fe56290cfc1e91e0aba71b93c0c275bc (diff)
downloadbcm5719-llvm-813384951e274b03dec8d0b15d9671533461d7bc.tar.gz
bcm5719-llvm-813384951e274b03dec8d0b15d9671533461d7bc.zip
Use Intrinsic::getDeclaration in more places.
llvm-svn: 49338
Diffstat (limited to 'llvm/tools/llvm-upgrade/UpgradeParser.y')
-rw-r--r--llvm/tools/llvm-upgrade/UpgradeParser.y17
1 files changed, 7 insertions, 10 deletions
diff --git a/llvm/tools/llvm-upgrade/UpgradeParser.y b/llvm/tools/llvm-upgrade/UpgradeParser.y
index 39172c36571..3eb00617f35 100644
--- a/llvm/tools/llvm-upgrade/UpgradeParser.y
+++ b/llvm/tools/llvm-upgrade/UpgradeParser.y
@@ -1593,8 +1593,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in,
const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
const Type* ArgTy = F->getFunctionType()->getReturnType();
const Type* ArgTyPtr = PointerType::getUnqual(ArgTy);
- Function* NF = cast<Function>(Result->getOrInsertFunction(
- "llvm.va_start", RetTy, ArgTyPtr, (Type *)0));
+ Function* NF = Intrinsic::getDeclaration(Result, Intrinsic::va_start);
while (!F->use_empty()) {
CallInst* CI = cast<CallInst>(F->use_back());
@@ -1620,8 +1619,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in,
const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
const Type* ArgTy = F->getFunctionType()->getParamType(0);
const Type* ArgTyPtr = PointerType::getUnqual(ArgTy);
- Function* NF = cast<Function>(Result->getOrInsertFunction(
- "llvm.va_end", RetTy, ArgTyPtr, (Type *)0));
+ Function* NF = Intrinsic::getDeclaration(Result, Intrinsic::va_end);
while (!F->use_empty()) {
CallInst* CI = cast<CallInst>(F->use_back());
@@ -1649,8 +1647,7 @@ Module* UpgradeAssembly(const std::string &infile, std::istream& in,
const Type* RetTy = Type::getPrimitiveType(Type::VoidTyID);
const Type* ArgTy = F->getFunctionType()->getReturnType();
const Type* ArgTyPtr = PointerType::getUnqual(ArgTy);
- Function* NF = cast<Function>(Result->getOrInsertFunction(
- "llvm.va_copy", RetTy, ArgTyPtr, ArgTyPtr, (Type *)0));
+ Function* NF = Intrinsic::getDeclaration(Result, Intrinsic::va_copy);
while (!F->use_empty()) {
CallInst* CI = cast<CallInst>(F->use_back());
@@ -3551,8 +3548,8 @@ InstVal
const Type* ArgTy = $2.V->getType();
const Type* DstTy = $4.PAT->get();
ObsoleteVarArgs = true;
- Function* NF = cast<Function>(CurModule.CurrentModule->
- getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0));
+ Function* NF = Intrinsic::getDeclaration(CurModule.CurrentModule,
+ Intrinsic::va_copy);
//b = vaarg a, t ->
//foo = alloca 1 of t
@@ -3572,8 +3569,8 @@ InstVal
const Type* ArgTy = $2.V->getType();
const Type* DstTy = $4.PAT->get();
ObsoleteVarArgs = true;
- Function* NF = cast<Function>(CurModule.CurrentModule->
- getOrInsertFunction("llvm.va_copy", ArgTy, ArgTy, (Type *)0));
+ Function* NF = Intrinsic::getDeclaration(CurModule.CurrentModule,
+ Intrinsic::va_copy);
//b = vanext a, t ->
//foo = alloca 1 of t
OpenPOWER on IntegriCloud