mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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
This commit is contained in:
parent
2fcfd83cb4
commit
f369330c2d
@ -65,6 +65,10 @@ namespace {
|
|||||||
bool runOnMachineFunction(MachineFunction &F);
|
bool runOnMachineFunction(MachineFunction &F);
|
||||||
bool doInitialization(Module &M);
|
bool doInitialization(Module &M);
|
||||||
bool doFinalization(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
|
} // end of anonymous namespace
|
||||||
|
|
||||||
@ -213,8 +217,6 @@ void SparcAsmPrinter::printCCOperand(const MachineInstr *MI, int opNum) {
|
|||||||
O << SPARCCondCodeToString((SPCC::CondCodes)CC);
|
O << SPARCCondCodeToString((SPCC::CondCodes)CC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool SparcAsmPrinter::doInitialization(Module &M) {
|
bool SparcAsmPrinter::doInitialization(Module &M) {
|
||||||
Mang = new Mangler(M);
|
Mang = new Mangler(M);
|
||||||
return false; // success
|
return false; // success
|
||||||
@ -307,3 +309,30 @@ void SparcAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
|
|||||||
O << name << ":\n";
|
O << name << ":\n";
|
||||||
EmitGlobalConstant(C);
|
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;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user