MC: Remove superfluous section attribute flag definitions

Summary:
llvm/MC/MCSectionMachO.h and llvm/Support/MachO.h both had the same
definitions for the section flags.  Instead, grab the definitions out of
support.

No functionality change.

Reviewers: grosbach, Bigcheese, rafael

Reviewed By: rafael

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2998

llvm-svn: 203211
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 0473729..a2f4810 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -548,15 +548,15 @@
 
       // These sections are atomized at the element boundaries without using
       // symbols.
-    case MCSectionMachO::S_4BYTE_LITERALS:
-    case MCSectionMachO::S_8BYTE_LITERALS:
-    case MCSectionMachO::S_16BYTE_LITERALS:
-    case MCSectionMachO::S_LITERAL_POINTERS:
-    case MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS:
-    case MCSectionMachO::S_LAZY_SYMBOL_POINTERS:
-    case MCSectionMachO::S_MOD_INIT_FUNC_POINTERS:
-    case MCSectionMachO::S_MOD_TERM_FUNC_POINTERS:
-    case MCSectionMachO::S_INTERPOSING:
+    case MachO::S_4BYTE_LITERALS:
+    case MachO::S_8BYTE_LITERALS:
+    case MachO::S_16BYTE_LITERALS:
+    case MachO::S_LITERAL_POINTERS:
+    case MachO::S_NON_LAZY_SYMBOL_POINTERS:
+    case MachO::S_LAZY_SYMBOL_POINTERS:
+    case MachO::S_MOD_INIT_FUNC_POINTERS:
+    case MachO::S_MOD_TERM_FUNC_POINTERS:
+    case MachO::S_INTERPOSING:
       return false;
     }
 }
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index 4211b17..ff1f584 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -34,7 +34,7 @@
 
   TextSection // .text
     = Ctx->getMachOSection("__TEXT", "__text",
-                           MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                           MachO::S_ATTR_PURE_INSTRUCTIONS,
                            SectionKind::getText());
   DataSection // .data
     = Ctx->getMachOSection("__DATA", "__data", 0,
@@ -45,43 +45,43 @@
 
   TLSDataSection // .tdata
     = Ctx->getMachOSection("__DATA", "__thread_data",
-                           MCSectionMachO::S_THREAD_LOCAL_REGULAR,
+                           MachO::S_THREAD_LOCAL_REGULAR,
                            SectionKind::getDataRel());
   TLSBSSSection // .tbss
     = Ctx->getMachOSection("__DATA", "__thread_bss",
-                           MCSectionMachO::S_THREAD_LOCAL_ZEROFILL,
+                           MachO::S_THREAD_LOCAL_ZEROFILL,
                            SectionKind::getThreadBSS());
 
   // TODO: Verify datarel below.
   TLSTLVSection // .tlv
     = Ctx->getMachOSection("__DATA", "__thread_vars",
-                           MCSectionMachO::S_THREAD_LOCAL_VARIABLES,
+                           MachO::S_THREAD_LOCAL_VARIABLES,
                            SectionKind::getDataRel());
 
   TLSThreadInitSection
     = Ctx->getMachOSection("__DATA", "__thread_init",
-                          MCSectionMachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
+                          MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS,
                           SectionKind::getDataRel());
 
   CStringSection // .cstring
     = Ctx->getMachOSection("__TEXT", "__cstring",
-                           MCSectionMachO::S_CSTRING_LITERALS,
+                           MachO::S_CSTRING_LITERALS,
                            SectionKind::getMergeable1ByteCString());
   UStringSection
     = Ctx->getMachOSection("__TEXT","__ustring", 0,
                            SectionKind::getMergeable2ByteCString());
   FourByteConstantSection // .literal4
     = Ctx->getMachOSection("__TEXT", "__literal4",
-                           MCSectionMachO::S_4BYTE_LITERALS,
+                           MachO::S_4BYTE_LITERALS,
                            SectionKind::getMergeableConst4());
   EightByteConstantSection // .literal8
     = Ctx->getMachOSection("__TEXT", "__literal8",
-                           MCSectionMachO::S_8BYTE_LITERALS,
+                           MachO::S_8BYTE_LITERALS,
                            SectionKind::getMergeableConst8());
 
   SixteenByteConstantSection // .literal16
       = Ctx->getMachOSection("__TEXT", "__literal16",
-                             MCSectionMachO::S_16BYTE_LITERALS,
+                             MachO::S_16BYTE_LITERALS,
                              SectionKind::getMergeableConst16());
 
   ReadOnlySection  // .const
@@ -90,36 +90,36 @@
 
   TextCoalSection
     = Ctx->getMachOSection("__TEXT", "__textcoal_nt",
-                           MCSectionMachO::S_COALESCED |
-                           MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                           MachO::S_COALESCED |
+                           MachO::S_ATTR_PURE_INSTRUCTIONS,
                            SectionKind::getText());
   ConstTextCoalSection
     = Ctx->getMachOSection("__TEXT", "__const_coal",
-                           MCSectionMachO::S_COALESCED,
+                           MachO::S_COALESCED,
                            SectionKind::getReadOnly());
   ConstDataSection  // .const_data
     = Ctx->getMachOSection("__DATA", "__const", 0,
                            SectionKind::getReadOnlyWithRel());
   DataCoalSection
     = Ctx->getMachOSection("__DATA","__datacoal_nt",
-                           MCSectionMachO::S_COALESCED,
+                           MachO::S_COALESCED,
                            SectionKind::getDataRel());
   DataCommonSection
     = Ctx->getMachOSection("__DATA","__common",
-                           MCSectionMachO::S_ZEROFILL,
+                           MachO::S_ZEROFILL,
                            SectionKind::getBSS());
   DataBSSSection
-    = Ctx->getMachOSection("__DATA","__bss", MCSectionMachO::S_ZEROFILL,
+    = Ctx->getMachOSection("__DATA","__bss", MachO::S_ZEROFILL,
                            SectionKind::getBSS());
 
 
   LazySymbolPointerSection
     = Ctx->getMachOSection("__DATA", "__la_symbol_ptr",
-                           MCSectionMachO::S_LAZY_SYMBOL_POINTERS,
+                           MachO::S_LAZY_SYMBOL_POINTERS,
                            SectionKind::getMetadata());
   NonLazySymbolPointerSection
     = Ctx->getMachOSection("__DATA", "__nl_symbol_ptr",
-                           MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
+                           MachO::S_NON_LAZY_SYMBOL_POINTERS,
                            SectionKind::getMetadata());
 
   if (RelocM == Reloc::Static) {
@@ -132,11 +132,11 @@
   } else {
     StaticCtorSection
       = Ctx->getMachOSection("__DATA", "__mod_init_func",
-                             MCSectionMachO::S_MOD_INIT_FUNC_POINTERS,
+                             MachO::S_MOD_INIT_FUNC_POINTERS,
                              SectionKind::getDataRel());
     StaticDtorSection
       = Ctx->getMachOSection("__DATA", "__mod_term_func",
-                             MCSectionMachO::S_MOD_TERM_FUNC_POINTERS,
+                             MachO::S_MOD_TERM_FUNC_POINTERS,
                              SectionKind::getDataRel());
   }
 
@@ -149,7 +149,7 @@
   if (T.isMacOSX() && !T.isMacOSXVersionLT(10, 6)) {
     CompactUnwindSection =
       Ctx->getMachOSection("__LD", "__compact_unwind",
-                           MCSectionMachO::S_ATTR_DEBUG,
+                           MachO::S_ATTR_DEBUG,
                            SectionKind::getReadOnly());
 
     if (T.getArch() == Triple::x86_64 || T.getArch() == Triple::x86)
@@ -159,77 +159,77 @@
   // Debug Information.
   DwarfAccelNamesSection =
     Ctx->getMachOSection("__DWARF", "__apple_names",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfAccelObjCSection =
     Ctx->getMachOSection("__DWARF", "__apple_objc",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   // 16 character section limit...
   DwarfAccelNamespaceSection =
     Ctx->getMachOSection("__DWARF", "__apple_namespac",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfAccelTypesSection =
     Ctx->getMachOSection("__DWARF", "__apple_types",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
 
   DwarfAbbrevSection =
     Ctx->getMachOSection("__DWARF", "__debug_abbrev",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfInfoSection =
     Ctx->getMachOSection("__DWARF", "__debug_info",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfLineSection =
     Ctx->getMachOSection("__DWARF", "__debug_line",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfFrameSection =
     Ctx->getMachOSection("__DWARF", "__debug_frame",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfPubNamesSection =
     Ctx->getMachOSection("__DWARF", "__debug_pubnames",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfPubTypesSection =
     Ctx->getMachOSection("__DWARF", "__debug_pubtypes",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfGnuPubNamesSection =
     Ctx->getMachOSection("__DWARF", "__debug_gnu_pubn",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfGnuPubTypesSection =
     Ctx->getMachOSection("__DWARF", "__debug_gnu_pubt",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfStrSection =
     Ctx->getMachOSection("__DWARF", "__debug_str",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfLocSection =
     Ctx->getMachOSection("__DWARF", "__debug_loc",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfARangesSection =
     Ctx->getMachOSection("__DWARF", "__debug_aranges",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfRangesSection =
     Ctx->getMachOSection("__DWARF", "__debug_ranges",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfMacroInfoSection =
     Ctx->getMachOSection("__DWARF", "__debug_macinfo",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   DwarfDebugInlineSection =
     Ctx->getMachOSection("__DWARF", "__debug_inlined",
-                         MCSectionMachO::S_ATTR_DEBUG,
+                         MachO::S_ATTR_DEBUG,
                          SectionKind::getMetadata());
   StackMapSection =
     Ctx->getMachOSection("__LLVM_STACKMAPS", "__llvm_stackmaps", 0,
@@ -765,10 +765,10 @@
   if (Env == IsMachO)
     EHFrameSection =
       Ctx->getMachOSection("__TEXT", "__eh_frame",
-                           MCSectionMachO::S_COALESCED |
-                           MCSectionMachO::S_ATTR_NO_TOC |
-                           MCSectionMachO::S_ATTR_STRIP_STATIC_SYMS |
-                           MCSectionMachO::S_ATTR_LIVE_SUPPORT,
+                           MachO::S_COALESCED |
+                           MachO::S_ATTR_NO_TOC |
+                           MachO::S_ATTR_STRIP_STATIC_SYMS |
+                           MachO::S_ATTR_LIVE_SUPPORT,
                            SectionKind::getReadOnly());
   else if (Env == IsELF)
     EHFrameSection =
diff --git a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
index 39399c0..d19d2ef 100644
--- a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
+++ b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp
@@ -195,19 +195,19 @@
   }
   bool ParseSectionDirectiveCString(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT","__cstring",
-                              MCSectionMachO::S_CSTRING_LITERALS);
+                              MachO::S_CSTRING_LITERALS);
   }
   bool ParseSectionDirectiveLiteral4(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT", "__literal4",
-                              MCSectionMachO::S_4BYTE_LITERALS, 4);
+                              MachO::S_4BYTE_LITERALS, 4);
   }
   bool ParseSectionDirectiveLiteral8(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT", "__literal8",
-                              MCSectionMachO::S_8BYTE_LITERALS, 8);
+                              MachO::S_8BYTE_LITERALS, 8);
   }
   bool ParseSectionDirectiveLiteral16(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT","__literal16",
-                              MCSectionMachO::S_16BYTE_LITERALS, 16);
+                              MachO::S_16BYTE_LITERALS, 16);
   }
   bool ParseSectionDirectiveConstructor(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT","__constructor");
@@ -223,15 +223,15 @@
   }
   bool ParseSectionDirectiveSymbolStub(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT","__symbol_stub",
-                              MCSectionMachO::S_SYMBOL_STUBS |
-                              MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                              MachO::S_SYMBOL_STUBS |
+                              MachO::S_ATTR_PURE_INSTRUCTIONS,
                               // FIXME: Different on PPC and ARM.
                               0, 16);
   }
   bool ParseSectionDirectivePICSymbolStub(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT","__picsymbol_stub",
-                              MCSectionMachO::S_SYMBOL_STUBS |
-                              MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS, 0, 26);
+                              MachO::S_SYMBOL_STUBS |
+                              MachO::S_ATTR_PURE_INSTRUCTIONS, 0, 26);
   }
   bool ParseSectionDirectiveData(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__data");
@@ -241,115 +241,115 @@
   }
   bool ParseSectionDirectiveNonLazySymbolPointers(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__nl_symbol_ptr",
-                              MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS, 4);
+                              MachO::S_NON_LAZY_SYMBOL_POINTERS, 4);
   }
   bool ParseSectionDirectiveLazySymbolPointers(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__la_symbol_ptr",
-                              MCSectionMachO::S_LAZY_SYMBOL_POINTERS, 4);
+                              MachO::S_LAZY_SYMBOL_POINTERS, 4);
   }
   bool ParseSectionDirectiveDyld(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__dyld");
   }
   bool ParseSectionDirectiveModInitFunc(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__mod_init_func",
-                              MCSectionMachO::S_MOD_INIT_FUNC_POINTERS, 4);
+                              MachO::S_MOD_INIT_FUNC_POINTERS, 4);
   }
   bool ParseSectionDirectiveModTermFunc(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__mod_term_func",
-                              MCSectionMachO::S_MOD_TERM_FUNC_POINTERS, 4);
+                              MachO::S_MOD_TERM_FUNC_POINTERS, 4);
   }
   bool ParseSectionDirectiveConstData(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__const");
   }
   bool ParseSectionDirectiveObjCClass(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__class",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCMetaClass(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__meta_class",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCCatClsMeth(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__cat_cls_meth",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCCatInstMeth(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__cat_inst_meth",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCProtocol(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__protocol",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCStringObject(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__string_object",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCClsMeth(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__cls_meth",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCInstMeth(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__inst_meth",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCClsRefs(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__cls_refs",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP |
-                              MCSectionMachO::S_LITERAL_POINTERS, 4);
+                              MachO::S_ATTR_NO_DEAD_STRIP |
+                              MachO::S_LITERAL_POINTERS, 4);
   }
   bool ParseSectionDirectiveObjCMessageRefs(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__message_refs",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP |
-                              MCSectionMachO::S_LITERAL_POINTERS, 4);
+                              MachO::S_ATTR_NO_DEAD_STRIP |
+                              MachO::S_LITERAL_POINTERS, 4);
   }
   bool ParseSectionDirectiveObjCSymbols(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__symbols",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCCategory(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__category",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCClassVars(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__class_vars",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCInstanceVars(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__instance_vars",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCModuleInfo(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__module_info",
-                              MCSectionMachO::S_ATTR_NO_DEAD_STRIP);
+                              MachO::S_ATTR_NO_DEAD_STRIP);
   }
   bool ParseSectionDirectiveObjCClassNames(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT", "__cstring",
-                              MCSectionMachO::S_CSTRING_LITERALS);
+                              MachO::S_CSTRING_LITERALS);
   }
   bool ParseSectionDirectiveObjCMethVarTypes(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT", "__cstring",
-                              MCSectionMachO::S_CSTRING_LITERALS);
+                              MachO::S_CSTRING_LITERALS);
   }
   bool ParseSectionDirectiveObjCMethVarNames(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT", "__cstring",
-                              MCSectionMachO::S_CSTRING_LITERALS);
+                              MachO::S_CSTRING_LITERALS);
   }
   bool ParseSectionDirectiveObjCSelectorStrs(StringRef, SMLoc) {
     return ParseSectionSwitch("__OBJC", "__selector_strs",
-                              MCSectionMachO::S_CSTRING_LITERALS);
+                              MachO::S_CSTRING_LITERALS);
   }
   bool ParseSectionDirectiveTData(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__thread_data",
-                              MCSectionMachO::S_THREAD_LOCAL_REGULAR);
+                              MachO::S_THREAD_LOCAL_REGULAR);
   }
   bool ParseSectionDirectiveText(StringRef, SMLoc) {
     return ParseSectionSwitch("__TEXT", "__text",
-                              MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS);
+                              MachO::S_ATTR_PURE_INSTRUCTIONS);
   }
   bool ParseSectionDirectiveTLV(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__thread_vars",
-                              MCSectionMachO::S_THREAD_LOCAL_VARIABLES);
+                              MachO::S_THREAD_LOCAL_VARIABLES);
   }
   bool ParseSectionDirectiveIdent(StringRef, SMLoc) {
     // Darwin silently ignores the .ident directive.
@@ -358,7 +358,7 @@
   }
   bool ParseSectionDirectiveThreadInitFunc(StringRef, SMLoc) {
     return ParseSectionSwitch("__DATA", "__thread_init",
-                         MCSectionMachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS);
+                         MachO::S_THREAD_LOCAL_INIT_FUNCTION_POINTERS);
   }
 
 };
