Make SectionKind::get() private.
authorChris Lattner <sabre@nondot.org>
Sun, 2 Aug 2009 00:02:44 +0000 (00:02 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 2 Aug 2009 00:02:44 +0000 (00:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77835 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/SectionKind.h
lib/Target/Alpha/AlphaISelLowering.cpp
lib/Target/PIC16/PIC16AsmPrinter.cpp
lib/Target/PIC16/PIC16TargetObjectFile.cpp
lib/Target/XCore/XCoreTargetObjectFile.cpp
tools/llvm-mc/llvm-mc.cpp

index 8cb9b325c723e73d77fd5c9cb1746c1c2f3bdc22..7841df80faea355cbc06af7b5befd28d06c27487 100644 (file)
@@ -170,12 +170,13 @@ public:
   bool isReadOnlyWithRelLocal() const {
     return K == ReadOnlyWithRelLocal;
   }
-  
+private: 
   static SectionKind get(Kind K) {
     SectionKind Res;
     Res.K = K;
     return Res;
   }
+public:
   
   static SectionKind getMetadata() { return get(Metadata); }
   static SectionKind getText() { return get(Text); }
index 73fab21294af0054e0245cf45fbbd601110835a0..a17209e706683a097d0f3c30ec2955221ce28831 100644 (file)
@@ -37,11 +37,11 @@ public:
   void Initialize(MCContext &Ctx, const TargetMachine &TM) {
     TargetLoweringObjectFile::Initialize(Ctx, TM);
     TextSection = getOrCreateSection("_text", true, 
-                                     SectionKind::get(SectionKind::Text));
+                                     SectionKind::getText());
     DataSection = getOrCreateSection("_data", true, 
-                                     SectionKind::get(SectionKind::DataRel));
+                                     SectionKind::getDataRel());
     ReadOnlySection = getOrCreateSection("_rodata", true, 
-                                     SectionKind::get(SectionKind::ReadOnly));
+                                         SectionKind::getReadOnly());
   }
 };
 }
index 596ec7a32be0907438b777729a9e211da799adca..ea4515696a5e92e6eca9eaf39acbd573ba1cfefe 100644 (file)
@@ -73,7 +73,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
  
   const MCSection *fCodeSection = 
     getObjFileLowering().getOrCreateSection(codeSection, false, 
-                                           SectionKind::get(SectionKind::Text));
+                                           SectionKind::getText());
   // Start the Code Section.
   O <<  "\n";
   SwitchToSection(fCodeSection);
@@ -350,7 +350,7 @@ void PIC16AsmPrinter::EmitFunctionFrame(MachineFunction &MF) {
 
   const MCSection *fPDataSection =
     getObjFileLowering().getOrCreateSection(SectionName, false,
-                                        SectionKind::get(SectionKind::DataRel));
+                                        SectionKind::getDataRel());
   SwitchToSection(fPDataSection);
   
   // Emit function frame label
index 04f2ebf1133bc4d64575da93ceb4e3d5ef09df5a..f287456743a27d448f2c9e0f044f74e562876f96 100644 (file)
@@ -20,26 +20,26 @@ void PIC16TargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &tm){
   TM = &tm;
   
   BSSSection = getOrCreateSection("udata.# UDATA", false, 
-                                  SectionKind::get(SectionKind::BSS));
+                                  SectionKind::getBSS());
   ReadOnlySection = getOrCreateSection("romdata.# ROMDATA", false,
-                                       SectionKind::get(SectionKind::ReadOnly));
+                                       SectionKind::getReadOnly());
   DataSection = getOrCreateSection("idata.# IDATA", false,
-                                   SectionKind::get(SectionKind::DataRel));
+                                   SectionKind::getDataRel());
   
   // Need because otherwise a .text symbol is emitted by DwarfWriter
   // in BeginModule, and gpasm cribbs for that .text symbol.
   TextSection = getOrCreateSection("", true,
-                                   SectionKind::get(SectionKind::Text));
+                                   SectionKind::getText());
 
   ROSections.push_back(new PIC16Section(ReadOnlySection));
   
   // FIXME: I don't know what the classification of these sections really is.
   ExternalVarDecls = new PIC16Section(getOrCreateSection("ExternalVarDecls",
                                                          false,
-                                      SectionKind::get(SectionKind::Metadata)));
+                                      SectionKind::getMetadata()));
   ExternalVarDefs = new PIC16Section(getOrCreateSection("ExternalVarDefs",
                                                         false,
-                                      SectionKind::get(SectionKind::Metadata)));
+                                      SectionKind::getMetadata()));
 }
 
 
