summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2013-12-23 14:15:08 +0000
committerKostya Serebryany <kcc@google.com>2013-12-23 14:15:08 +0000
commit26f1d1cbbce40b3b496d9264064a0ed467f763e6 (patch)
tree1e067c758b5e396b6ee6aa5f9758024baf92c747 /include
parent1fe014e5fcaf45dd1d26affa44a5c9579337f200 (diff)
downloadllvm-26f1d1cbbce40b3b496d9264064a0ed467f763e6.tar.gz
llvm-26f1d1cbbce40b3b496d9264064a0ed467f763e6.tar.bz2
llvm-26f1d1cbbce40b3b496d9264064a0ed467f763e6.tar.xz
[asan] don't unpoison redzones on function exit in use-after-return mode.
Summary: Before this change the instrumented code before Ret instructions looked like: <Unpoison Frame Redzones> if (Frame != OriginalFrame) // I.e. Frame is fake <Poison Complete Frame> Now the instrumented code looks like: if (Frame != OriginalFrame) // I.e. Frame is fake <Poison Complete Frame> else <Unpoison Frame Redzones> Reviewers: eugenis Reviewed By: eugenis CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2458 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197907 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index 6bdf53facb..cab0d5f29c 100644
--- a/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -205,6 +205,26 @@ TerminatorInst *SplitBlockAndInsertIfThen(Value *Cond, Instruction *SplitBefore,
bool Unreachable,
MDNode *BranchWeights = 0);
+
+/// SplitBlockAndInsertIfThenElse is similar to SplitBlockAndInsertIfThen,
+/// but also creates the ElseBlock.
+/// Before:
+/// Head
+/// SplitBefore
+/// Tail
+/// After:
+/// Head
+/// if (Cond)
+/// ThenBlock
+/// else
+/// ElseBlock
+/// SplitBefore
+/// Tail
+void SplitBlockAndInsertIfThenElse(Value *Cond, Instruction *SplitBefore,
+ TerminatorInst **ThenTerm,
+ TerminatorInst **ElseTerm,
+ MDNode *BranchWeights = 0);
+
///
/// GetIfCondition - Check whether BB is the merge point of a if-region.
/// If so, return the boolean condition that determines which entry into