clean up the asmprinter interface a bit, rename a few
"Print" methods to "Emit". Emit is something that goes
to an mc streamer, Print is something that goes to a
raw_ostream (for inline asm)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100337 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 2a8e3ee..e8b6ff4 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -440,16 +440,16 @@
case TargetOpcode::DBG_LABEL:
case TargetOpcode::EH_LABEL:
case TargetOpcode::GC_LABEL:
- printLabelInst(II);
+ OutStreamer.EmitLabel(II->getOperand(0).getMCSymbol());
break;
case TargetOpcode::INLINEASM:
- printInlineAsm(II);
+ EmitInlineAsm(II);
break;
case TargetOpcode::IMPLICIT_DEF:
- printImplicitDef(II);
+ EmitImplicitDef(II);
break;
case TargetOpcode::KILL:
- printKill(II);
+ EmitKill(II);
break;
default:
EmitInstruction(II);
@@ -1385,9 +1385,9 @@
}
-/// printInlineAsm - This method formats and prints the specified machine
+/// EmitInlineAsm - This method formats and emits the specified machine
/// instruction that is an inline asm.
-void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
+void AsmPrinter::EmitInlineAsm(const MachineInstr *MI) const {
assert(MI->isInlineAsm() && "printInlineAsm only works on inline asms");
unsigned NumOperands = MI->getNumOperands();
@@ -1606,9 +1606,9 @@
MAI->getInlineAsmEnd());
}
-/// printImplicitDef - This method prints the specified machine instruction
+/// EmitImplicitDef - This method emits the specified machine instruction
/// that is an implicit def.
-void AsmPrinter::printImplicitDef(const MachineInstr *MI) const {
+void AsmPrinter::EmitImplicitDef(const MachineInstr *MI) const {
if (!VerboseAsm) return;
unsigned RegNo = MI->getOperand(0).getReg();
OutStreamer.AddComment(Twine("implicit-def: ") +
@@ -1616,7 +1616,7 @@
OutStreamer.AddBlankLine();
}
-void AsmPrinter::printKill(const MachineInstr *MI) const {
+void AsmPrinter::EmitKill(const MachineInstr *MI) const {
if (!VerboseAsm) return;
std::string Str = "kill:";
@@ -1631,12 +1631,6 @@
OutStreamer.AddBlankLine();
}
-/// printLabel - This method prints a local label used by debug and
-/// exception handling tables.
-void AsmPrinter::printLabelInst(const MachineInstr *MI) const {
- OutStreamer.EmitLabel(MI->getOperand(0).getMCSymbol());
-}
-
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
/// instruction, using the specified assembler variant. Targets should
/// override this to format as appropriate.