@@ -374,7 +374,7 @@
   Lex();
 
   // FIXME: Arch specific.
-  bool isText = TAA & MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS;
+  bool isText = TAA & MachO::S_ATTR_PURE_INSTRUCTIONS;
   getStreamer().SwitchSection(getContext().getMachOSection(
                                 Segment, Section, TAA, StubSize,
                                 isText ? SectionKind::getText()
@@ -429,9 +429,9 @@
   const MCSectionMachO *Current = static_cast<const MCSectionMachO*>(
                                        getStreamer().getCurrentSection().first);
   unsigned SectionType = Current->getType();
-  if (SectionType != MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS &&
-      SectionType != MCSectionMachO::S_LAZY_SYMBOL_POINTERS &&
-      SectionType != MCSectionMachO::S_SYMBOL_STUBS)
+  if (SectionType != MachO::S_NON_LAZY_SYMBOL_POINTERS &&
+      SectionType != MachO::S_LAZY_SYMBOL_POINTERS &&
+      SectionType != MachO::S_SYMBOL_STUBS)
     return Error(Loc, "indirect symbol not in a symbol pointer or stub "
                       "section");
 
@@ -729,7 +729,7 @@
 
   getStreamer().EmitTBSSSymbol(getContext().getMachOSection(
                                  "__DATA", "__thread_bss",
-                                 MCSectionMachO::S_THREAD_LOCAL_ZEROFILL,
+                                 MachO::S_THREAD_LOCAL_ZEROFILL,
                                  0, SectionKind::getThreadBSS()),
                                Sym, Size, 1 << Pow2Alignment);
 
@@ -758,7 +758,7 @@
   if (getLexer().is(AsmToken::EndOfStatement)) {
     // Create the zerofill section but no symbol
     getStreamer().EmitZerofill(getContext().getMachOSection(
-                                 Segment, Section, MCSectionMachO::S_ZEROFILL,
+                                 Segment, Section, MachO::S_ZEROFILL,
                                  0, SectionKind::getBSS()));
     return false;
   }
@@ -816,7 +816,7 @@
   //
   // FIXME: Arch specific.
   getStreamer().EmitZerofill(getContext().getMachOSection(
-                               Segment, Section, MCSectionMachO::S_ZEROFILL,
+                               Segment, Section, MachO::S_ZEROFILL,
                                0, SectionKind::getBSS()),
                              Sym, Size, 1 << Pow2Alignment);
 
diff --git a/llvm/lib/MC/MCSectionMachO.cpp b/llvm/lib/MC/MCSectionMachO.cpp
index d91bfe2..b8e5142 100644
--- a/llvm/lib/MC/MCSectionMachO.cpp
+++ b/llvm/lib/MC/MCSectionMachO.cpp
@@ -18,7 +18,7 @@
 /// section type list.
 static const struct {
   const char *AssemblerName, *EnumName;
-} SectionTypeDescriptors[MCSectionMachO::LAST_KNOWN_SECTION_TYPE+1] = {
+} SectionTypeDescriptors[MachO::LAST_KNOWN_SECTION_TYPE+1] = {
   { "regular",                  "S_REGULAR" },                    // 0x00
   { 0,                          "S_ZEROFILL" },                   // 0x01
   { "cstring_literals",         "S_CSTRING_LITERALS" },           // 0x02
@@ -55,7 +55,7 @@
   const char *AssemblerName, *EnumName;
 } SectionAttrDescriptors[] = {
 #define ENTRY(ASMNAME, ENUM) \
-  { MCSectionMachO::ENUM, ASMNAME, #ENUM },
+  { MachO::ENUM, ASMNAME, #ENUM },
 ENTRY("pure_instructions",   S_ATTR_PURE_INSTRUCTIONS)
 ENTRY("no_toc",              S_ATTR_NO_TOC)
 ENTRY("strip_static_syms",   S_ATTR_STRIP_STATIC_SYMS)
@@ -102,8 +102,8 @@
     return;
   }
 
-  unsigned SectionType = TAA & MCSectionMachO::SECTION_TYPE;
-  assert(SectionType <= MCSectionMachO::LAST_KNOWN_SECTION_TYPE &&
+  unsigned SectionType = getType();
+  assert(SectionType <= MachO::LAST_KNOWN_SECTION_TYPE &&
          "Invalid SectionType specified!");
 
   if (SectionTypeDescriptors[SectionType].AssemblerName) {
@@ -116,7 +116,7 @@
   }
 
   // If we don't have any attributes, we're done.
-  unsigned SectionAttrs = TAA & MCSectionMachO::SECTION_ATTRIBUTES;
+  unsigned SectionAttrs = TAA & MachO::SECTION_ATTRIBUTES;
   if (SectionAttrs == 0) {
     // If we have a S_SYMBOL_STUBS size specified, print it along with 'none' as
     // the attribute specifier.
@@ -155,13 +155,13 @@
 }
 
 bool MCSectionMachO::UseCodeAlign() const {
-  return hasAttribute(MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS);
+  return hasAttribute(MachO::S_ATTR_PURE_INSTRUCTIONS);
 }
 
 bool MCSectionMachO::isVirtualSection() const {
-  return (getType() == MCSectionMachO::S_ZEROFILL ||
-          getType() == MCSectionMachO::S_GB_ZEROFILL ||
-          getType() == MCSectionMachO::S_THREAD_LOCAL_ZEROFILL);
+  return (getType() == MachO::S_ZEROFILL ||
+          getType() == MachO::S_GB_ZEROFILL ||
+          getType() == MachO::S_THREAD_LOCAL_ZEROFILL);
 }
 
 /// StripSpaces - This removes leading and trailing spaces from the StringRef.
@@ -228,13 +228,13 @@
 
   // Figure out which section type it is.
   unsigned TypeID;
-  for (TypeID = 0; TypeID !=MCSectionMachO::LAST_KNOWN_SECTION_TYPE+1; ++TypeID)
+  for (TypeID = 0; TypeID != MachO::LAST_KNOWN_SECTION_TYPE + 1; ++TypeID)
     if (SectionTypeDescriptors[TypeID].AssemblerName &&
         SectionType == SectionTypeDescriptors[TypeID].AssemblerName)
       break;
 
   // If we didn't find the section type, reject it.
-  if (TypeID > MCSectionMachO::LAST_KNOWN_SECTION_TYPE)
+  if (TypeID > MachO::LAST_KNOWN_SECTION_TYPE)
     return "mach-o section specifier uses an unknown section type";
 
   // Remember the TypeID.
@@ -244,7 +244,7 @@
   // If we have no comma after the section type, there are no attributes.
   if (Comma.second.empty()) {
     // S_SYMBOL_STUBS always require a symbol stub size specifier.
-    if (TAA == MCSectionMachO::S_SYMBOL_STUBS)
+    if (TAA == MachO::S_SYMBOL_STUBS)
       return "mach-o section specifier of type 'symbol_stubs' requires a size "
              "specifier";
     return "";
@@ -281,14 +281,14 @@
   // Okay, we've parsed the section attributes, see if we have a stub size spec.
   if (Comma.second.empty()) {
     // S_SYMBOL_STUBS always require a symbol stub size specifier.
-    if (TAA == MCSectionMachO::S_SYMBOL_STUBS)
+    if (TAA == MachO::S_SYMBOL_STUBS)
       return "mach-o section specifier of type 'symbol_stubs' requires a size "
       "specifier";
     return "";
   }
 
   // If we have a stub size spec, we must have a sectiontype of S_SYMBOL_STUBS.
-  if ((TAA & MCSectionMachO::SECTION_TYPE) != MCSectionMachO::S_SYMBOL_STUBS)
+  if ((TAA & MachO::SECTION_TYPE) != MachO::S_SYMBOL_STUBS)
     return "mach-o section specifier cannot have a stub size specified because "
            "it does not have type 'symbol_stubs'";
 
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 4143d78..00347f5 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -229,7 +229,7 @@
 
   unsigned Flags = Section.getTypeAndAttributes();
   if (SD.hasInstructions())
-    Flags |= MCSectionMachO::S_ATTR_SOME_INSTRUCTIONS;
+    Flags |= MachO::S_ATTR_SOME_INSTRUCTIONS;
 
   assert(isPowerOf2_32(SD.getAlignment()) && "Invalid alignment!");
   Write32(Log2_32(SD.getAlignment()));
@@ -437,9 +437,9 @@
     const MCSectionMachO &Section =
       cast<MCSectionMachO>(it->SectionData->getSection());
 
-    if (Section.getType() != MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS &&
-        Section.getType() != MCSectionMachO::S_LAZY_SYMBOL_POINTERS &&
-        Section.getType() != MCSectionMachO::S_SYMBOL_STUBS) {
+    if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS &&
+        Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS &&
+        Section.getType() != MachO::S_SYMBOL_STUBS) {
 	MCSymbol &Symbol = *it->Symbol;
 	report_fatal_error("indirect symbol '" + Symbol.getName() +
                            "' not in a symbol pointer or stub section");
@@ -453,7 +453,7 @@
     const MCSectionMachO &Section =
       cast<MCSectionMachO>(it->SectionData->getSection());
 
-    if (Section.getType() != MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS)
+    if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS)
       continue;
 
     // Initialize the section indirect symbol base, if necessary.
@@ -469,8 +469,8 @@
     const MCSectionMachO &Section =
       cast<MCSectionMachO>(it->SectionData->getSection());
 
-    if (Section.getType() != MCSectionMachO::S_LAZY_SYMBOL_POINTERS &&
-        Section.getType() != MCSectionMachO::S_SYMBOL_STUBS)
+    if (Section.getType() != MachO::S_LAZY_SYMBOL_POINTERS &&
+        Section.getType() != MachO::S_SYMBOL_STUBS)
       continue;
 
     // Initialize the section indirect symbol base, if necessary.
@@ -921,7 +921,7 @@
       // special handling.
       const MCSectionMachO &Section =
         static_cast<const MCSectionMachO&>(it->SectionData->getSection());
-      if (Section.getType() == MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS) {
+      if (Section.getType() == MachO::S_NON_LAZY_SYMBOL_POINTERS) {
         // If this symbol is defined and internal, mark it as such.
         if (it->Symbol->isDefined() &&
             !Asm.getSymbolData(*it->Symbol).isExternal()) {
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 607e586..c2526be 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -422,20 +422,20 @@
       if (RelocM == Reloc::DynamicNoPIC) {
         const MCSection *sect =
           OutContext.getMachOSection("__TEXT", "__symbol_stub4",
-                                     MCSectionMachO::S_SYMBOL_STUBS,
+                                     MachO::S_SYMBOL_STUBS,
                                      12, SectionKind::getText());
         OutStreamer.SwitchSection(sect);
       } else {
         const MCSection *sect =
           OutContext.getMachOSection("__TEXT", "__picsymbolstub4",
-                                     MCSectionMachO::S_SYMBOL_STUBS,
+                                     MachO::S_SYMBOL_STUBS,
                                      16, SectionKind::getText());
         OutStreamer.SwitchSection(sect);
       }
       const MCSection *StaticInitSect =
         OutContext.getMachOSection("__TEXT", "__StaticInit",
-                                   MCSectionMachO::S_REGULAR |
-                                   MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                                   MachO::S_REGULAR |
+                                   MachO::S_ATTR_PURE_INSTRUCTIONS,
                                    SectionKind::getText());
       OutStreamer.SwitchSection(StaticInitSect);
     }
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 9a18056..2a2ee25 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -865,14 +865,14 @@
   if (TM.getRelocationModel() == Reloc::PIC_) {
     OutStreamer.SwitchSection(
            OutContext.getMachOSection("__TEXT", "__picsymbolstub1",
-                                      MCSectionMachO::S_SYMBOL_STUBS |
-                                      MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                                      MachO::S_SYMBOL_STUBS |
+                                      MachO::S_ATTR_PURE_INSTRUCTIONS,
                                       32, SectionKind::getText()));
   } else if (TM.getRelocationModel() == Reloc::DynamicNoPIC) {
     OutStreamer.SwitchSection(
            OutContext.getMachOSection("__TEXT","__symbol_stub1",
-                                      MCSectionMachO::S_SYMBOL_STUBS |
-                                      MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                                      MachO::S_SYMBOL_STUBS |
+                                      MachO::S_ATTR_PURE_INSTRUCTIONS,
                                       16, SectionKind::getText()));
   }
   OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
@@ -904,8 +904,8 @@
   if (TM.getRelocationModel() == Reloc::PIC_) {
     const MCSection *StubSection = 
     OutContext.getMachOSection("__TEXT", "__picsymbolstub1",
-                               MCSectionMachO::S_SYMBOL_STUBS |
-                               MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                               MachO::S_SYMBOL_STUBS |
+                               MachO::S_ATTR_PURE_INSTRUCTIONS,
                                32, SectionKind::getText());
     for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
       OutStreamer.SwitchSection(StubSection);
@@ -972,8 +972,8 @@
   
   const MCSection *StubSection =
     OutContext.getMachOSection("__TEXT","__symbol_stub1",
-                               MCSectionMachO::S_SYMBOL_STUBS |
-                               MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                               MachO::S_SYMBOL_STUBS |
+                               MachO::S_ATTR_PURE_INSTRUCTIONS,
                                16, SectionKind::getText());
   for (unsigned i = 0, e = Stubs.size(); i != e; ++i) {
     MCSymbol *Stub = Stubs[i].first;
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
index 5311e42..440bbf0 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
@@ -758,7 +758,7 @@
     //
     // See <rdar://problem/4765733>.
     const MCSectionMachO &SMO = static_cast<const MCSectionMachO&>(Section);
-    return SMO.getType() == MCSectionMachO::S_CSTRING_LITERALS;
+    return SMO.getType() == MachO::S_CSTRING_LITERALS;
   }
 
   virtual bool isSectionAtomizable(const MCSection &Section) const {
@@ -768,15 +768,15 @@
     default:
       return true;
 
-    case MCSectionMachO::S_4BYTE_LITERALS:
-    case MCSectionMachO::S_8BYTE_LITERALS:
-    case MCSectionMachO::S_16BYTE_LITERALS:
-    case MCSectionMachO::S_LITERAL_POINTERS:
-    case MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS:
-    case MCSectionMachO::S_LAZY_SYMBOL_POINTERS:
-    case MCSectionMachO::S_MOD_INIT_FUNC_POINTERS:
-    case MCSectionMachO::S_MOD_TERM_FUNC_POINTERS:
-    case MCSectionMachO::S_INTERPOSING:
+    case MachO::S_4BYTE_LITERALS:
+    case MachO::S_8BYTE_LITERALS:
+    case MachO::S_16BYTE_LITERALS:
+    case MachO::S_LITERAL_POINTERS:
+    case MachO::S_NON_LAZY_SYMBOL_POINTERS:
+    case MachO::S_LAZY_SYMBOL_POINTERS:
+    case MachO::S_MOD_INIT_FUNC_POINTERS:
+    case MachO::S_MOD_TERM_FUNC_POINTERS:
+    case MachO::S_INTERPOSING:
       return false;
     }
   }
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
index 0f16621..a827d22 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
@@ -230,7 +230,7 @@
     if (Symbol->isInSection()) {
       const MCSectionMachO &Section = static_cast<const MCSectionMachO&>(
         Fragment->getParent()->getSection());
-      if (Section.hasAttribute(MCSectionMachO::S_ATTR_DEBUG))
+      if (Section.hasAttribute(MachO::S_ATTR_DEBUG))
         Base = 0;
     }
 
diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 8742a4d..1a890b6 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -541,9 +541,9 @@
     if (!Stubs.empty()) {
       const MCSection *TheSection =
         OutContext.getMachOSection("__IMPORT", "__jump_table",
-                                   MCSectionMachO::S_SYMBOL_STUBS |
-                                   MCSectionMachO::S_ATTR_SELF_MODIFYING_CODE |
-                                   MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
+                                   MachO::S_SYMBOL_STUBS |
+                                   MachO::S_ATTR_SELF_MODIFYING_CODE |
+                                   MachO::S_ATTR_PURE_INSTRUCTIONS,
                                    5, SectionKind::getMetadata());
       OutStreamer.SwitchSection(TheSection);
 
@@ -567,7 +567,7 @@
     if (!Stubs.empty()) {
       const MCSection *TheSection =
         OutContext.getMachOSection("__IMPORT", "__pointers",
-                                   MCSectionMachO::S_NON_LAZY_SYMBOL_POINTERS,
+                                   MachO::S_NON_LAZY_SYMBOL_POINTERS,
                                    SectionKind::getMetadata());
       OutStreamer.SwitchSection(TheSection);