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
This commit is contained in:
Dale Johannesen 2008-06-03 18:09:06 +00:00
parent eefc845b5f
commit 428ac54894
5 changed files with 11 additions and 0 deletions

View File

@ -147,6 +147,10 @@ namespace llvm {
/// AssemblerDialect - Which dialect of an assembler variant to use. /// AssemblerDialect - Which dialect of an assembler variant to use.
unsigned AssemblerDialect; // Defaults to 0 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 -------------------------------------===// //===--- Data Emission Directives -------------------------------------===//
/// ZeroDirective - this should be set to the directive used to get some /// ZeroDirective - this should be set to the directive used to get some
@ -496,6 +500,9 @@ namespace llvm {
unsigned getAssemblerDialect() const { unsigned getAssemblerDialect() const {
return AssemblerDialect; return AssemblerDialect;
} }
const char *getStringConstantPrefix() const {
return StringConstantPrefix;
}
const char *getZeroDirective() const { const char *getZeroDirective() const {
return ZeroDirective; return ZeroDirective;
} }

View File

@ -48,6 +48,7 @@ ARMTargetAsmInfo::ARMTargetAsmInfo(const ARMTargetMachine &TM) {
if (Subtarget->isTargetDarwin()) { if (Subtarget->isTargetDarwin()) {
GlobalPrefix = "_"; GlobalPrefix = "_";
PrivateGlobalPrefix = "L"; PrivateGlobalPrefix = "L";
StringConstantPrefix = "\1LC";
BSSSection = 0; // no BSS section. BSSSection = 0; // no BSS section.
ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill
SetDirective = "\t.set\t"; SetDirective = "\t.set\t";

View File

@ -39,6 +39,7 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
CommentString = ";"; CommentString = ";";
GlobalPrefix = "_"; GlobalPrefix = "_";
PrivateGlobalPrefix = "L"; PrivateGlobalPrefix = "L";
StringConstantPrefix = "\1LC";
ConstantPoolSection = "\t.const\t"; ConstantPoolSection = "\t.const\t";
JumpTableDataSection = ".const"; JumpTableDataSection = ".const";
CStringSection = "\t.cstring"; CStringSection = "\t.cstring";

View File

@ -45,6 +45,7 @@ TargetAsmInfo::TargetAsmInfo() :
InlineAsmStart("#APP"), InlineAsmStart("#APP"),
InlineAsmEnd("#NO_APP"), InlineAsmEnd("#NO_APP"),
AssemblerDialect(0), AssemblerDialect(0),
StringConstantPrefix(".str"),
ZeroDirective("\t.zero\t"), ZeroDirective("\t.zero\t"),
ZeroDirectiveSuffix(0), ZeroDirectiveSuffix(0),
AsciiDirective("\t.ascii\t"), AsciiDirective("\t.ascii\t"),

View File

@ -66,6 +66,7 @@ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine &TM) {
ReadOnlySection = "\t.const\n"; ReadOnlySection = "\t.const\n";
LCOMMDirective = "\t.lcomm\t"; LCOMMDirective = "\t.lcomm\t";
SwitchToSectionDirective = "\t.section "; SwitchToSectionDirective = "\t.section ";
StringConstantPrefix = "\1LC";
COMMDirectiveTakesAlignment = false; COMMDirectiveTakesAlignment = false;
HasDotTypeDotSizeDirective = false; HasDotTypeDotSizeDirective = false;
if (TM.getRelocationModel() == Reloc::Static) { if (TM.getRelocationModel() == Reloc::Static) {