diff options
-rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 1 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index e92c8a8..fbb0821 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -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. diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index a682a3f..1320663 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -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 { |