diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h index e92c8a8df534..fbb0821c2172 100644 --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/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/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index a682a3f5a88d..132066339723 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/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 {