[clang-tools-extra] 26750a1 - [clang-tidy] Silence unused variable warning in Release builds. NFCI.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 26 12:21:23 PDT 2020


Author: Benjamin Kramer
Date: 2020-10-26T20:20:23+01:00
New Revision: 26750a1264b3df114a1efae7cde6f0784206b2ce

URL: https://github.com/llvm/llvm-project/commit/26750a1264b3df114a1efae7cde6f0784206b2ce
DIFF: https://github.com/llvm/llvm-project/commit/26750a1264b3df114a1efae7cde6f0784206b2ce.diff

LOG: [clang-tidy] Silence unused variable warning in Release builds. NFCI.

ExpandModularHeadersPPCallbacks.cpp:55:15: warning: unused variable 'FileEntry'
    for (auto FileEntry : FilesToRecord)
              ^

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
index 9e693b62e50d..1d008c23617c 100644
--- a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
+++ b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
@@ -52,9 +52,11 @@ class ExpandModularHeadersPPCallbacks::FileRecorder {
   /// Makes sure we have contents for all the files we were interested in. Ideally
   /// `FilesToRecord` should be empty.
   void checkAllFilesRecorded() {
-    for (auto FileEntry : FilesToRecord)
-      LLVM_DEBUG(llvm::dbgs() << "Did not record contents for input file: "
-                              << FileEntry->getName() << "\n");
+    LLVM_DEBUG({
+      for (auto FileEntry : FilesToRecord)
+        llvm::dbgs() << "Did not record contents for input file: "
+                     << FileEntry->getName() << "\n";
+    });
   }
 
 private:


        


More information about the cfe-commits mailing list