summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-24 20:21:58 +0000
committerChris Lattner <sabre@nondot.org>2006-02-24 20:21:58 +0000
commit1d08c6534c2f384d0398215439e11e4188fbe367 (patch)
treeaf50006a16426d7d0f08c824246d91c717105be3 /llvm/lib/CodeGen/AsmPrinter.cpp
parentd0dadd73a406c2d3b67da0644bd37efc7bce1339 (diff)
downloadbcm5719-llvm-1d08c6534c2f384d0398215439e11e4188fbe367.tar.gz
bcm5719-llvm-1d08c6534c2f384d0398215439e11e4188fbe367.zip
Use the PrintAsmMemoryOperand to print addressing modes.
llvm-svn: 26364
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index dceaced12f9..92a2d7ba8dc 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -580,11 +580,19 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
OpNo += (OpFlags >> 3) + 1;
}
+ unsigned OpFlags = MI->getOperand(OpNo).getImmedValue();
++OpNo; // Skip over the ID number.
-
- if (const_cast<AsmPrinter*>(this)->
- PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
- Modifier[0] ? Modifier : 0)) {
+
+ bool Error;
+ AsmPrinter *AP = const_cast<AsmPrinter*>(this);
+ if ((OpFlags & 7) == 4 /*ADDR MODE*/) {
+ Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant,
+ Modifier[0] ? Modifier : 0);
+ } else {
+ Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant,
+ Modifier[0] ? Modifier : 0);
+ }
+ if (Error) {
std::cerr << "Invalid operand found in inline asm: '"
<< AsmStr << "'\n";
MI->dump();
@@ -633,3 +641,10 @@ bool AsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
// Target doesn't support this yet!
return true;
}
+
+bool AsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
+ unsigned AsmVariant,
+ const char *ExtraCode) {
+ // Target doesn't support this yet!
+ return true;
+}
OpenPOWER on IntegriCloud