diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index e221022..975ce3b 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1137,7 +1137,7 @@ static void cloneInstructionsIntoPredecessorBlockAndUpdateSSAUses( // branch, drop it. When we fold the bonus instructions we want to make // sure we reset their debug locations in order to avoid stepping on // dead code caused by folding dead branches. - NewBonusInst->setDebugLoc(DebugLoc()); + NewBonusInst->setDebugLoc(DebugLoc::getDropped()); } else if (const DebugLoc &DL = NewBonusInst->getDebugLoc()) { mapAtomInstance(DL, VMap); } @@ -2821,7 +2821,8 @@ static void mergeCompatibleInvokesImpl(ArrayRef<InvokeInst *> Invokes, // so just form a new block with unreachable terminator. BasicBlock *MergedNormalDest = BasicBlock::Create( Ctx, II0BB->getName() + ".cont", Func, InsertBeforeBlock); - new UnreachableInst(Ctx, MergedNormalDest); + auto *UI = new UnreachableInst(Ctx, MergedNormalDest); + UI->setDebugLoc(DebugLoc::getTemporary()); MergedInvoke->setNormalDest(MergedNormalDest); } @@ -3389,7 +3390,7 @@ bool SimplifyCFGOpt::speculativelyExecuteBB(BranchInst *BI, if (!SpeculatedStoreValue || &I != SpeculatedStore) { // Don't update the DILocation of dbg.assign intrinsics. if (!isa<DbgAssignIntrinsic>(&I)) - I.setDebugLoc(DebugLoc()); + I.setDebugLoc(DebugLoc::getDropped()); } I.dropUBImplyingAttrsAndMetadata(); @@ -5707,7 +5708,8 @@ static void createUnreachableSwitchDefault(SwitchInst *Switch, BasicBlock *NewDefaultBlock = BasicBlock::Create( BB->getContext(), BB->getName() + ".unreachabledefault", BB->getParent(), OrigDefaultBlock); - new UnreachableInst(Switch->getContext(), NewDefaultBlock); + auto *UI = new UnreachableInst(Switch->getContext(), NewDefaultBlock); + UI->setDebugLoc(DebugLoc::getTemporary()); Switch->setDefaultDest(&*NewDefaultBlock); if (DTU) { SmallVector<DominatorTree::UpdateType, 2> Updates; |