[clang-tidy] Silence unused variable warning in Release builds. NFCI.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 26 Oct 2020 19:20:23 +0000 (20:20 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 26 Oct 2020 19:20:23 +0000 (20:20 +0100)
ExpandModularHeadersPPCallbacks.cpp:55:15: warning: unused variable 'FileEntry'
    for (auto FileEntry : FilesToRecord)
              ^

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

index 9e693b6..1d008c2 100644 (file)
@@ -52,9 +52,11 @@ public:
   /// 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: