Add StringConstantPrefix to control what the
authorDale Johannesen <dalej@apple.com>
Tue, 3 Jun 2008 18:09:06 +0000 (18:09 +0000)
committerDale Johannesen <dalej@apple.com>
Tue, 3 Jun 2008 18:09:06 +0000 (18:09 +0000)
assembler names of string constants look like.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51909 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetAsmInfo.h
lib/Target/ARM/ARMTargetAsmInfo.cpp
lib/Target/PowerPC/PPCTargetAsmInfo.cpp
lib/Target/TargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.cpp

index 7deac403b50b99a485ee8fbcd5ac92627f1407b7..a8a3529b7677709ab433b051ede375c5fe143ad6 100644 (file)
@@ -147,6 +147,10 @@ namespace llvm {
     /// AssemblerDialect - Which dialect of an assembler variant to use.
     unsigned AssemblerDialect;            // Defaults to 0
 
+    /// StringConstantPrefix - Prefix to use when generating unnamed
+    /// constant strings.  These names get run through the Mangler later.
+    const char *StringConstantPrefix;     // Defaults to ".str"
+
     //===--- Data Emission Directives -------------------------------------===//
 
     /// ZeroDirective - this should be set to the directive used to get some
@@ -496,6 +500,9 @@ namespace llvm {
     unsigned getAssemblerDialect() const {
       return AssemblerDialect;
     }
+    const char *getStringConstantPrefix() const {
+      return StringConstantPrefix;
+    }
     const char *getZeroDirective() const {
       return ZeroDirective;
     }
index 65947fb188faea102f052642887138d1e6a10389..47abcc6f40776bd9d9501591034c8b3e2353ec72 100644 (file)
@@ -48,6 +48,7 @@ ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
   if (Subtarget->isTargetDarwin()) {
     GlobalPrefix = "_";
     PrivateGlobalPrefix = "L";
+    StringConstantPrefix = "\1LC";
     BSSSection = 0;                       // no BSS section.
     ZeroFillDirective = "\t.zerofill\t";  // Uses .zerofill
     SetDirective = "\t.set\t";
index 85ead11f890f39b77a21edb31a682109c270f0e3..058de655efa6c7040a2feb15f7b91511b72b1703 100644 (file)
@@ -39,6 +39,7 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
   CommentString = ";";
   GlobalPrefix = "_";
   PrivateGlobalPrefix = "L";
+  StringConstantPrefix = "\1LC";
   ConstantPoolSection = "\t.const\t";
   JumpTableDataSection = ".const";
   CStringSection = "\t.cstring";
index 5fa5abec8e9f48fdf22bd886a2a55a8c4d0ea6a2..67f0cfa5be88dcb6509e3dd683f795f4157ebc64 100644 (file)
@@ -45,6 +45,7 @@ TargetAsmInfo::TargetAsmInfo() :
   InlineAsmStart("#APP"),
   InlineAsmEnd("#NO_APP"),
   AssemblerDialect(0),
+  StringConstantPrefix(".str"),
   ZeroDirective("\t.zero\t"),
   ZeroDirectiveSuffix(0),
   AsciiDirective("\t.ascii\t"),
index 7e90cd9b3e7e3065df9cdf662f7539f363a692f1..887c13dcc767866ee5789621d0b0173d2ea44315 100644 (file)
@@ -66,6 +66,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
     ReadOnlySection = "\t.const\n";
     LCOMMDirective = "\t.lcomm\t";
     SwitchToSectionDirective = "\t.section ";
+    StringConstantPrefix = "\1LC";
     COMMDirectiveTakesAlignment = false;
     HasDotTypeDotSizeDirective = false;
     if (TM.getRelocationModel() == Reloc::Static) {