Add a version of AsmPrinter::EOL that takes a const char* so that we don't have to...
authorOwen Anderson <resistor@mac.com>
Tue, 1 Jul 2008 21:16:27 +0000 (21:16 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 1 Jul 2008 21:16:27 +0000 (21:16 +0000)
Unfortunately, this doesn't appear to translate to a real speedup in practice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52981 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter.cpp

index e92c8a8df534560ca68a35aca4cb639fa82dc1ac..fbb0821c2172a49151e2c13adbfcf0d649f0c041 100644 (file)
@@ -236,6 +236,7 @@ namespace llvm {
     /// then it will be printed first.  Comments should not contain '\n'.
     void EOL() const;
     void EOL(const std::string &Comment) const;
+    void EOL(const char* Comment) const;
     
     /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
     /// unsigned leb128 value.
index a682a3f5a88dc752191550a3a07603edae8c8234..13206633972303a752d2894a12e07bbc9268c7a2 100644 (file)
@@ -551,6 +551,7 @@ void AsmPrinter::PrintHex(int Value) const {
 void AsmPrinter::EOL() const {
   O << '\n';
 }
+
 void AsmPrinter::EOL(const std::string &Comment) const {
   if (AsmVerbose && !Comment.empty()) {
     O << '\t'
@@ -561,6 +562,16 @@ void AsmPrinter::EOL(const std::string &Comment) const {
   O << '\n';
 }
 
+void AsmPrinter::EOL(const char* Comment) const {
+  if (AsmVerbose && *Comment) {
+    O << '\t'
+      << TAI->getCommentString()
+      << ' '
+      << Comment;
+  }
+  O << '\n';
+}
+
 /// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
 /// unsigned leb128 value.
 void AsmPrinter::EmitULEB128Bytes(unsigned Value) const {