aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ELFWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-01 21:11:14 +0000
committerChris Lattner <sabre@nondot.org>2009-08-01 21:11:14 +0000
commitc9c277ba0fa0b30949f2bb49eb1e2894b87a08ba (patch)
treebaca8808c217e3674dcf9b9b558a2e32088d4fac /llvm/lib/CodeGen/ELFWriter.cpp
parente480ce3d2916c2282cc3409b7e3534d265676927 (diff)
downloadllvm-c9c277ba0fa0b30949f2bb49eb1e2894b87a08ba.zip
llvm-c9c277ba0fa0b30949f2bb49eb1e2894b87a08ba.tar.gz
llvm-c9c277ba0fa0b30949f2bb49eb1e2894b87a08ba.tar.bz2
Change SectionKind to be a property that is true of a *section*, it
should have no state that is specific to particular globals in the section. In this case, it means the removal of the "isWeak" and "ExplicitSection" bits. MCSection uses the new form of SectionKind. To handle isWeak, I introduced a new SectionInfo class, which is SectionKind + isWeak, and it is used by the part of the code generator that does classification of a specific global. The ExplicitSection disappears. It is moved onto MCSection as a new "IsDirective" bit. Since the Name of a section is either a section or directive, it makes sense to keep this bit in MCSection. Ultimately the creator of MCSection should canonicalize (e.g.) .text to whatever the actual section is. llvm-svn: 77803
Diffstat (limited to 'llvm/lib/CodeGen/ELFWriter.cpp')
-rw-r--r--llvm/lib/CodeGen/ELFWriter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/ELFWriter.cpp b/llvm/lib/CodeGen/ELFWriter.cpp
index c743832..1d33c7e 100644
--- a/llvm/lib/CodeGen/ELFWriter.cpp
+++ b/llvm/lib/CodeGen/ELFWriter.cpp
@@ -188,16 +188,16 @@ ELFSection &ELFWriter::getConstantPoolSection(MachineConstantPoolEntry &CPE) {
SectionKind Kind;
switch (CPE.getRelocationInfo()) {
default: llvm_unreachable("Unknown section kind");
- case 2: Kind = SectionKind::get(SectionKind::ReadOnlyWithRel,false); break;
+ case 2: Kind = SectionKind::get(SectionKind::ReadOnlyWithRel); break;
case 1:
- Kind = SectionKind::get(SectionKind::ReadOnlyWithRelLocal,false);
+ Kind = SectionKind::get(SectionKind::ReadOnlyWithRelLocal);
break;
case 0:
switch (TM.getTargetData()->getTypeAllocSize(CPE.getType())) {
- case 4: Kind = SectionKind::get(SectionKind::MergeableConst4,false); break;
- case 8: Kind = SectionKind::get(SectionKind::MergeableConst8,false); break;
- case 16: Kind = SectionKind::get(SectionKind::MergeableConst16,false);break;
- default: Kind = SectionKind::get(SectionKind::MergeableConst,false); break;
+ case 4: Kind = SectionKind::get(SectionKind::MergeableConst4); break;
+ case 8: Kind = SectionKind::get(SectionKind::MergeableConst8); break;
+ case 16: Kind = SectionKind::get(SectionKind::MergeableConst16); break;
+ default: Kind = SectionKind::get(SectionKind::MergeableConst); break;
}
}