forked from OSchip/llvm-project
simplify this code now that SectionKind knows if a global is weak or not.
llvm-svn: 77141
This commit is contained in:
parent
e45ff5cc2b
commit
d9951203f0
|
@ -129,15 +129,12 @@ DarwinTargetAsmInfo::SelectSectionForGlobal(const GlobalValue *GV,
|
||||||
SectionKind Kind) const {
|
SectionKind Kind) const {
|
||||||
assert(!Kind.isThreadLocal() && "Darwin doesn't support TLS");
|
assert(!Kind.isThreadLocal() && "Darwin doesn't support TLS");
|
||||||
|
|
||||||
// FIXME: Use sectionflags:linkonce instead of isWeakForLinker() here.
|
|
||||||
bool isWeak = GV->isWeakForLinker();
|
|
||||||
|
|
||||||
if (Kind.isText())
|
if (Kind.isText())
|
||||||
return isWeak ? TextCoalSection : TextSection;
|
return Kind.isWeak() ? TextCoalSection : TextSection;
|
||||||
|
|
||||||
// If this is weak/linkonce, put this in a coalescable section, either in text
|
// If this is weak/linkonce, put this in a coalescable section, either in text
|
||||||
// or data depending on if it is writable.
|
// or data depending on if it is writable.
|
||||||
if (isWeak) {
|
if (Kind.isWeak()) {
|
||||||
if (Kind.isReadOnly())
|
if (Kind.isReadOnly())
|
||||||
return ConstTextCoalSection;
|
return ConstTextCoalSection;
|
||||||
return DataCoalSection;
|
return DataCoalSection;
|
||||||
|
|
Loading…
Reference in New Issue