[lld] r178787 - fix DEBUG_WITH_TYPE to build without warnings in non-debug builds

Nick Kledzik kledzik at apple.com
Thu Apr 4 13:32:19 PDT 2013


Author: kledzik
Date: Thu Apr  4 15:32:18 2013
New Revision: 178787

URL: http://llvm.org/viewvc/llvm-project?rev=178787&view=rev
Log:
fix DEBUG_WITH_TYPE to build without warnings in non-debug builds

Modified:
    lld/trunk/lib/Passes/LayoutPass.cpp

Modified: lld/trunk/lib/Passes/LayoutPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/LayoutPass.cpp?rev=178787&r1=178786&r2=178787&view=diff
==============================================================================
--- lld/trunk/lib/Passes/LayoutPass.cpp (original)
+++ lld/trunk/lib/Passes/LayoutPass.cpp Thu Apr  4 15:32:18 2013
@@ -436,29 +436,32 @@ void LayoutPass::perform(MutableFile &me
   // Build override maps
   buildOrdinalOverrideMap(atomRange);
 
-  DEBUG_WITH_TYPE("layout", llvm::dbgs() << "unsorted atoms:\n");
-  for ( const DefinedAtom *atom : atomRange ) {
-    DEBUG_WITH_TYPE("layout", llvm::dbgs()
-                    << "  file=" << atom->file().path()
+  DEBUG_WITH_TYPE("layout", { 
+    llvm::dbgs() << "unsorted atoms:\n";
+    for (const DefinedAtom *atom : atomRange) {
+      llvm::dbgs()  << "  file=" << atom->file().path()
                     << ", name=" << atom->name()
                     << ", size=" << atom->size()
                     << ", type=" << atom->contentType()
                     << ", ordinal=" << atom->ordinal()
-                    << "\n");
-  }
-
+                    << "\n";
+    }
+  });
+  
   // sort the atoms
   std::sort(atomRange.begin(), atomRange.end(), _compareAtoms);
   
-  DEBUG_WITH_TYPE("layout", llvm::dbgs() << "sorted atoms:\n");
-  for ( const DefinedAtom *atom : atomRange ) {
-    DEBUG_WITH_TYPE("layout", llvm::dbgs()
-                    << "  file=" << atom->file().path()
+  DEBUG_WITH_TYPE("layout", { 
+    llvm::dbgs() << "sorted atoms:\n";
+    for (const DefinedAtom *atom : atomRange) {
+      llvm::dbgs()  << "  file=" << atom->file().path()
                     << ", name=" << atom->name()
                     << ", size=" << atom->size()
                     << ", type=" << atom->contentType()
                     << ", ordinal=" << atom->ordinal()
-                    << "\n");
-  }
+                    << "\n";
+    }
+  });
+  
 
 }





More information about the llvm-commits mailing list