diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-11-18 07:30:57 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-11-18 07:30:57 +0000 |
commit | 733bbc5320ac9d729caa8c0fe741dd516e7eda0b (patch) | |
tree | ad26d97419f2a363cb6352020d0de1371d38c325 /lib/CodeGen/StackProtector.cpp | |
parent | c3348a77f7e1bdc8e52a9f70fd190555df34d7c1 (diff) |
Remove the stackprotector_check intrinsic. Use a volatile load instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/StackProtector.cpp')
-rw-r--r-- | lib/CodeGen/StackProtector.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/CodeGen/StackProtector.cpp b/lib/CodeGen/StackProtector.cpp index 10b5d6d07f..8fe6529ef4 100644 --- a/lib/CodeGen/StackProtector.cpp +++ b/lib/CodeGen/StackProtector.cpp @@ -177,7 +177,7 @@ bool StackProtector::InsertStackProtectors() { // return: // ... // %1 = load __stack_chk_guard - // %2 = call i8* @llvm.stackprotect.check(StackGuardSlot) + // %2 = load StackGuardSlot // %3 = cmp i1 %1, %2 // br i1 %3, label %SP_return, label %CallStackCheckFailBlk // @@ -196,11 +196,9 @@ bool StackProtector::InsertStackProtectors() { NewBB->moveAfter(BB); // Generate the stack protector instructions in the old basic block. - LoadInst *LI = new LoadInst(StackGuardVar, "", false, BB); - CallInst *CI = CallInst:: - Create(Intrinsic::getDeclaration(M, Intrinsic::stackprotector_check), - AI, "", BB); - ICmpInst *Cmp = new ICmpInst(CmpInst::ICMP_EQ, CI, LI, "", BB); + LoadInst *LI1 = new LoadInst(StackGuardVar, "", false, BB); + LoadInst *LI2 = new LoadInst(AI, "", true, BB); + ICmpInst *Cmp = new ICmpInst(CmpInst::ICMP_EQ, LI1, LI2, "", BB); BranchInst::Create(NewBB, FailBB, Cmp, BB); } |