mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-09 13:41:47 +00:00
simplify code now that it is inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76689 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fae02a2ab1
commit
b2fb9ccbb7
@ -61,10 +61,8 @@ ELFTargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
|
||||
|
||||
// By default - all relocations in PIC mode would force symbol to be
|
||||
// placed in r/w section.
|
||||
unsigned Reloc = (TM.getRelocationModel() != Reloc::Static ?
|
||||
Reloc::LocalOrGlobal : Reloc::None);
|
||||
|
||||
if (Reloc != Reloc::None && C->ContainsRelocations(Reloc))
|
||||
if (TM.getRelocationModel() != Reloc::Static &&
|
||||
C->ContainsRelocations(Reloc::LocalOrGlobal))
|
||||
return (C->ContainsRelocations(Reloc::Global) ?
|
||||
(isConstant ?
|
||||
SectionKind::DataRelRO : SectionKind::DataRel) :
|
||||
|
@ -209,20 +209,11 @@ TargetAsmInfo::SectionKindForGlobal(const GlobalValue *GV) const {
|
||||
// note, there is no thread-local r/o section.
|
||||
Constant *C = GVar->getInitializer();
|
||||
if (C->ContainsRelocations(Reloc::LocalOrGlobal)) {
|
||||
// Decide, whether it is still possible to put symbol into r/o section.
|
||||
unsigned Reloc = (TM.getRelocationModel() != Reloc::Static ?
|
||||
Reloc::LocalOrGlobal : Reloc::None);
|
||||
|
||||
// We already did a query for 'all' relocs, thus - early exits.
|
||||
if (Reloc == Reloc::LocalOrGlobal)
|
||||
// Decide whether it is still possible to put symbol into r/o section.
|
||||
if (TM.getRelocationModel() != Reloc::Static)
|
||||
return SectionKind::Data;
|
||||
else if (Reloc == Reloc::None)
|
||||
else
|
||||
return SectionKind::ROData;
|
||||
else {
|
||||
// Ok, target wants something funny. Honour it.
|
||||
return (C->ContainsRelocations(Reloc) ?
|
||||
SectionKind::Data : SectionKind::ROData);
|
||||
}
|
||||
} else {
|
||||
// Check, if initializer is a null-terminated string
|
||||
if (isConstantString(C))
|
||||
|
Loading…
Reference in New Issue
Block a user