summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreTargetObjectFile.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/Target/XCore/XCoreTargetObjectFile.cpp
parente480ce3d2916c2282cc3409b7e3534d265676927 (diff)
downloadbcm5719-llvm-c9c277ba0fa0b30949f2bb49eb1e2894b87a08ba.tar.gz
bcm5719-llvm-c9c277ba0fa0b30949f2bb49eb1e2894b87a08ba.zip
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/Target/XCore/XCoreTargetObjectFile.cpp')
-rw-r--r--llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp b/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
index a9b46edb169..0f2c6a39ba6 100644
--- a/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
+++ b/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
@@ -16,9 +16,12 @@ using namespace llvm;
void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
TargetLoweringObjectFileELF::Initialize(Ctx, TM);
- TextSection = getOrCreateSection("\t.text", true, SectionKind::Text);
- DataSection = getOrCreateSection("\t.dp.data", false, SectionKind::DataRel);
- BSSSection_ = getOrCreateSection("\t.dp.bss", false, SectionKind::BSS);
+ TextSection = getOrCreateSection("\t.text", true,
+ SectionKind::get(SectionKind::Text));
+ DataSection = getOrCreateSection("\t.dp.data", false,
+ SectionKind::get(SectionKind::DataRel));
+ BSSSection_ = getOrCreateSection("\t.dp.bss", false,
+ SectionKind::get(SectionKind::BSS));
// TLS globals are lowered in the backend to arrays indexed by the current
// thread id. After lowering they require no special handling by the linker
@@ -29,8 +32,8 @@ void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
if (TM.getSubtarget<XCoreSubtarget>().isXS1A())
// FIXME: Why is this writable ("datarel")???
ReadOnlySection = getOrCreateSection("\t.dp.rodata", false,
- SectionKind::DataRel);
+ SectionKind::get(SectionKind::DataRel));
else
ReadOnlySection = getOrCreateSection("\t.cp.rodata", false,
- SectionKind::ReadOnly);
+ SectionKind::get(SectionKind::ReadOnly));
}
OpenPOWER on IntegriCloud