Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.

llvm-svn: 77184
diff --git a/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp b/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
index e8f216d..c855632 100644
--- a/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
+++ b/llvm/lib/Target/PIC16/PIC16TargetAsmInfo.cpp
@@ -37,18 +37,21 @@
   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 @@
   // 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 @@
   // 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 @@
 
   // 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 @@
   
   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 @@
 
   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 @@
 
   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);
   }