Remove more duplicated code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124056 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2011-01-23 04:43:11 +00:00
parent 907b56ce7a
commit 1c13026e8f
12 changed files with 158 additions and 165 deletions

View File

@ -43,37 +43,37 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI,
// Handle the weird solaris syntax if desired.
if (MAI.usesSunStyleELFSectionSwitchSyntax() &&
!(Flags & MCSectionELF::SHF_MERGE)) {
if (Flags & MCSectionELF::SHF_ALLOC)
!(Flags & ELF::SHF_MERGE)) {
if (Flags & ELF::SHF_ALLOC)
OS << ",#alloc";
if (Flags & MCSectionELF::SHF_EXECINSTR)
if (Flags & ELF::SHF_EXECINSTR)
OS << ",#execinstr";
if (Flags & MCSectionELF::SHF_WRITE)
if (Flags & ELF::SHF_WRITE)
OS << ",#write";
if (Flags & MCSectionELF::SHF_TLS)
if (Flags & ELF::SHF_TLS)
OS << ",#tls";
OS << '\n';
return;
}
OS << ",\"";
if (Flags & MCSectionELF::SHF_ALLOC)
if (Flags & ELF::SHF_ALLOC)
OS << 'a';
if (Flags & MCSectionELF::SHF_EXECINSTR)
if (Flags & ELF::SHF_EXECINSTR)
OS << 'x';
if (Flags & MCSectionELF::SHF_WRITE)
if (Flags & ELF::SHF_WRITE)
OS << 'w';
if (Flags & MCSectionELF::SHF_MERGE)
if (Flags & ELF::SHF_MERGE)
OS << 'M';
if (Flags & MCSectionELF::SHF_STRINGS)
if (Flags & ELF::SHF_STRINGS)
OS << 'S';
if (Flags & MCSectionELF::SHF_TLS)
if (Flags & ELF::SHF_TLS)
OS << 'T';
// If there are target-specific flags, print them.
if (Flags & MCSectionELF::XCORE_SHF_CP_SECTION)
if (Flags & ELF::XCORE_SHF_CP_SECTION)
OS << 'c';
if (Flags & MCSectionELF::XCORE_SHF_DP_SECTION)
if (Flags & ELF::XCORE_SHF_DP_SECTION)
OS << 'd';
OS << '"';
@ -100,7 +100,7 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI,
OS << "progbits";
if (EntrySize) {
assert(Flags & MCSectionELF::SHF_MERGE);
assert(Flags & ELF::SHF_MERGE);
OS << "," << EntrySize;
}
@ -108,7 +108,7 @@ void MCSectionELF::PrintSwitchToSection(const MCAsmInfo &MAI,
}
bool MCSectionELF::UseCodeAlign() const {
return getFlags() & MCSectionELF::SHF_EXECINSTR;
return getFlags() & ELF::SHF_EXECINSTR;
}
bool MCSectionELF::isVirtualSection() const {