summaryrefslogtreecommitdiff
path: root/lib/CodeGen/StackProtector.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
committerOwen Anderson <resistor@mac.com>2009-08-13 21:58:54 +0000
commit1d0be15f89cb5056e20e2d24faa8d6afb1573bca (patch)
tree2cdabe223bfce83bd12e10dd557147a2f68c9bf8 /lib/CodeGen/StackProtector.cpp
parentd163e8b14c8aa5bbbb129e3f0dffdbe7213a3c72 (diff)
downloadllvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.gz
llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.bz2
llvm-1d0be15f89cb5056e20e2d24faa8d6afb1573bca.tar.xz
Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StackProtector.cpp')
-rw-r--r--lib/CodeGen/StackProtector.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp
index 9043b89e35..350bc6e1ad 100644
--- a/lib/CodeGen/StackProtector.cpp
+++ b/lib/CodeGen/StackProtector.cpp
@@ -148,7 +148,8 @@ bool StackProtector::InsertStackProtectors() {
// StackGuard = load __stack_chk_guard
// call void @llvm.stackprotect.create(StackGuard, StackGuardSlot)
//
- PointerType *PtrTy = PointerType::getUnqual(Type::Int8Ty);
+ PointerType *PtrTy = PointerType::getUnqual(
+ Type::getInt8Ty(RI->getContext()));
StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy);
BasicBlock &Entry = F->getEntryBlock();
@@ -215,10 +216,12 @@ bool StackProtector::InsertStackProtectors() {
/// CreateFailBB - Create a basic block to jump to when the stack protector
/// check fails.
BasicBlock *StackProtector::CreateFailBB() {
- BasicBlock *FailBB = BasicBlock::Create("CallStackCheckFailBlk", F);
+ BasicBlock *FailBB = BasicBlock::Create(F->getContext(),
+ "CallStackCheckFailBlk", F);
Constant *StackChkFail =
- M->getOrInsertFunction("__stack_chk_fail", Type::VoidTy, NULL);
+ M->getOrInsertFunction("__stack_chk_fail",
+ Type::getVoidTy(F->getContext()), NULL);
CallInst::Create(StackChkFail, "", FailBB);
- new UnreachableInst(FailBB);
+ new UnreachableInst(F->getContext(), FailBB);
return FailBB;
}