[llvm] b1f76e8 - [NFC] Remove unused set construction from DILocation::getMergedLocation
Juan Manuel MARTINEZ CAAMAÑO via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 22 00:00:26 PDT 2022
Author: Juan Manuel MARTINEZ CAAMAÑO
Date: 2022-09-22T07:00:02Z
New Revision: b1f76e8c5793659244f46386aa31adb8f7d19c8d
URL: https://github.com/llvm/llvm-project/commit/b1f76e8c5793659244f46386aa31adb8f7d19c8d
DIFF: https://github.com/llvm/llvm-project/commit/b1f76e8c5793659244f46386aa31adb8f7d19c8d.diff
LOG: [NFC] Remove unused set construction from DILocation::getMergedLocation
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D134357
Added:
Modified:
llvm/lib/IR/DebugInfoMetadata.cpp
Removed:
################################################################################
diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp
index 877618df8ec65..e8d8eafeb2d58 100644
--- a/llvm/lib/IR/DebugInfoMetadata.cpp
+++ b/llvm/lib/IR/DebugInfoMetadata.cpp
@@ -106,9 +106,6 @@ const DILocation *DILocation::getMergedLocation(const DILocation *LocA,
if (LocA == LocB)
return LocA;
- SmallPtrSet<DILocation *, 5> InlinedLocationsA;
- for (DILocation *L = LocA->getInlinedAt(); L; L = L->getInlinedAt())
- InlinedLocationsA.insert(L);
SmallSet<std::pair<DIScope *, DILocation *>, 5> Locations;
DIScope *S = LocA->getScope();
DILocation *L = LocA->getInlinedAt();
@@ -120,7 +117,6 @@ const DILocation *DILocation::getMergedLocation(const DILocation *LocA,
L = L->getInlinedAt();
}
}
- const DILocation *Result = LocB;
S = LocB->getScope();
L = LocB->getInlinedAt();
while (S) {
@@ -137,7 +133,7 @@ const DILocation *DILocation::getMergedLocation(const DILocation *LocA,
// but on the other hand, it's a "line 0" location.
if (!S || !isa<DILocalScope>(S))
S = LocA->getScope();
- return DILocation::get(Result->getContext(), 0, 0, S, L);
+ return DILocation::get(LocA->getContext(), 0, 0, S, L);
}
Optional<unsigned> DILocation::encodeDiscriminator(unsigned BD, unsigned DF,
More information about the llvm-commits
mailing list