diff options
| author | Serge Guelton <sguelton@quarkslab.com> | 2017-04-11 15:01:18 +0000 |
|---|---|---|
| committer | Serge Guelton <sguelton@quarkslab.com> | 2017-04-11 15:01:18 +0000 |
| commit | 59a2d7b9093617aff6b6f147ba267bc788aa08b7 (patch) | |
| tree | 2ffc9141cd19edf0d123828627a9f1e8c4c19907 /llvm/lib/Target | |
| parent | de3b9a2ecc7e9ebe3fc1780aede0223821c52d2a (diff) | |
| download | bcm5719-llvm-59a2d7b9093617aff6b6f147ba267bc788aa08b7.tar.gz bcm5719-llvm-59a2d7b9093617aff6b6f147ba267bc788aa08b7.zip | |
Module::getOrInsertFunction is using C-style vararg instead of variadic templates.
From a user prospective, it forces the use of an annoying nullptr to mark the end of the vararg, and there's not type checking on the arguments.
The variadic template is an obvious solution to both issues.
Differential Revision: https://reviews.llvm.org/D31070
llvm-svn: 299949
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/Target/Mips/Mips16HardFloat.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp index 6515e1e748a..b5948475e1f 100644 --- a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp +++ b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp @@ -2146,8 +2146,7 @@ CleanupAndExit: Type *VoidTy = Type::getVoidTy(Ctx); Module *M = Func->getParent(); Constant *CF = M->getOrInsertFunction(HexagonVolatileMemcpyName, VoidTy, - Int32PtrTy, Int32PtrTy, Int32Ty, - nullptr); + Int32PtrTy, Int32PtrTy, Int32Ty); Function *Fn = cast<Function>(CF); Fn->setLinkage(Function::ExternalLinkage); diff --git a/llvm/lib/Target/Mips/Mips16HardFloat.cpp b/llvm/lib/Target/Mips/Mips16HardFloat.cpp index 53a5d2f0ac1..a71b161b24c 100644 --- a/llvm/lib/Target/Mips/Mips16HardFloat.cpp +++ b/llvm/lib/Target/Mips/Mips16HardFloat.cpp @@ -420,7 +420,7 @@ static bool fixupFPReturnAndCall(Function &F, Module *M, Attribute::ReadNone); A = A.addAttribute(C, AttributeList::FunctionIndex, Attribute::NoInline); - Value *F = (M->getOrInsertFunction(Name, A, MyVoid, T, nullptr)); + Value *F = (M->getOrInsertFunction(Name, A, MyVoid, T)); CallInst::Create(F, Params, "", &I); } else if (const CallInst *CI = dyn_cast<CallInst>(&I)) { FunctionType *FT = CI->getFunctionType(); diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index fb31ce6d78e..a830dce109b 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -2101,7 +2101,7 @@ void X86TargetLowering::insertSSPDeclarations(Module &M) const { auto *SecurityCheckCookie = cast<Function>( M.getOrInsertFunction("__security_check_cookie", Type::getVoidTy(M.getContext()), - Type::getInt8PtrTy(M.getContext()), nullptr)); + Type::getInt8PtrTy(M.getContext()))); SecurityCheckCookie->setCallingConv(CallingConv::X86_FastCall); SecurityCheckCookie->addAttribute(1, Attribute::AttrKind::InReg); return; |

