diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-11 22:39:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-11 22:39:40 +0000 |
commit | e2b060161c92ddf60b5d020f981451e9e34a3f02 (patch) | |
tree | 15b1240b4ff1ad16135acf4096de957cb2facb80 | |
parent | 546952fd600ddba3f1eb6d4f93ff4eb42821a962 (diff) |
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
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 7 | ||||
-rw-r--r-- | lib/Target/ARM/ARMTargetAsmInfo.cpp | 5 | ||||
-rw-r--r-- | lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp | 2 | ||||
-rw-r--r-- | lib/Target/CellSPU/SPUTargetAsmInfo.cpp | 2 | ||||
-rw-r--r-- | lib/Target/DarwinTargetAsmInfo.cpp | 2 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 4 | ||||
-rw-r--r-- | lib/Target/TargetAsmInfo.cpp | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetAsmInfo.cpp | 5 |
8 files changed, 8 insertions, 23 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 50733e6cd5..5530896733 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -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 diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp index 85e9d6428e..0c3df82bfe 100644 --- a/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp @@ -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; diff --git a/lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp b/lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp index 8dcb44be50..3ab02d8c51 100644 --- a/lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp +++ b/lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp @@ -18,6 +18,4 @@ using namespace llvm; BlackfinTargetAsmInfo::BlackfinTargetAsmInfo() { GlobalPrefix = "_"; CommentString = "//"; - InlineAsmStart = "// APP"; - InlineAsmEnd = "// NO_APP"; } diff --git a/lib/Target/CellSPU/SPUTargetAsmInfo.cpp b/lib/Target/CellSPU/SPUTargetAsmInfo.cpp index 991afa0e0b..a295a4c29d 100644 --- a/lib/Target/CellSPU/SPUTargetAsmInfo.cpp +++ b/lib/Target/CellSPU/SPUTargetAsmInfo.cpp @@ -20,8 +20,6 @@ SPULinuxTargetAsmInfo::SPULinuxTargetAsmInfo() { Data64bitsDirective = "\t.quad\t"; AlignmentIsInBytes = false; LCOMMDirective = "\t.lcomm\t"; - InlineAsmStart = "# InlineAsm Start"; - InlineAsmEnd = "# InlineAsm End"; PCSymbol = "."; CommentString = "#"; diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp index 08ad76d40f..c37b41b700 100644 --- a/lib/Target/DarwinTargetAsmInfo.cpp +++ b/lib/Target/DarwinTargetAsmInfo.cpp @@ -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 diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp index 58926e3b87..891252b8a9 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp @@ -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(); } diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index 51aeae4380..253d72c359 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/lib/Target/TargetAsmInfo.cpp @@ -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"; diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp index a07b2cc2b5..1d9a4c2aaa 100644 --- a/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/lib/Target/X86/X86TargetAsmInfo.cpp @@ -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"; |