Skip to content

Commit 21dd010

Browse files
committed
Fix lookup key for textual inclusion merge
1 parent 6548856 commit 21dd010

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,6 @@ static DILocalScope *NextScopeWithDifferentFile(MDNode *LocOrScope) {
269269
S = S->getScope();
270270
}
271271

272-
if (auto *SP = dyn_cast_or_null<DISubprogram>(S)) {
273-
return SP;
274-
}
275-
276272
return nullptr;
277273
}
278274

@@ -325,13 +321,13 @@ DILocation *DILocation::getMergedLocation(DILocation *LocA, DILocation *LocB) {
325321

326322
// We should traverse DILexicalBlock's that enclose input locations and
327323
// have different file attribute.
328-
using NestedLexicalBlocksMatchKey = MDNode *;
324+
using NestedLexicalBlocksMatchKey = DIFile *;
329325
// We try to match equal scopes or locations belonging to the same file.
330326
auto GetLocOrScopeMatchKey = [](MDNode *N) -> NestedLexicalBlocksMatchKey {
331327
if (auto *Loc = dyn_cast_if_present<DILocation>(N)) {
332328
return Loc->getFile();
333329
} else if (auto *LS = dyn_cast_if_present<DILocalScope>(N)) {
334-
return LS;
330+
return LS->getFile();
335331
}
336332

337333
return nullptr;

0 commit comments

Comments
 (0)