@@ -69,7 +69,7 @@ PIC16TargetObjectFile::getBSSSectionForGlobal(const GlobalVariable *GV) const {
     std::string name = PAN::getUdataSectionName(BSSSections.size());
     const MCSection *NewSection = getOrCreateSection(name.c_str(), false,
                                                      // FIXME.
-                                       SectionKind::get(SectionKind::Metadata));
+                                                    SectionKind::getMetadata());
 
     FoundBSS = new PIC16Section(NewSection);
 
@@ -111,7 +111,7 @@ PIC16TargetObjectFile::getIDATASectionForGlobal(const GlobalVariable *GV) const{
     std::string name = PAN::getIdataSectionName(IDATASections.size());
     const MCSection *NewSection = getOrCreateSection(name.c_str(), false,
                                                    // FIXME.
-                                       SectionKind::get(SectionKind::Metadata));
+                                                    SectionKind::getMetadata());
 
     FoundIDATA = new PIC16Section(NewSection);
 
@@ -147,7 +147,7 @@ PIC16TargetObjectFile::getSectionForAuto(const GlobalVariable *GV) const {
     const MCSection *NewSection = getOrCreateSection(name.c_str(),
                                                      // FIXME.
                                                      false,
-                                       SectionKind::get(SectionKind::Metadata));
+                                       SectionKind::getMetadata());
 
     FoundAutoSec = new PIC16Section(NewSection);
 
@@ -300,7 +300,7 @@ PIC16TargetObjectFile::CreateBSSSectionForGlobal(const GlobalVariable *GV,
   PIC16Section *NewBSS = FoundBSS;
   if (NewBSS == NULL) {
     const MCSection *NewSection = getOrCreateSection(Name.c_str(), false,
-                                            SectionKind::get(SectionKind::BSS));
+                                            SectionKind::getBSS());
     NewBSS = new PIC16Section(NewSection);
     BSSSections.push_back(NewBSS);
   }
@@ -353,7 +353,7 @@ PIC16TargetObjectFile::CreateIDATASectionForGlobal(const GlobalVariable *GV,
   if (NewIDATASec == NULL) {
     const MCSection *NewSection = getOrCreateSection(Name.c_str(), false,
                                                    // FIXME:
-                                       SectionKind::get(SectionKind::Metadata));
+                                       SectionKind::getMetadata());
     NewIDATASec = new PIC16Section(NewSection);
     IDATASections.push_back(NewIDATASec);
   }
@@ -392,7 +392,7 @@ PIC16TargetObjectFile::CreateROSectionForGlobal(const GlobalVariable *GV,
   PIC16Section *NewRomSec = FoundROSec;
   if (NewRomSec == NULL) {
     const MCSection *NewSection = getOrCreateSection(Name.c_str(), false,
-                                       SectionKind::get(SectionKind::ReadOnly));
+                                       SectionKind::getReadOnly());
     NewRomSec = new PIC16Section(NewSection);
     ROSections.push_back(NewRomSec);
   }
index e4d83dd53189b34f9e2e7372a15c518a0d30a70e..644b0249ce7a3f8d80ef1af6f5dd0d15704b6cc9 100644 (file)
@@ -17,11 +17,11 @@ void XCoreTargetObjectFile::Initialize(MCContext &Ctx, const TargetMachine &TM){
   TargetLoweringObjectFileELF::Initialize(Ctx, TM);
 
   TextSection = getOrCreateSection("\t.text", true, 
-                                   SectionKind::get(SectionKind::Text));
+                                   SectionKind::getText());
   DataSection = getOrCreateSection("\t.dp.data", false, 
-                                   SectionKind::get(SectionKind::DataRel));
+                                   SectionKind::getDataRel());
   BSSSection = getOrCreateSection("\t.dp.bss", false, 
-                                  SectionKind::get(SectionKind::BSS));
+                                  SectionKind::getBSS());
   
   // 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
@@ -32,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::get(SectionKind::DataRel));
+                                        SectionKind::getDataRel());
   else
     ReadOnlySection = getOrCreateSection("\t.cp.rodata", false,
-                                       SectionKind::get(SectionKind::ReadOnly));
+                                       SectionKind::getReadOnly());
 }
index 1d7975219658e448fa6548f024ea4e1cb3626249..c372547072c06dd353852ee1661fad02ad3164c8 100644 (file)
@@ -193,7 +193,7 @@ static int AssembleInput(const char *ProgName) {
   Str.get()->SwitchSection(MCSection::Create("__TEXT,__text,"
                                              "regular,pure_instructions",
                                              false,
-                                            SectionKind::get(SectionKind::Text),
+                                            SectionKind::getText(),
                                              Ctx));
 
   AsmParser Parser(SrcMgr, Ctx, *Str.get());