diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -106,9 +106,6 @@ if (LocA == LocB) return LocA; - SmallPtrSet InlinedLocationsA; - for (DILocation *L = LocA->getInlinedAt(); L; L = L->getInlinedAt()) - InlinedLocationsA.insert(L); SmallSet, 5> Locations; DIScope *S = LocA->getScope(); DILocation *L = LocA->getInlinedAt(); @@ -120,7 +117,6 @@ L = L->getInlinedAt(); } } - const DILocation *Result = LocB; S = LocB->getScope(); L = LocB->getInlinedAt(); while (S) { @@ -137,7 +133,7 @@ // but on the other hand, it's a "line 0" location. if (!S || !isa(S)) S = LocA->getScope(); - return DILocation::get(Result->getContext(), 0, 0, S, L); + return DILocation::get(LocA->getContext(), 0, 0, S, L); } Optional DILocation::encodeDiscriminator(unsigned BD, unsigned DF,