OSDN Git Service

MC: Use MachO::SectionType for MCSectionMachO::getType's return type
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 7 Mar 2014 18:49:54 +0000 (18:49 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 7 Mar 2014 18:49:54 +0000 (18:49 +0000)
This is a straightfoward replacement, it makes debugging a little
easier.

This has no functional impact.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203264 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCSectionMachO.h
lib/MC/MCParser/DarwinAsmParser.cpp
lib/MC/MCSectionMachO.cpp

index 444a848..a5a2089 100644 (file)
@@ -64,7 +64,10 @@ public:
   unsigned getTypeAndAttributes() const { return TypeAndAttributes; }
   unsigned getStubSize() const { return Reserved2; }
 
-  unsigned getType() const { return TypeAndAttributes & MachO::SECTION_TYPE; }
+  MachO::SectionType getType() const {
+    return static_cast<MachO::SectionType>(TypeAndAttributes &
+                                           MachO::SECTION_TYPE);
+  }
   bool hasAttribute(unsigned Value) const {
     return (TypeAndAttributes & Value) != 0;
   }
index d19d2ef..10fca70 100644 (file)
@@ -428,7 +428,7 @@ bool DarwinAsmParser::ParseDirectiveDesc(StringRef, SMLoc) {
 bool DarwinAsmParser::ParseDirectiveIndirectSymbol(StringRef, SMLoc Loc) {
   const MCSectionMachO *Current = static_cast<const MCSectionMachO*>(
                                        getStreamer().getCurrentSection().first);
-  unsigned SectionType = Current->getType();
+  MachO::SectionType SectionType = Current->getType();
   if (SectionType != MachO::S_NON_LAZY_SYMBOL_POINTERS &&
       SectionType != MachO::S_LAZY_SYMBOL_POINTERS &&
       SectionType != MachO::S_SYMBOL_STUBS)
index b8e5142..2982946 100644 (file)
@@ -102,7 +102,7 @@ void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &MAI,
     return;
   }
 
-  unsigned SectionType = getType();
+  MachO::SectionType SectionType = getType();
   assert(SectionType <= MachO::LAST_KNOWN_SECTION_TYPE &&
          "Invalid SectionType specified!");