[PATCH] D46556: [MC] Move MCAssembler into the correct cpp file

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 15:54:26 PDT 2018


sbc100 created this revision.
Herald added subscribers: llvm-commits, aheejin.
sbc100 retitled this revision from "[MC] Move MCFragment into the correct cpp file" to "[MC] Move MCAssembler into the correct cpp file".

Repository:
  rL LLVM

https://reviews.llvm.org/D46556

Files:
  lib/MC/MCAssembler.cpp
  lib/MC/MCFragment.cpp


Index: lib/MC/MCFragment.cpp
===================================================================
--- lib/MC/MCFragment.cpp
+++ lib/MC/MCFragment.cpp
@@ -464,26 +464,4 @@
   }
   OS << ">";
 }
-
-LLVM_DUMP_METHOD void MCAssembler::dump() const{
-  raw_ostream &OS = errs();
-
-  OS << "<MCAssembler\n";
-  OS << "  Sections:[\n    ";
-  for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
-    if (it != begin()) OS << ",\n    ";
-    it->dump();
-  }
-  OS << "],\n";
-  OS << "  Symbols:[";
-
-  for (const_symbol_iterator it = symbol_begin(), ie = symbol_end(); it != ie; ++it) {
-    if (it != symbol_begin()) OS << ",\n           ";
-    OS << "(";
-    it->dump();
-    OS << ", Index:" << it->getIndex() << ", ";
-    OS << ")";
-  }
-  OS << "]>\n";
-}
 #endif
Index: lib/MC/MCAssembler.cpp
===================================================================
--- lib/MC/MCAssembler.cpp
+++ lib/MC/MCAssembler.cpp
@@ -1019,3 +1019,27 @@
   }
   getBackend().finishLayout(*this, Layout);
 }
+
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+LLVM_DUMP_METHOD void MCAssembler::dump() const{
+  raw_ostream &OS = errs();
+
+  OS << "<MCAssembler\n";
+  OS << "  Sections:[\n    ";
+  for (const_iterator it = begin(), ie = end(); it != ie; ++it) {
+    if (it != begin()) OS << ",\n    ";
+    it->dump();
+  }
+  OS << "],\n";
+  OS << "  Symbols:[";
+
+  for (const_symbol_iterator it = symbol_begin(), ie = symbol_end(); it != ie; ++it) {
+    if (it != symbol_begin()) OS << ",\n           ";
+    OS << "(";
+    it->dump();
+    OS << ", Index:" << it->getIndex() << ", ";
+    OS << ")";
+  }
+  OS << "]>\n";
+}
+#endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46556.145579.patch
Type: text/x-patch
Size: 1647 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180507/95de6045/attachment-0001.bin>


More information about the llvm-commits mailing list