summaryrefslogtreecommitdiffstats
path: root/lib/Target/Sparc
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-10-10 10:15:03 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-10-10 10:15:03 +0000
commitf369330c2d25b37d2590720e45d11a1d47950ce6 (patch)
treeb8c92e9881d1f19f712602ed6b96778fe2e6c891 /lib/Target/Sparc
parent2fcfd83cb4b10c072186949ee39326f236c9f1b3 (diff)
downloadexternal_llvm-f369330c2d25b37d2590720e45d11a1d47950ce6.zip
external_llvm-f369330c2d25b37d2590720e45d11a1d47950ce6.tar.gz
external_llvm-f369330c2d25b37d2590720e45d11a1d47950ce6.tar.bz2
Add rudimentary asmprinter support for printing inline asm operands for sparc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc')
-rw-r--r--lib/Target/Sparc/SparcAsmPrinter.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/lib/Target/Sparc/SparcAsmPrinter.cpp b/lib/Target/Sparc/SparcAsmPrinter.cpp
index f6e3f66..35626fd 100644
--- a/lib/Target/Sparc/SparcAsmPrinter.cpp
+++ b/lib/Target/Sparc/SparcAsmPrinter.cpp
@@ -65,6 +65,10 @@ namespace {
bool runOnMachineFunction(MachineFunction &F);
bool doInitialization(Module &M);
bool doFinalization(Module &M);
+ bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
+ unsigned AsmVariant, const char *ExtraCode);
+ bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
+ unsigned AsmVariant, const char *ExtraCode);
};
} // end of anonymous namespace
@@ -213,8 +217,6 @@ void SparcAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) {
O << SPARCCondCodeToString((SPCC::CondCodes)CC);
}
-
-
bool SparcAsmPrinter::doInitialization(Module &M) {
Mang = new Mangler(M);
return false; // success
@@ -307,3 +309,30 @@ void SparcAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
O << name << ":\n";
EmitGlobalConstant(C);
}
+
+/// PrintAsmOperand - Print out an operand for an inline asm expression.
+///
+bool SparcAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
+ unsigned AsmVariant,
+ const char *ExtraCode) {
+ if (ExtraCode && ExtraCode[0])
+ return true; // Unknown modifier
+
+ printOperand(MI, OpNo);
+
+ return false;
+}
+
+bool SparcAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI,
+ unsigned OpNo,
+ unsigned AsmVariant,
+ const char *ExtraCode) {
+ if (ExtraCode && ExtraCode[0])
+ return true; // Unknown modifier
+
+ O << '[';
+ printMemOperand(MI, OpNo);
+ O << ']';
+
+ return false;
+}