diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-11-04 22:54:43 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-11-04 22:54:43 +0000 |
commit | 4a3a8511827ecdee7e606bdd4dc3733dcac41064 (patch) | |
tree | dfc09c1865deb557092932b50857716b483dbfd8 /lib/CodeGen/StackProtector.cpp | |
parent | b7c2c1246f10972d5a8f55499226872608eb10f9 (diff) |
Small simplification of the stack guard type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StackProtector.cpp')
-rw-r--r-- | lib/CodeGen/StackProtector.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp index 30c3db5b52..12d56c44b2 100644 --- a/lib/CodeGen/StackProtector.cpp +++ b/lib/CodeGen/StackProtector.cpp @@ -114,11 +114,10 @@ bool StackProtector::runOnFunction(Function &Fn) { void StackProtector::InsertStackProtectorPrologue() { BasicBlock &Entry = F->getEntryBlock(); Instruction &InsertPt = Entry.front(); + const PointerType *GuardTy = PointerType::getUnqual(Type::Int8Ty); - StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", - PointerType::getUnqual(Type::Int8Ty)); - StackProtFrameSlot = new AllocaInst(PointerType::getUnqual(Type::Int8Ty), - "StackProt_Frame", &InsertPt); + StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", GuardTy); + StackProtFrameSlot = new AllocaInst(GuardTy, "StackProt_Frame", &InsertPt); LoadInst *LI = new LoadInst(StackGuardVar, "StackGuard", false, &InsertPt); new StoreInst(LI, StackProtFrameSlot, false, &InsertPt); } |