1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Putting more constants which do not contain relocations into .literal{4|8|16}

llvm-svn: 35026
This commit is contained in:
Evan Cheng 2007-03-08 08:31:54 +00:00
parent 7e516796f6
commit 7d528d089c
3 changed files with 21 additions and 16 deletions

View File

@ -834,17 +834,18 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
SwitchToDataSection(TAI->getDataSection(), I);
else {
// Read-only data.
bool isIntFPLiteral = Type->isInteger() || Type->isFloatingPoint();
if (C->ContainsRelocations() && Subtarget->isTargetDarwin() &&
bool HasReloc = C->ContainsRelocations();
if (HasReloc &&
Subtarget->isTargetDarwin() &&
TM.getRelocationModel() != Reloc::Static)
SwitchToDataSection("\t.const_data\n");
else if (isIntFPLiteral && Size == 4 &&
else if (!HasReloc && Size == 4 &&
TAI->getFourByteConstantSection())
SwitchToDataSection(TAI->getFourByteConstantSection(), I);
else if (isIntFPLiteral && Size == 8 &&
else if (!HasReloc && Size == 8 &&
TAI->getEightByteConstantSection())
SwitchToDataSection(TAI->getEightByteConstantSection(), I);
else if (isIntFPLiteral && Size == 16 &&
else if (!HasReloc && Size == 16 &&
TAI->getSixteenByteConstantSection())
SwitchToDataSection(TAI->getSixteenByteConstantSection(), I);
else if (TAI->getReadOnlySection())

View File

@ -701,7 +701,10 @@ bool LinuxAsmPrinter::doFinalization(Module &M) {
+ ",\"aw\",@progbits";
SwitchToDataSection(SectionName.c_str());
} else {
SwitchToDataSection(TAI->getDataSection(), I);
if (I->isConstant() && TAI->getReadOnlySection())
SwitchToDataSection(TAI->getReadOnlySection(), I);
else
SwitchToDataSection(TAI->getDataSection(), I);
}
break;
default:
@ -942,17 +945,17 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
SwitchToDataSection(TAI->getDataSection(), I);
else {
// Read-only data.
bool isIntFPLiteral = Type->isInteger() || Type->isFloatingPoint();
if (C->ContainsRelocations() &&
bool HasReloc = C->ContainsRelocations();
if (HasReloc &&
TM.getRelocationModel() != Reloc::Static)
SwitchToDataSection("\t.const_data\n");
else if (isIntFPLiteral && Size == 4 &&
else if (!HasReloc && Size == 4 &&
TAI->getFourByteConstantSection())
SwitchToDataSection(TAI->getFourByteConstantSection(), I);
else if (isIntFPLiteral && Size == 8 &&
else if (!HasReloc && Size == 8 &&
TAI->getEightByteConstantSection())
SwitchToDataSection(TAI->getEightByteConstantSection(), I);
else if (isIntFPLiteral && Size == 16 &&
else if (!HasReloc && Size == 16 &&
TAI->getSixteenByteConstantSection())
SwitchToDataSection(TAI->getSixteenByteConstantSection(), I);
else if (TAI->getReadOnlySection())

View File

@ -255,17 +255,18 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
SwitchToDataSection(TAI->getDataSection(), I);
else {
// Read-only data.
bool isIntFPLiteral = Type->isInteger() || Type->isFloatingPoint();
if (C->ContainsRelocations() && Subtarget->isTargetDarwin() &&
bool HasReloc = C->ContainsRelocations();
if (HasReloc &&
Subtarget->isTargetDarwin() &&
TM.getRelocationModel() != Reloc::Static)
SwitchToDataSection("\t.const_data\n");
else if (isIntFPLiteral && Size == 4 &&
else if (!HasReloc && Size == 4 &&
TAI->getFourByteConstantSection())
SwitchToDataSection(TAI->getFourByteConstantSection(), I);
else if (isIntFPLiteral && Size == 8 &&
else if (!HasReloc && Size == 8 &&
TAI->getEightByteConstantSection())
SwitchToDataSection(TAI->getEightByteConstantSection(), I);
else if (isIntFPLiteral && Size == 16 &&
else if (!HasReloc && Size == 16 &&
TAI->getSixteenByteConstantSection())
SwitchToDataSection(TAI->getSixteenByteConstantSection(), I);
else if (TAI->getReadOnlySection())