[llvm-commits] [llvm] r77835 - in /llvm/trunk: 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

Chris Lattner sabre at nondot.org
Sat Aug 1 17:02:44 PDT 2009


Author: lattner
Date: Sat Aug  1 19:02:44 2009
New Revision: 77835

URL: http://llvm.org/viewvc/llvm-project?rev=77835&view=rev
Log:
Make SectionKind::get() private.

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

Modified: llvm/trunk/include/llvm/MC/SectionKind.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/SectionKind.h?rev=77835&r1=77834&r2=77835&view=diff

==============================================================================
--- llvm/trunk/include/llvm/MC/SectionKind.h (original)
+++ llvm/trunk/include/llvm/MC/SectionKind.h Sat Aug  1 19:02:44 2009
@@ -170,12 +170,13 @@
   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); }

Modified: llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp?rev=77835&r1=77834&r2=77835&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Alpha/AlphaISelLowering.cpp Sat Aug  1 19:02:44 2009
@@ -37,11 +37,11 @@
   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());
   }
 };
 }

Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=77835&r1=77834&r2=77835&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Sat Aug  1 19:02:44 2009
@@ -73,7 +73,7 @@
  
   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 @@
 
   const MCSection *fPDataSection =
     getObjFileLowering().getOrCreateSection(SectionName, false,
-                                        SectionKind::get(SectionKind::DataRel));
+                                        SectionKind::getDataRel());
   SwitchToSection(fPDataSection);
   
   // Emit function frame label

Modified: llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp?rev=77835&r1=77834&r2=77835&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16TargetObjectFile.cpp Sat Aug  1 19:02:44 2009
@@ -20,26 +20,26 @@
   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 @@
     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 @@
     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 @@
     const MCSection *NewSection = getOrCreateSection(name.c_str(),
                                                      // FIXME.
                                                      false,
-                                       SectionKind::get(SectionKind::Metadata));
+                                       SectionKind::getMetadata());
 
     FoundAutoSec = new PIC16Section(NewSection);
 
@@ -300,7 +300,7 @@
   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 @@
   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 @@
   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);
   }

Modified: llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp?rev=77835&r1=77834&r2=77835&view=diff

==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreTargetObjectFile.cpp Sat Aug  1 19:02:44 2009
@@ -17,11 +17,11 @@
   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 @@
   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());
 }

Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=77835&r1=77834&r2=77835&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Sat Aug  1 19:02:44 2009
@@ -193,7 +193,7 @@
   Str.get()->SwitchSection(MCSection::Create("__TEXT,__text,"
                                              "regular,pure_instructions",
                                              false,
-                                            SectionKind::get(SectionKind::Text),
+                                            SectionKind::getText(),
                                              Ctx));
 
   AsmParser Parser(SrcMgr, Ctx, *Str.get());





More information about the llvm-commits mailing list