Change the asmprinter to print the comment character before the

"inlineasmstart/end" strings so that the contents of the directive
are separate from the comment character.  This lets elf targets
get #APP/#NOAPP for free even if they don't use "#" as the comment
character.  This also allows hoisting the darwin stuff up to the
shared TAI class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78737 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-08-11 22:39:40 +00:00
parent 546952fd60
commit e2b060161c
8 changed files with 8 additions and 23 deletions

View File

@ -1336,11 +1336,12 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
// If this asmstr is empty, just print the #APP/#NOAPP markers.
// These are useful to see where empty asm's wound up.
if (AsmStr[0] == 0) {
O << TAI->getInlineAsmStart() << "\n\t" << TAI->getInlineAsmEnd() << '\n';
O << TAI->getCommentString() << TAI->getInlineAsmStart() << "\n\t";
O << TAI->getCommentString() << TAI->getInlineAsmEnd() << '\n';
return;
}
O << TAI->getInlineAsmStart() << "\n\t";
O << TAI->getCommentString() << TAI->getInlineAsmStart() << "\n\t";
// The variant of the current asmprinter.
int AsmPrinterVariant = TAI->getAssemblerDialect();
@ -1511,7 +1512,7 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
}
}
}
O << "\n\t" << TAI->getInlineAsmEnd() << '\n';
O << "\n\t" << TAI->getCommentString() << TAI->getInlineAsmEnd() << '\n';
}
/// printImplicitDef - This method prints the specified machine instruction

View File

@ -45,9 +45,6 @@ ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
Data64bitsDirective = 0;
CommentString = "@";
COMMDirectiveTakesAlignment = false;
InlineAsmStart = "@ InlineAsm Start";
InlineAsmEnd = "@ InlineAsm End";
SupportsDebugInformation = true;
// Exceptions handling
@ -60,8 +57,6 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo() {
Data64bitsDirective = 0;
CommentString = "@";
COMMDirectiveTakesAlignment = false;
InlineAsmStart = "@ InlineAsm Start";
InlineAsmEnd = "@ InlineAsm End";
NeedsSet = false;
HasLEB128 = true;

View File

@ -18,6 +18,4 @@ using namespace llvm;
BlackfinTargetAsmInfo::BlackfinTargetAsmInfo() {
GlobalPrefix = "_";
CommentString = "//";
InlineAsmStart = "// APP";
InlineAsmEnd = "// NO_APP";
}

View File

@ -20,8 +20,6 @@ SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo() {
Data64bitsDirective = "\t.quad\t";
AlignmentIsInBytes = false;
LCOMMDirective = "\t.lcomm\t";
InlineAsmStart = "# InlineAsm Start";
InlineAsmEnd = "# InlineAsm End";
PCSymbol = ".";
CommentString = "#";

View File

@ -27,6 +27,8 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
HasSingleParameterDotFile = false;
AlignmentIsInBytes = false;
InlineAsmStart = " InlineAsm Start";
InlineAsmEnd = " InlineAsm End";
// In non-PIC modes, emit a special label before jump tables so that the
// linker can perform more accurate dead code stripping. We do not check the

View File

@ -29,8 +29,6 @@ PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) {
if (!isPPC64)
Data64bitsDirective = 0; // we can't emit a 64-bit unit
InlineAsmStart = "# InlineAsm Start";
InlineAsmEnd = "# InlineAsm End";
AssemblerDialect = Subtarget->getAsmFlavor();
}
@ -63,8 +61,6 @@ PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
AlignmentIsInBytes = false;
LCOMMDirective = "\t.lcomm\t";
InlineAsmStart = "# InlineAsm Start";
InlineAsmEnd = "# InlineAsm End";
AssemblerDialect = Subtarget->getAsmFlavor();
}

View File

@ -37,8 +37,8 @@ TargetAsmInfo::TargetAsmInfo() {
PersonalityPrefix = "";
PersonalitySuffix = "";
NeedsIndirectEncoding = false;
InlineAsmStart = "#APP";
InlineAsmEnd = "#NO_APP";
InlineAsmStart = "APP";
InlineAsmEnd = "NO_APP";
AssemblerDialect = 0;
AllowQuotesInName = false;
ZeroDirective = "\t.zero\t";

View File

@ -61,8 +61,6 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) {
PersonalitySuffix = "$non_lazy_ptr";
}
InlineAsmStart = "## InlineAsm Start";
InlineAsmEnd = "## InlineAsm End";
CommentString = "##";
PCSymbol = ".";
@ -113,9 +111,6 @@ X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM) {
GlobalPrefix = "_";
CommentString = ";";
InlineAsmStart = "; InlineAsm Start";
InlineAsmEnd = "; InlineAsm End";
PrivateGlobalPrefix = "$";
AlignDirective = "\tALIGN\t";
ZeroDirective = "\tdb\t";