diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2017-04-06 20:23:57 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2017-04-06 20:23:57 +0000 |
commit | db11fdfda50017e0175602fec9949aa34141656a (patch) | |
tree | 97064cff0f2304c6d9c6f15e2a7c4f90fbbf9f8b /llvm/lib/CodeGen | |
parent | 98240e964366419bdbdb34706811f44e705d6786 (diff) | |
download | bcm5719-llvm-db11fdfda50017e0175602fec9949aa34141656a.tar.gz bcm5719-llvm-db11fdfda50017e0175602fec9949aa34141656a.zip |
Revert "Turn some C-style vararg into variadic templates"
This reverts commit r299699, the examples needs to be updated.
llvm-svn: 299702
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/CountingFunctionInserter.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/IntrinsicLowering.cpp | 24 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineOutliner.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SafeStack.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SjLjEHPrepare.cpp | 8 | ||||
-rw-r--r-- | llvm/lib/CodeGen/StackProtector.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 2 |
7 files changed, 31 insertions, 23 deletions
diff --git a/llvm/lib/CodeGen/CountingFunctionInserter.cpp b/llvm/lib/CodeGen/CountingFunctionInserter.cpp index 8182d43d259..1e46a7a99e7 100644 --- a/llvm/lib/CodeGen/CountingFunctionInserter.cpp +++ b/llvm/lib/CodeGen/CountingFunctionInserter.cpp @@ -40,7 +40,8 @@ namespace { Type *VoidTy = Type::getVoidTy(F.getContext()); Constant *CountingFn = - F.getParent()->getOrInsertFunction(CountingFunctionName, VoidTy); + F.getParent()->getOrInsertFunction(CountingFunctionName, + VoidTy, nullptr); CallInst::Create(CountingFn, "", &*F.begin()->getFirstInsertionPt()); return true; } diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp index 509000524d5..afd24067ace 100644 --- a/llvm/lib/CodeGen/IntrinsicLowering.cpp +++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp @@ -111,19 +111,25 @@ void IntrinsicLowering::AddPrototypes(Module &M) { Type::getVoidTy(M.getContext())); break; case Intrinsic::memcpy: - M.getOrInsertFunction( - "memcpy", Type::getInt8PtrTy(Context), Type::getInt8PtrTy(Context), - Type::getInt8PtrTy(Context), DL.getIntPtrType(Context)); + M.getOrInsertFunction("memcpy", + Type::getInt8PtrTy(Context), + Type::getInt8PtrTy(Context), + Type::getInt8PtrTy(Context), + DL.getIntPtrType(Context), nullptr); break; case Intrinsic::memmove: - M.getOrInsertFunction( - "memmove", Type::getInt8PtrTy(Context), Type::getInt8PtrTy(Context), - Type::getInt8PtrTy(Context), DL.getIntPtrType(Context)); + M.getOrInsertFunction("memmove", + Type::getInt8PtrTy(Context), + Type::getInt8PtrTy(Context), + Type::getInt8PtrTy(Context), + DL.getIntPtrType(Context), nullptr); break; case Intrinsic::memset: - M.getOrInsertFunction( - "memset", Type::getInt8PtrTy(Context), Type::getInt8PtrTy(Context), - Type::getInt32Ty(M.getContext()), DL.getIntPtrType(Context)); + M.getOrInsertFunction("memset", + Type::getInt8PtrTy(Context), + Type::getInt8PtrTy(Context), + Type::getInt32Ty(M.getContext()), + DL.getIntPtrType(Context), nullptr); break; case Intrinsic::sqrt: EnsureFPIntrinsicsExist(M, F, "sqrtf", "sqrt", "sqrtl"); diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp index 581a8ad8114..2f54630dd87 100644 --- a/llvm/lib/CodeGen/MachineOutliner.cpp +++ b/llvm/lib/CodeGen/MachineOutliner.cpp @@ -1098,7 +1098,7 @@ MachineOutliner::createOutlinedFunction(Module &M, const OutlinedFunction &OF, // Create the function using an IR-level function. LLVMContext &C = M.getContext(); Function *F = dyn_cast<Function>( - M.getOrInsertFunction(NameStream.str(), Type::getVoidTy(C))); + M.getOrInsertFunction(NameStream.str(), Type::getVoidTy(C), nullptr)); assert(F && "Function was null!"); // NOTE: If this is linkonceodr, then we can take advantage of linker deduping diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index e6981e82901..2b82df293c1 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -450,8 +450,8 @@ void SafeStack::checkStackGuard(IRBuilder<> &IRB, Function &F, ReturnInst &RI, /* Unreachable */ true, Weights); IRBuilder<> IRBFail(CheckTerm); // FIXME: respect -fsanitize-trap / -ftrap-function here? - Constant *StackChkFail = - F.getParent()->getOrInsertFunction("__stack_chk_fail", IRB.getVoidTy()); + Constant *StackChkFail = F.getParent()->getOrInsertFunction( + "__stack_chk_fail", IRB.getVoidTy(), nullptr); IRBFail.CreateCall(StackChkFail, {}); } diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp index bf6fdff309f..76e4dc5457a 100644 --- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp +++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp @@ -480,12 +480,12 @@ bool SjLjEHPrepare::undoSwiftErrorSelect(Function &F) { bool SjLjEHPrepare::runOnFunction(Function &F) { Module &M = *F.getParent(); - RegisterFn = M.getOrInsertFunction("_Unwind_SjLj_Register", - Type::getVoidTy(M.getContext()), - PointerType::getUnqual(FunctionContextTy)); + RegisterFn = M.getOrInsertFunction( + "_Unwind_SjLj_Register", Type::getVoidTy(M.getContext()), + PointerType::getUnqual(FunctionContextTy), nullptr); UnregisterFn = M.getOrInsertFunction( "_Unwind_SjLj_Unregister", Type::getVoidTy(M.getContext()), - PointerType::getUnqual(FunctionContextTy)); + PointerType::getUnqual(FunctionContextTy), nullptr); FrameAddrFn = Intrinsic::getDeclaration(&M, Intrinsic::frameaddress); StackAddrFn = Intrinsic::getDeclaration(&M, Intrinsic::stacksave); StackRestoreFn = Intrinsic::getDeclaration(&M, Intrinsic::stackrestore); diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index 7230b01fe2c..e3fdb96f620 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -481,15 +481,16 @@ BasicBlock *StackProtector::CreateFailBB() { IRBuilder<> B(FailBB); B.SetCurrentDebugLocation(DebugLoc::get(0, 0, F->getSubprogram())); if (Trip.isOSOpenBSD()) { - Constant *StackChkFail = M->getOrInsertFunction( - "__stack_smash_handler", Type::getVoidTy(Context), - Type::getInt8PtrTy(Context)); + Constant *StackChkFail = + M->getOrInsertFunction("__stack_smash_handler", + Type::getVoidTy(Context), + Type::getInt8PtrTy(Context), nullptr); B.CreateCall(StackChkFail, B.CreateGlobalStringPtr(F->getName(), "SSH")); } else { Constant *StackChkFail = - M->getOrInsertFunction("__stack_chk_fail", Type::getVoidTy(Context)); - + M->getOrInsertFunction("__stack_chk_fail", Type::getVoidTy(Context), + nullptr); B.CreateCall(StackChkFail, {}); } B.CreateUnreachable(); diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 27630a3055c..fc147633966 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -1818,7 +1818,7 @@ Value *TargetLoweringBase::getSafeStackPointerLocation(IRBuilder<> &IRB) const { Module *M = IRB.GetInsertBlock()->getParent()->getParent(); Type *StackPtrTy = Type::getInt8PtrTy(M->getContext()); Value *Fn = M->getOrInsertFunction("__safestack_pointer_address", - StackPtrTy->getPointerTo(0)); + StackPtrTy->getPointerTo(0), nullptr); return IRB.CreateCall(Fn); } |