diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-05 22:42:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-05 22:42:30 +0000 |
commit | 0e45d24a4e62a2f878763d75670f389c9c59c3a3 (patch) | |
tree | 290332173bfe5124b5575c2c064b79283a772321 /llvm/lib/CodeGen | |
parent | 58c79341ab977592c79d75e362383c3916a49173 (diff) | |
download | bcm5719-llvm-0e45d24a4e62a2f878763d75670f389c9c59c3a3.tar.gz bcm5719-llvm-0e45d24a4e62a2f878763d75670f389c9c59c3a3.zip |
stringref-ize the MemoryBuffer::get apis. This requires
a co-committed clang patch.
llvm-svn: 100485
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp index c58f76b41c2..cd8329d65eb 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp @@ -61,6 +61,7 @@ void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const { // If this asmstr is empty, just print the #APP/#NOAPP markers. // These are useful to see where empty asm's wound up. if (AsmStr[0] == 0) { + // Don't emit the comments if writing to a .o file. if (!OutStreamer.hasRawTextSupport()) return; OutStreamer.EmitRawText(Twine("\t")+MAI->getCommentString()+ @@ -104,7 +105,7 @@ void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const { } case '\n': ++LastEmitted; // Consume newline character. - OS << '\n'; // Indent code with newline. + OS << '\n'; // Indent code with newline. break; case '$': { ++LastEmitted; // Consume '$' character. @@ -183,26 +184,23 @@ void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const { // supports syntax like ${0:u}, which correspond to "%u0" in GCC asm. if (*LastEmitted == ':') { ++LastEmitted; // Consume ':' character. - if (*LastEmitted == 0) { - llvm_report_error("Bad ${:} expression in inline asm string: '" - + std::string(AsmStr) + "'"); - } + if (*LastEmitted == 0) + llvm_report_error("Bad ${:} expression in inline asm string: '" + + std::string(AsmStr) + "'"); Modifier[0] = *LastEmitted; ++LastEmitted; // Consume modifier character. } - if (*LastEmitted != '}') { + if (*LastEmitted != '}') llvm_report_error("Bad ${} expression in inline asm string: '" + std::string(AsmStr) + "'"); - } ++LastEmitted; // Consume '}' character. } - if (Val >= NumOperands-1) { + if (Val >= NumOperands-1) llvm_report_error("Invalid $ operand number in inline asm string: '" + std::string(AsmStr) + "'"); - } // Okay, we finally have a value number. Ask the target to print this // operand! |