[lld/mac] Make a variable more local; no behavior change
authorNico Weber <thakis@chromium.org>
Mon, 21 Jun 2021 01:59:11 +0000 (21:59 -0400)
committerNico Weber <thakis@chromium.org>
Mon, 21 Jun 2021 01:59:15 +0000 (21:59 -0400)
The variable used to need the wider scope, but doesn't after the
reland. See LC_LINKER_OPTIONS-related discussion on
https://reviews.llvm.org/D104353 for background.

lld/MachO/Driver.cpp

index a162682..f91fca0 100644 (file)
@@ -255,8 +255,7 @@ static InputFile *addFile(StringRef path, bool forceLoadArchive,
     // We don't take a reference to cachedFile here because the
     // loadArchiveMember() call below may recursively call addFile() and
     // invalidate this reference.
-    ArchiveFile *cachedFile = loadedArchives[path];
-    if (cachedFile)
+    if (ArchiveFile *cachedFile = loadedArchives[path])
       return cachedFile;
 
     std::unique_ptr<object::Archive> file = CHECK(