[lld] r194914 - Move the entire debug print loop into DEBUG_WITH_TYPE.

Rui Ueyama ruiu at google.com
Fri Nov 15 17:41:47 PST 2013


Author: ruiu
Date: Fri Nov 15 19:41:47 2013
New Revision: 194914

URL: http://llvm.org/viewvc/llvm-project?rev=194914&view=rev
Log:
Move the entire debug print loop into DEBUG_WITH_TYPE.

No functionality change.

Modified:
    lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp

Modified: lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp?rev=194914&r1=194913&r2=194914&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp (original)
+++ lld/trunk/lib/ReaderWriter/Native/ReaderNative.cpp Fri Nov 15 19:41:47 2013
@@ -334,25 +334,20 @@ public:
     }
     // TO DO: validate enough chunks were used
 
-    DEBUG_WITH_TYPE("ReaderNative", llvm::dbgs()
-                  << " ReaderNative DefinedAtoms:\n");
-    for (const DefinedAtom *a : file->defined() ) {
-      DEBUG_WITH_TYPE("ReaderNative", llvm::dbgs()
-                    << llvm::format("    0x%09lX", a)
-                    << ", name=" << a->name()
-                    << ", size=" << a->size()
-                    << "\n");
-      for (const Reference *r : *a ) {
-        (void)r;
-        DEBUG_WITH_TYPE("ReaderNative", llvm::dbgs()
-                    << "        offset="
-                    << llvm::format("0x%03X", r->offsetInAtom())
-                    << ", kind=" << r->kind()
-                    << ", target=" << r->target()
-                    << "\n");
+    DEBUG_WITH_TYPE("ReaderNative", {
+      llvm::dbgs() << " ReaderNative DefinedAtoms:\n";
+      for (const DefinedAtom *a : file->defined()) {
+        llvm::dbgs() << llvm::format("    0x%09lX", a)
+                     << ", name=" << a->name()
+                     << ", size=" << a->size() << "\n";
+        for (const Reference *r : *a) {
+          llvm::dbgs() << "        offset="
+                       << llvm::format("0x%03X", r->offsetInAtom())
+                       << ", kind=" << r->kind()
+                       << ", target=" << r->target() << "\n";
+        }
       }
-    }
-
+    });
     result.push_back(std::move(file));
     return make_error_code(NativeReaderError::success);
   }





More information about the llvm-commits mailing list