[llvm] r203264 - MC: Use MachO::SectionType for MCSectionMachO::getType's return type
David Majnemer
david.majnemer at gmail.com
Fri Mar 7 10:49:54 PST 2014
Author: majnemer
Date: Fri Mar 7 12:49:54 2014
New Revision: 203264
URL: http://llvm.org/viewvc/llvm-project?rev=203264&view=rev
Log:
MC: Use MachO::SectionType for MCSectionMachO::getType's return type
This is a straightfoward replacement, it makes debugging a little
easier.
This has no functional impact.
Modified:
llvm/trunk/include/llvm/MC/MCSectionMachO.h
llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp
llvm/trunk/lib/MC/MCSectionMachO.cpp
Modified: llvm/trunk/include/llvm/MC/MCSectionMachO.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSectionMachO.h?rev=203264&r1=203263&r2=203264&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCSectionMachO.h (original)
+++ llvm/trunk/include/llvm/MC/MCSectionMachO.h Fri Mar 7 12:49:54 2014
@@ -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;
}
Modified: llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp?rev=203264&r1=203263&r2=203264&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/DarwinAsmParser.cpp Fri Mar 7 12:49:54 2014
@@ -428,7 +428,7 @@ bool DarwinAsmParser::ParseDirectiveDesc
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)
Modified: llvm/trunk/lib/MC/MCSectionMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSectionMachO.cpp?rev=203264&r1=203263&r2=203264&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCSectionMachO.cpp (original)
+++ llvm/trunk/lib/MC/MCSectionMachO.cpp Fri Mar 7 12:49:54 2014
@@ -102,7 +102,7 @@ void MCSectionMachO::PrintSwitchToSectio
return;
}
- unsigned SectionType = getType();
+ MachO::SectionType SectionType = getType();
assert(SectionType <= MachO::LAST_KNOWN_SECTION_TYPE &&
"Invalid SectionType specified!");
More information about the llvm-commits
mailing list