[llvm-commits] [llvm] r52981 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter.cpp
Owen Anderson
resistor at mac.com
Tue Jul 1 14:16:27 PDT 2008
Author: resistor
Date: Tue Jul 1 16:16:27 2008
New Revision: 52981
URL: http://llvm.org/viewvc/llvm-project?rev=52981&view=rev
Log:
Add a version of AsmPrinter::EOL that takes a const char* so that we don't have to do as many implicit std::string constructions.
Unfortunately, this doesn't appear to translate to a real speedup in practice.
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/lib/CodeGen/AsmPrinter.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=52981&r1=52980&r2=52981&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Tue Jul 1 16:16:27 2008
@@ -236,6 +236,7 @@
/// 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.
Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=52981&r1=52980&r2=52981&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Tue Jul 1 16:16:27 2008
@@ -551,6 +551,7 @@
void AsmPrinter::EOL() const {
O << '\n';
}
+
void AsmPrinter::EOL(const std::string &Comment) const {
if (AsmVerbose && !Comment.empty()) {
O << '\t'
@@ -561,6 +562,16 @@
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 {
More information about the llvm-commits
mailing list