mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Set debug info for instructions inserted in SplitBlockAndInsertIfThen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204230 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -667,8 +667,10 @@ TerminatorInst *llvm::SplitBlockAndInsertIfThen(Value *Cond,
|
||||
CheckTerm = new UnreachableInst(C, ThenBlock);
|
||||
else
|
||||
CheckTerm = BranchInst::Create(Tail, ThenBlock);
|
||||
CheckTerm->setDebugLoc(SplitBefore->getDebugLoc());
|
||||
BranchInst *HeadNewTerm =
|
||||
BranchInst::Create(/*ifTrue*/ThenBlock, /*ifFalse*/Tail, Cond);
|
||||
HeadNewTerm->setDebugLoc(SplitBefore->getDebugLoc());
|
||||
HeadNewTerm->setMetadata(LLVMContext::MD_prof, BranchWeights);
|
||||
ReplaceInstWithInst(HeadOldTerm, HeadNewTerm);
|
||||
return CheckTerm;
|
||||
@ -699,9 +701,12 @@ void llvm::SplitBlockAndInsertIfThenElse(Value *Cond, Instruction *SplitBefore,
|
||||
BasicBlock *ThenBlock = BasicBlock::Create(C, "", Head->getParent(), Tail);
|
||||
BasicBlock *ElseBlock = BasicBlock::Create(C, "", Head->getParent(), Tail);
|
||||
*ThenTerm = BranchInst::Create(Tail, ThenBlock);
|
||||
(*ThenTerm)->setDebugLoc(SplitBefore->getDebugLoc());
|
||||
*ElseTerm = BranchInst::Create(Tail, ElseBlock);
|
||||
(*ElseTerm)->setDebugLoc(SplitBefore->getDebugLoc());
|
||||
BranchInst *HeadNewTerm =
|
||||
BranchInst::Create(/*ifTrue*/ThenBlock, /*ifFalse*/ElseBlock, Cond);
|
||||
HeadNewTerm->setDebugLoc(SplitBefore->getDebugLoc());
|
||||
HeadNewTerm->setMetadata(LLVMContext::MD_prof, BranchWeights);
|
||||
ReplaceInstWithInst(HeadOldTerm, HeadNewTerm);
|
||||
}
|
||||
|
Reference in New Issue
Block a user