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.
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;
}

View 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";

View 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";

View 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"),

View 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) {