diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-03-07 07:36:05 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-03-07 07:36:05 +0000 |
commit | 508e0c4d343bd1d58e4112ad4b50d1f9832f6709 (patch) | |
tree | b5465b369b54168f7dd5191371bb362b84a66b49 /lib | |
parent | 6a2154ebd932a3949cdcc23d0b21ea4af4785058 (diff) | |
download | llvm-508e0c4d343bd1d58e4112ad4b50d1f9832f6709.tar.gz llvm-508e0c4d343bd1d58e4112ad4b50d1f9832f6709.tar.bz2 llvm-508e0c4d343bd1d58e4112ad4b50d1f9832f6709.tar.xz |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 18 | ||||
-rw-r--r-- | lib/MC/MCObjectFileInfo.cpp | 84 | ||||
-rw-r--r-- | lib/MC/MCParser/DarwinAsmParser.cpp | 88 | ||||
-rw-r--r-- | lib/MC/MCSectionMachO.cpp | 28 | ||||
-rw-r--r-- | lib/MC/MachObjectWriter.cpp | 16 | ||||
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 8 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 16 | ||||
-rw-r--r-- | lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | 20 | ||||
-rw-r--r-- | lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 8 |
10 files changed, 144 insertions, 144 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 0473729de0..a2f4810cb6 100644 --- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -548,15 +548,15 @@ bool TargetLoweringObjectFileMachO::isSectionAtomizableBySymbols( // 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/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp index 4211b179dc..ff1f584943 100644 --- a/lib/MC/MCObjectFileInfo.cpp +++ b/lib/MC/MCObjectFileInfo.cpp @@ -34,7 +34,7 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { 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 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { 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 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { 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 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { } 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 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { 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 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { // 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 @@ void MCObjectFileInfo::InitEHFrameSection() { 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/lib/MC/MCParser/DarwinAsmParser.cpp b/lib/MC/MCParser/DarwinAsmParser.cpp index 39399c0865..d19d2ef1e1 100644 --- a/lib/MC/MCParser/DarwinAsmParser.cpp +++ b/lib/MC/MCParser/DarwinAsmParser.cpp @@ -195,19 +195,19 @@ public: } 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 @@ public: } 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 @@ public: } 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 @@ public: } 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 @@ bool DarwinAsmParser::ParseSectionSwitch(const char *Segment, 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 @@ bool DarwinAsmParser::ParseDirectiveIndirectSymbol(StringRef, SMLoc Loc) { 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 @@ bool DarwinAsmParser::ParseDirectiveTBSS(StringRef, SMLoc) { 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 @@ bool DarwinAsmParser::ParseDirectiveZerofill(StringRef, SMLoc) { 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 @@ bool DarwinAsmParser::ParseDirectiveZerofill(StringRef, SMLoc) { // // 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/lib/MC/MCSectionMachO.cpp b/lib/MC/MCSectionMachO.cpp index d91bfe25a9..b8e5142299 100644 --- a/lib/MC/MCSectionMachO.cpp +++ b/lib/MC/MCSectionMachO.cpp @@ -18,7 +18,7 @@ using namespace llvm; /// 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 @@ static const struct { 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 @@ void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &MAI, 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 @@ void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &MAI, } // 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 @@ void MCSectionMachO::PrintSwitchToSection(const MCAsmInfo &MAI, } 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 @@ std::string MCSectionMachO::ParseSectionSpecifier(StringRef Spec, // In. // 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 @@ std::string MCSectionMachO::ParseSectionSpecifier(StringRef Spec, // In. // 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 @@ std::string MCSectionMachO::ParseSectionSpecifier(StringRef Spec, // In. // 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/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp index 4143d783e2..00347f546f 100644 --- a/lib/MC/MachObjectWriter.cpp +++ b/lib/MC/MachObjectWriter.cpp @@ -229,7 +229,7 @@ void MachObjectWriter::WriteSection(const MCAssembler &Asm, 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 @@ void MachObjectWriter::BindIndirectSymbols(MCAssembler &Asm) { 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 @@ void MachObjectWriter::BindIndirectSymbols(MCAssembler &Asm) { 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 @@ void MachObjectWriter::BindIndirectSymbols(MCAssembler &Asm) { 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 @@ void MachObjectWriter::WriteObject(MCAssembler &Asm, // 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/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 607e586d7c..c2526bec9e 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -422,20 +422,20 @@ void ARMAsmPrinter::EmitStartOfAsmFile(Module &M) { 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/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 9a1805683d..2a2ee25c5a 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -865,14 +865,14 @@ void PPCDarwinAsmPrinter::EmitStartOfAsmFile(Module &M) { 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 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) { 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 @@ EmitFunctionStubs(const MachineModuleInfoMachO::SymbolListTy &Stubs) { 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/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp index 5311e42929..440bbf0d4f 100644 --- a/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp +++ b/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp @@ -758,7 +758,7 @@ public: // // 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 @@ public: 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/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp b/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp index 0f16621b85..a827d22bd5 100644 --- a/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp +++ b/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp @@ -230,7 +230,7 @@ void X86MachObjectWriter::RecordX86_64Relocation(MachObjectWriter *Writer, 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/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index 8742a4d1be..1a890b6faa 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -541,9 +541,9 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) { 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 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) { 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); |