]> granicus.if.org Git - llvm/commitdiff
Change the asmprinter to print the comment character before the
authorChris Lattner <sabre@nondot.org>
Tue, 11 Aug 2009 22:39:40 +0000 (22:39 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 11 Aug 2009 22:39:40 +0000 (22:39 +0000)
"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

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/ARM/ARMTargetAsmInfo.cpp
lib/Target/Blackfin/BlackfinTargetAsmInfo.cpp
lib/Target/CellSPU/SPUTargetAsmInfo.cpp
lib/Target/DarwinTargetAsmInfo.cpp
lib/Target/PowerPC/PPCTargetAsmInfo.cpp
lib/Target/TargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.cpp

index 50733e6cd53a06f67ec60dc73880866c8a77a6b3..553089673374717c3c0e833ecc88887093ac5dcc 100644 (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
index 85e9d6428eb8b2682a4f28f98feda4cce9cd07ce..0c3df82bfe26f6f043aa07a37e55144c7bf1db92 100644 (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;
index 8dcb44be5016a644e33fdeb7f1a0b334cd065b62..3ab02d8c51f5cdb67f9e7b764610cca2163cfeae 100644 (file)
@@ -18,6 +18,4 @@ using namespace llvm;
 BlackfinTargetAsmInfo::BlackfinTargetAsmInfo() {
   GlobalPrefix = "_";
   CommentString = "//";
-  InlineAsmStart = "// APP";
-  InlineAsmEnd = "// NO_APP";
 }
index 991afa0e0b0fe648449870ec6f724d80547f2bcd..a295a4c29df75739f937bfa5a81168369574dc42 100644 (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 = "#";
index 08ad76d40fb6e132c95b9e8a96dc94b6b00ddbb6..c37b41b7001743c098b220d9d94e0d05749f04dc 100644 (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
index 58926e3b87d5f1d78decda909ca7676717370797..891252b8a9a93a12d86ae430c3a9cac91d82cd53 100644 (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();
 }
 
index 51aeae438002b8932c5fab840bdfe9abd475795e..253d72c359ce631a20ace826afcd2a30f78fc7d9 100644 (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";
index a07b2cc2b5b1c45ebdb07cece8e8d373f5456ebf..1d9a4c2aaa62d37cdea3bba1f73e3b7cce1d7d6d 100644 (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";