diff options
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/IR/DebugInfoMetadata.cpp | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 2402e01f5f1..ca2dad306b4 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -675,7 +675,8 @@ unsigned llvm::getDebugMetadataVersionFromModule(const Module &M) { void Instruction::applyMergedLocation(const DILocation *LocA, const DILocation *LocB) { - setDebugLoc(DILocation::getMergedLocation(LocA, LocB, this)); + setDebugLoc(DILocation::getMergedLocation(LocA, LocB, + DILocation::WithGeneratedLocation)); } //===----------------------------------------------------------------------===// diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index c1a9f3f6929..fe57aa7442a 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -68,16 +68,16 @@ DILocation *DILocation::getImpl(LLVMContext &Context, unsigned Line, Storage, Context.pImpl->DILocations); } -const DILocation * -DILocation::getMergedLocation(const DILocation *LocA, const DILocation *LocB, - const Instruction *ForInst) { +const DILocation *DILocation::getMergedLocation(const DILocation *LocA, + const DILocation *LocB, + bool GenerateLocation) { if (!LocA || !LocB) return nullptr; if (LocA == LocB || !LocA->canDiscriminate(*LocB)) return LocA; - if (!dyn_cast_or_null<CallInst>(ForInst)) + if (!GenerateLocation) return nullptr; SmallPtrSet<DILocation *, 5> InlinedLocationsA; |