diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-07-27 05:32:16 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-07-27 05:32:16 +0000 |
| commit | 149465ea06451b9ec1881347b2dccd311ab32576 (patch) | |
| tree | 67380d89f607e4f46c879187360723f98bca45ec /llvm/lib/Target/PIC16 | |
| parent | 4ead0b9e1cfe52925dd9a8fef2ea9845396947df (diff) | |
| download | bcm5719-llvm-149465ea06451b9ec1881347b2dccd311ab32576.tar.gz bcm5719-llvm-149465ea06451b9ec1881347b2dccd311ab32576.zip | |
Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.
llvm-svn: 77184
Diffstat (limited to 'llvm/lib/Target/PIC16')
| -rw-r--r-- | llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp | 8 | ||||
| -rw-r--r-- | llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp | 38 |
2 files changed, 29 insertions, 17 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp index 7195551e4c7..a72b8e5e500 100644 --- a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp +++ b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp @@ -61,8 +61,8 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Now emit the instructions of function in its code section. const char *codeSection = PAN::getCodeSectionName(CurrentFnName).c_str(); - const Section *fCodeSection = TAI->getNamedSection(codeSection, - SectionFlags::Code); + const Section *fCodeSection = + TAI->getNamedSection(codeSection, SectionKind::Text); // Start the Code Section. O << "\n"; SwitchToSection(fCodeSection); @@ -291,8 +291,8 @@ void PIC16AsmPrinter::EmitFunctionFrame(MachineFunction &MF) { O << "\n"; const char *SectionName = PAN::getFrameSectionName(CurrentFnName).c_str(); - const Section *fPDataSection = TAI->getNamedSection(SectionName, - SectionFlags::Writable); + const Section *fPDataSection = + TAI->getNamedSection(SectionName, SectionKind::DataRel); SwitchToSection(fPDataSection); // Emit function frame label diff --git a/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp b/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp index e8f216d0995..c855632d9f5 100644 --- a/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp +++ b/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp @@ -37,18 +37,21 @@ PIC16TargetAsmInfo(const PIC16TargetMachine &TM) ZeroDirective = NULL; AsciiDirective = " dt "; AscizDirective = NULL; - BSSSection_ = getNamedSection("udata.# UDATA", - SectionFlags::Writable | SectionFlags::BSS); - ReadOnlySection = getNamedSection("romdata.# ROMDATA", SectionFlags::None); - DataSection = getNamedSection("idata.# IDATA", SectionFlags::Writable); + BSSSection_ = getNamedSection("udata.# UDATA", SectionKind::BSS); + ReadOnlySection = getNamedSection("romdata.# ROMDATA", SectionKind::ReadOnly); + DataSection = getNamedSection("idata.# IDATA", SectionKind::DataRel); SwitchToSectionDirective = ""; // Need because otherwise a .text symbol is emitted by DwarfWriter // in BeginModule, and gpasm cribbs for that .text symbol. - TextSection = getUnnamedSection("", SectionFlags::Code); + TextSection = getUnnamedSection("", SectionKind::Text); PIC16Section *ROSection = new PIC16Section(getReadOnlySection()); ROSections.push_back(ROSection); - ExternalVarDecls = new PIC16Section(getNamedSection("ExternalVarDecls")); - ExternalVarDefs = new PIC16Section(getNamedSection("ExternalVarDefs")); + + // FIXME: I don't know what the classification of these sections really is. + ExternalVarDecls = new PIC16Section(getNamedSection("ExternalVarDecls", + SectionKind::Metadata)); + ExternalVarDefs = new PIC16Section(getNamedSection("ExternalVarDefs", + SectionKind::Metadata)); // Set it to false because we weed to generate c file name and not bc file // name. HasSingleParameterDotFile = false; @@ -95,7 +98,9 @@ PIC16TargetAsmInfo::getBSSSectionForGlobal(const GlobalVariable *GV) const { // No BSS section spacious enough was found. Crate a new one. if (!FoundBSS) { std::string name = PAN::getUdataSectionName(BSSSections.size()); - const Section *NewSection = getNamedSection(name.c_str()); + const Section *NewSection = getNamedSection(name.c_str(), + // FIXME. + SectionKind::Metadata); FoundBSS = new PIC16Section(NewSection); @@ -135,7 +140,9 @@ PIC16TargetAsmInfo::getIDATASectionForGlobal(const GlobalVariable *GV) const { // No IDATA section spacious enough was found. Crate a new one. if (!FoundIDATA) { std::string name = PAN::getIdataSectionName(IDATASections.size()); - const Section *NewSection = getNamedSection(name.c_str()); + const Section *NewSection = getNamedSection(name.c_str(), + // FIXME. + SectionKind::Metadata); FoundIDATA = new PIC16Section(NewSection); @@ -168,7 +175,9 @@ PIC16TargetAsmInfo::getSectionForAuto(const GlobalVariable *GV) const { // No Auto section was found. Crate a new one. if (!FoundAutoSec) { - const Section *NewSection = getNamedSection(name.c_str()); + const Section *NewSection = getNamedSection(name.c_str(), + // FIXME. + SectionKind::Metadata); FoundAutoSec = new PIC16Section(NewSection); @@ -316,7 +325,7 @@ PIC16TargetAsmInfo::CreateBSSSectionForGlobal(const GlobalVariable *GV, PIC16Section *NewBSS = FoundBSS; if (NewBSS == NULL) { - const Section *NewSection = getNamedSection(Name.c_str()); + const Section *NewSection = getNamedSection(Name.c_str(), SectionKind::BSS); NewBSS = new PIC16Section(NewSection); BSSSections.push_back(NewBSS); } @@ -367,7 +376,9 @@ PIC16TargetAsmInfo::CreateIDATASectionForGlobal(const GlobalVariable *GV, PIC16Section *NewIDATASec = FoundIDATASec; if (NewIDATASec == NULL) { - const Section *NewSection = getNamedSection(Name.c_str()); + const Section *NewSection = getNamedSection(Name.c_str(), + // FIXME: + SectionKind::Metadata); NewIDATASec = new PIC16Section(NewSection); IDATASections.push_back(NewIDATASec); } @@ -405,7 +416,8 @@ PIC16TargetAsmInfo::CreateROSectionForGlobal(const GlobalVariable *GV, PIC16Section *NewRomSec = FoundROSec; if (NewRomSec == NULL) { - const Section *NewSection = getNamedSection(Name.c_str()); + const Section *NewSection = getNamedSection(Name.c_str(), + SectionKind::ReadOnly); NewRomSec = new PIC16Section(NewSection); ROSections.push_back(NewRomSec); } |

