diff --git a/llvm/lib/IR/DebugInfoMetadata.cpp b/llvm/lib/IR/DebugInfoMetadata.cpp index 733bd8fbecac5..04c5b7f493d47 100644 --- a/llvm/lib/IR/DebugInfoMetadata.cpp +++ b/llvm/lib/IR/DebugInfoMetadata.cpp @@ -945,7 +945,8 @@ DILocalScope *DILocalScope::cloneScopeForSubprogram( for (DIScope *Scope = &RootScope; !isa(Scope); Scope = Scope->getScope()) { - if (auto It = Cache.find(Scope); It != Cache.end()) { + auto It = Cache.find(Scope); + if (It != Cache.end()) { CachedResult = cast(It->second); break; } diff --git a/llvm/lib/IR/DebugLoc.cpp b/llvm/lib/IR/DebugLoc.cpp index bdea52180f74a..0681aeb631ae5 100644 --- a/llvm/lib/IR/DebugLoc.cpp +++ b/llvm/lib/IR/DebugLoc.cpp @@ -76,7 +76,8 @@ DebugLoc DebugLoc::replaceInlinedAtSubprogram( // Collect the inline chain, stopping if we find a location that has already // been processed. for (DILocation *Loc = RootLoc; Loc; Loc = Loc->getInlinedAt()) { - if (auto It = Cache.find(Loc); It != Cache.end()) { + auto It = Cache.find(Loc); + if (It != Cache.end()) { CachedResult = cast(It->second); break; }