mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Add support for assembler directives that wrap inline asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -86,6 +86,11 @@ namespace llvm {
|
|||||||
const char *FunctionAddrPrefix; // Defaults to ""
|
const char *FunctionAddrPrefix; // Defaults to ""
|
||||||
const char *FunctionAddrSuffix; // Defaults to ""
|
const char *FunctionAddrSuffix; // Defaults to ""
|
||||||
|
|
||||||
|
/// InlineAsmStart/End - If these are nonempty, they contain a directive to
|
||||||
|
/// emit before and after an inline assmebly statement.
|
||||||
|
const char *InlineAsmStart; // Defaults to "#APP\n"
|
||||||
|
const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
|
||||||
|
|
||||||
//===--- Data Emission Directives -------------------------------------===//
|
//===--- Data Emission Directives -------------------------------------===//
|
||||||
|
|
||||||
/// ZeroDirective - this should be set to the directive used to get some
|
/// ZeroDirective - this should be set to the directive used to get some
|
||||||
|
@@ -32,6 +32,8 @@ AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm)
|
|||||||
GlobalVarAddrSuffix(""),
|
GlobalVarAddrSuffix(""),
|
||||||
FunctionAddrPrefix(""),
|
FunctionAddrPrefix(""),
|
||||||
FunctionAddrSuffix(""),
|
FunctionAddrSuffix(""),
|
||||||
|
InlineAsmStart("#APP\n"),
|
||||||
|
InlineAsmEnd("#NO_APP\n"),
|
||||||
ZeroDirective("\t.zero\t"),
|
ZeroDirective("\t.zero\t"),
|
||||||
AsciiDirective("\t.ascii\t"),
|
AsciiDirective("\t.ascii\t"),
|
||||||
AscizDirective("\t.asciz\t"),
|
AscizDirective("\t.asciz\t"),
|
||||||
@@ -482,6 +484,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
|
|||||||
/// printInlineAsm - This method formats and prints the specified machine
|
/// printInlineAsm - This method formats and prints the specified machine
|
||||||
/// instruction that is an inline asm.
|
/// instruction that is an inline asm.
|
||||||
void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
|
void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
|
||||||
|
O << InlineAsmStart;
|
||||||
unsigned NumOperands = MI->getNumOperands();
|
unsigned NumOperands = MI->getNumOperands();
|
||||||
|
|
||||||
// Count the number of register definitions.
|
// Count the number of register definitions.
|
||||||
@@ -613,7 +616,7 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
O << "\n";
|
O << "\n" << InlineAsmEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
|
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
|
||||||
|
Reference in New Issue
Block a user