[PATCH] D89835: ModuleManager: Simplify lookupModuleFile by only setting the out parameter once, NFC

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 28 16:06:00 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG946406aebce2: ModuleManager: Simplify lookupModuleFile by only setting the out parameter onceā€¦ (authored by dexonsmith).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89835/new/

https://reviews.llvm.org/D89835

Files:
  clang/lib/Serialization/ModuleManager.cpp


Index: clang/lib/Serialization/ModuleManager.cpp
===================================================================
--- clang/lib/Serialization/ModuleManager.cpp
+++ clang/lib/Serialization/ModuleManager.cpp
@@ -462,19 +462,17 @@
                                      off_t ExpectedSize,
                                      time_t ExpectedModTime,
                                      const FileEntry *&File) {
-  if (FileName == "-") {
-    File = nullptr;
+  File = nullptr;
+  if (FileName == "-")
     return false;
-  }
 
   // Open the file immediately to ensure there is no race between stat'ing and
   // opening the file.
   auto FileOrErr = FileMgr.getFile(FileName, /*OpenFile=*/true,
                                    /*CacheFailure=*/false);
-  if (!FileOrErr) {
-    File = nullptr;
+  if (!FileOrErr)
     return false;
-  }
+
   File = *FileOrErr;
 
   if ((ExpectedSize && ExpectedSize != File->getSize()) ||


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89835.301465.patch
Type: text/x-patch
Size: 932 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201028/56b8fbe2/attachment.bin>


More information about the cfe-commits mailing list