diff options
author | Duncan Sands <baldrick@free.fr> | 2008-04-07 13:45:04 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-04-07 13:45:04 +0000 |
commit | 3c81269349934a51dc02c6a67442ef5e59cfca8e (patch) | |
tree | 9af3752cb94fdcdfdd719ba7917427fd01ac97ca /tools | |
parent | 17836443fc001dd20fc39126cdb343e6df04a86f (diff) | |
download | external_llvm-3c81269349934a51dc02c6a67442ef5e59cfca8e.zip external_llvm-3c81269349934a51dc02c6a67442ef5e59cfca8e.tar.gz external_llvm-3c81269349934a51dc02c6a67442ef5e59cfca8e.tar.bz2 |
Use Intrinsic::getDeclaration in more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49338 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-upgrade/UpgradeParser.y | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/llvm-upgrade/UpgradeParser.y b/tools/llvm-upgrade/UpgradeParser.y index 39172c3..3eb0061 100644 --- a/tools/llvm-upgrade/UpgradeParser.y +++ b/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 |