diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-03-08 08:31:54 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-03-08 08:31:54 +0000 |
commit | ddf082082c7594f15be2ee9efc00db3a8a59deb0 (patch) | |
tree | c45ea6f579b03a73f2ffbbf819d759cab0d8a4b7 /llvm/lib | |
parent | b7bc3f2d3077a833741c64eb6c12c335bdbe3130 (diff) | |
download | bcm5719-llvm-ddf082082c7594f15be2ee9efc00db3a8a59deb0.tar.gz bcm5719-llvm-ddf082082c7594f15be2ee9efc00db3a8a59deb0.zip |
Putting more constants which do not contain relocations into .literal{4|8|16}
llvm-svn: 35026
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 11 | ||||
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 15 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86AsmPrinter.cpp | 11 |
3 files changed, 21 insertions, 16 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index fc65144f57e..03ac17bf961 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -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()) diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp index e16303e888d..7f57f69656f 100644 --- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -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()) diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp index ad9a1e8e9f0..81ec50e345e 100644 --- a/llvm/lib/Target/X86/X86AsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp @@ -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()) |