mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
Add an explicit insert point argument to SplitBlockAndInsertIfThen.
Currently SplitBlockAndInsertIfThen requires that branch condition is an Instruction itself, which is very inconvenient, because it is sometimes an Operator, or even a Constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197677 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -565,8 +565,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
||||
Value *Cmp = IRB.CreateICmpNE(ConvertedShadow,
|
||||
getCleanShadow(ConvertedShadow), "_mscmp");
|
||||
Instruction *CheckTerm =
|
||||
SplitBlockAndInsertIfThen(cast<Instruction>(Cmp), false,
|
||||
MS.OriginStoreWeights);
|
||||
SplitBlockAndInsertIfThen(Cmp, &I, false, MS.OriginStoreWeights);
|
||||
IRBuilder<> IRBNew(CheckTerm);
|
||||
IRBNew.CreateAlignedStore(getOrigin(Val), getOriginPtr(Addr, IRBNew),
|
||||
Alignment);
|
||||
@@ -588,10 +587,9 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
||||
continue;
|
||||
Value *Cmp = IRB.CreateICmpNE(ConvertedShadow,
|
||||
getCleanShadow(ConvertedShadow), "_mscmp");
|
||||
Instruction *CheckTerm =
|
||||
SplitBlockAndInsertIfThen(cast<Instruction>(Cmp),
|
||||
/* Unreachable */ !ClKeepGoing,
|
||||
MS.ColdCallWeights);
|
||||
Instruction *CheckTerm = SplitBlockAndInsertIfThen(
|
||||
Cmp, OrigIns,
|
||||
/* Unreachable */ !ClKeepGoing, MS.ColdCallWeights);
|
||||
|
||||
IRB.SetInsertPoint(CheckTerm);
|
||||
if (MS.TrackOrigins) {
|
||||
@@ -629,7 +627,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
|
||||
IRB.CreatePHI(Fn0->getType(), 2, "msandr.indirect_target");
|
||||
|
||||
Instruction *CheckTerm = SplitBlockAndInsertIfThen(
|
||||
cast<Instruction>(NotInThisModule),
|
||||
NotInThisModule, NewFnPhi,
|
||||
/* Unreachable */ false, MS.ColdCallWeights);
|
||||
|
||||
IRB.SetInsertPoint(CheckTerm);
|
||||
|
Reference in New Issue
Block a user