Skip to content

Commit 2811e0f

Browse files
Merge pull request #5792 from felipepiovezan/felipe/cherrypick_hotcold_fixes_0421
[DebugInfo] Fix if-init-statement usage pre C++17 adoption
2 parents 3fd5db3 + 2e66b2b commit 2811e0f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

llvm/lib/IR/DebugInfoMetadata.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,8 @@ DILocalScope *DILocalScope::cloneScopeForSubprogram(
945945

946946
for (DIScope *Scope = &RootScope; !isa<DISubprogram>(Scope);
947947
Scope = Scope->getScope()) {
948-
if (auto It = Cache.find(Scope); It != Cache.end()) {
948+
auto It = Cache.find(Scope);
949+
if (It != Cache.end()) {
949950
CachedResult = cast<DIScope>(It->second);
950951
break;
951952
}

llvm/lib/IR/DebugLoc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ DebugLoc DebugLoc::replaceInlinedAtSubprogram(
7676
// Collect the inline chain, stopping if we find a location that has already
7777
// been processed.
7878
for (DILocation *Loc = RootLoc; Loc; Loc = Loc->getInlinedAt()) {
79-
if (auto It = Cache.find(Loc); It != Cache.end()) {
79+
auto It = Cache.find(Loc);
80+
if (It != Cache.end()) {
8081
CachedResult = cast<DILocation>(It->second);
8182
break;
8283
}

0 commit comments

Comments
 (0)