diff options
author | Dale Johannesen <dalej@apple.com> | 2008-06-03 18:09:06 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-06-03 18:09:06 +0000 |
commit | 428ac54894f80ba4848d5f13576643f289412e6f (patch) | |
tree | 4ab74721c76e3428d24858b54a68974f399f5fa5 | |
parent | eefc845b5f407adf1992602aaac1142b2d583220 (diff) |
Add StringConstantPrefix to control what the
assembler names of string constants look like.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51909 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Target/TargetAsmInfo.h | 7 | ||||
-rw-r--r-- | lib/Target/ARM/ARMTargetAsmInfo.cpp | 1 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 1 | ||||
-rw-r--r-- | lib/Target/TargetAsmInfo.cpp | 1 | ||||
-rw-r--r-- | lib/Target/X86/X86TargetAsmInfo.cpp | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h index 7deac403b5..a8a3529b76 100644 --- a/include/llvm/Target/TargetAsmInfo.h +++ b/include/llvm/Target/TargetAsmInfo.h @@ -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; } diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp index 65947fb188..47abcc6f40 100644 --- a/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp @@ -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"; diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp index 85ead11f89..058de655ef 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp @@ -39,6 +39,7 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM) CommentString = ";"; GlobalPrefix = "_"; PrivateGlobalPrefix = "L"; + StringConstantPrefix = "\1LC"; ConstantPoolSection = "\t.const\t"; JumpTableDataSection = ".const"; CStringSection = "\t.cstring"; diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp index 5fa5abec8e..67f0cfa5be 100644 --- a/lib/Target/TargetAsmInfo.cpp +++ b/lib/Target/TargetAsmInfo.cpp @@ -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"), diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp index 7e90cd9b3e..887c13dcc7 100644 --- a/lib/Target/X86/X86TargetAsmInfo.cpp +++ b/lib/Target/X86/X86TargetAsmInfo.cpp @@ -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) { |