[llvm-commits] [llvm] r58728 - /llvm/trunk/lib/CodeGen/StackProtector.cpp
Bill Wendling
isanbard at gmail.com
Tue Nov 4 14:54:44 PST 2008
Author: void
Date: Tue Nov 4 16:54:43 2008
New Revision: 58728
URL: http://llvm.org/viewvc/llvm-project?rev=58728&view=rev
Log:
Small simplification of the stack guard type.
Modified:
llvm/trunk/lib/CodeGen/StackProtector.cpp
Modified: llvm/trunk/lib/CodeGen/StackProtector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackProtector.cpp?rev=58728&r1=58727&r2=58728&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StackProtector.cpp (original)
+++ llvm/trunk/lib/CodeGen/StackProtector.cpp Tue Nov 4 16:54:43 2008
@@ -114,11 +114,10 @@
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);
}
More information about the llvm-commits
mailing list