switch off of 'Section' onto MCSection. We're not properly using

MCSection subclasses yet, but this is a step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77708 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2009-07-31 18:48:30 +00:00
parent 5e5337a833
commit a87dea4f8c
21 changed files with 189 additions and 182 deletions

View File

@ -8,10 +8,14 @@
//===----------------------------------------------------------------------===//
#include "XCoreTargetObjectFile.h"
#include "XCoreSubtarget.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
XCoreTargetObjectFile::XCoreTargetObjectFile(bool isXS1A) {
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);
@ -22,11 +26,11 @@ XCoreTargetObjectFile::XCoreTargetObjectFile(bool isXS1A) {
TLSDataSection = DataSection;
TLSBSSSection = BSSSection_;
if (isXS1A)
if (TM.getSubtarget<XCoreSubtarget>().isXS1A())
// FIXME: Why is this writable ("datarel")???
ReadOnlySection = getOrCreateSection("\t.dp.rodata", false,
SectionKind::DataRel);
else
ReadOnlySection = getOrCreateSection("\t.cp.rodata", false,
SectionKind::ReadOnly);
}
}