diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h index 7deac403b50..a8a3529b767 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 65947fb188f..47abcc6f407 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 85ead11f890..058de655efa 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 5fa5abec8e9..67f0cfa5be8 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 7e90cd9b3e7..887c13dcc76 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) {