From 3a6a60f6c9c4a682de829635d7b9bb3bb64c2a7d Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 20 Jun 2021 21:59:11 -0400 Subject: [PATCH] [lld/mac] Make a variable more local; no behavior change 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp index a162682..f91fca0 100644 --- a/lld/MachO/Driver.cpp +++ b/lld/MachO/Driver.cpp @@ -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 file = CHECK( -- 2.7.4