aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/ELFWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-27 05:32:16 +0000
committerChris Lattner <sabre@nondot.org>2009-07-27 05:32:16 +0000
commit5fe575ff4fdefc1b003a009b1b9282526a26c237 (patch)
tree416ba3b4b1c715725a43935b710b6245dd809608 /lib/CodeGen/ELFWriter.cpp
parent1f5c9887544ac2cb39d48e35cc6fa7a7b73ed3b0 (diff)
Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ELFWriter.cpp')
-rw-r--r--lib/CodeGen/ELFWriter.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/CodeGen/ELFWriter.cpp b/lib/CodeGen/ELFWriter.cpp
index c0e7b93cf1..c61d4210cb 100644
--- a/lib/CodeGen/ELFWriter.cpp
+++ b/lib/CodeGen/ELFWriter.cpp
@@ -228,18 +228,18 @@ unsigned ELFWriter::getGlobalELFType(const GlobalValue *GV) {
// getElfSectionFlags - Get the ELF Section Header flags based
// on the flags defined in ELFTargetAsmInfo.
-unsigned ELFWriter::getElfSectionFlags(unsigned Flags) {
+unsigned ELFWriter::getElfSectionFlags(SectionKind Kind) {
unsigned ElfSectionFlags = ELFSection::SHF_ALLOC;
- if (Flags & SectionFlags::Code)
+ if (Kind.isText())
ElfSectionFlags |= ELFSection::SHF_EXECINSTR;
- if (Flags & SectionFlags::Writable)
+ if (Kind.isWriteable())
ElfSectionFlags |= ELFSection::SHF_WRITE;
- if (Flags & SectionFlags::Mergeable)
+ if (Kind.isMergeableConst())
ElfSectionFlags |= ELFSection::SHF_MERGE;
- if (Flags & SectionFlags::TLS)
+ if (Kind.isThreadLocal())
ElfSectionFlags |= ELFSection::SHF_TLS;
- if (Flags & SectionFlags::Strings)
+ if (Kind.isMergeableCString())
ElfSectionFlags |= ELFSection::SHF_STRINGS;
return ElfSectionFlags;
@@ -293,7 +293,7 @@ void ELFWriter::EmitGlobal(const GlobalValue *GV) {
// Get ELF section from TAI
const Section *S = TAI->SectionForGlobal(GV);
- unsigned SectionFlags = getElfSectionFlags(S->getFlags());
+ unsigned SectionFlags = getElfSectionFlags(S->getKind());
// The symbol align should update the section alignment if needed
const TargetData *TD = TM.getTargetData();