allow target-specific label suffixes, patch by Yuri Gribov!
authorChris Lattner <sabre@nondot.org>
Wed, 22 Sep 2010 22:19:53 +0000 (22:19 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 22 Sep 2010 22:19:53 +0000 (22:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114592 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCAsmInfo.h
lib/MC/MCAsmInfo.cpp
lib/MC/MCAsmStreamer.cpp

index 43952e0845da1cb7e8599d0b6ab531c5ebebf0fd..b305772e2c38dac512302538d025a9ace8889188 100644 (file)
@@ -72,6 +72,9 @@ namespace llvm {
     /// assembler.
     const char *CommentString;               // Defaults to "#"
 
+    /// LabelSuffix - This is appended to emitted labels.
+    const char *LabelSuffix;                 // Defaults to ":"
+
     /// GlobalPrefix - If this is set to a non-empty string, it is prepended
     /// onto all global symbols.  This is often used for "_" or ".".
     const char *GlobalPrefix;                // Defaults to ""
@@ -334,6 +337,9 @@ namespace llvm {
     const char *getCommentString() const {
       return CommentString;
     }
+    const char *getLabelSuffix() const {
+      return LabelSuffix;
+    }
     const char *getGlobalPrefix() const {
       return GlobalPrefix;
     }
index 670b2e9b292a53e63ae11a816efcbf5353a8852c..e8902e75b0633c2c23bdb4eed53bcf0c5887218c 100644 (file)
@@ -28,6 +28,7 @@ MCAsmInfo::MCAsmInfo() {
   SeparatorChar = ';';
   CommentColumn = 40;
   CommentString = "#";
+  LabelSuffix = ":";
   GlobalPrefix = "";
   PrivateGlobalPrefix = ".";
   LinkerPrivateGlobalPrefix = "";
index 8442de3f2996f82b79539535fbca258819b68717..1402f8eb180b1763462d6668c14f4414ccb2f0b1 100644 (file)
@@ -236,7 +236,7 @@ void MCAsmStreamer::EmitLabel(MCSymbol *Symbol) {
   assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
   assert(CurSection && "Cannot emit before setting section!");
 
-  OS << *Symbol << ":";
+  OS << *Symbol << MAI.getLabelSuffix();
   EmitEOL();
   Symbol->setSection(*CurSection);
 }