Index: llvm/include/llvm/BinaryFormat/Swift.h =================================================================== --- llvm/include/llvm/BinaryFormat/Swift.h +++ llvm/include/llvm/BinaryFormat/Swift.h @@ -9,7 +9,7 @@ #define LLVM_BINARYFORMAT_SWIFT_H namespace llvm { -namespace swift { +namespace swiftbinaryformat { enum Swift5ReflectionSectionKind { #define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) KIND, @@ -18,7 +18,7 @@ unknown, last = unknown }; -} // end of namespace swift +} // end of namespace swiftbinaryformat } // end of namespace llvm #endif Index: llvm/include/llvm/DWARFLinker/DWARFStreamer.h =================================================================== --- llvm/include/llvm/DWARFLinker/DWARFStreamer.h +++ llvm/include/llvm/DWARFLinker/DWARFStreamer.h @@ -88,7 +88,7 @@ /// Emit the swift reflection section stored in \p Buffer. void emitSwiftReflectionSection( - llvm::swift::Swift5ReflectionSectionKind ReflSectionKind, + llvm::swiftbinaryformat::Swift5ReflectionSectionKind ReflSectionKind, StringRef Buffer, uint32_t Alignment, uint32_t Size); /// Emit debug_ranges for \p FuncRange by translating the Index: llvm/include/llvm/MC/MCObjectFileInfo.h =================================================================== --- llvm/include/llvm/MC/MCObjectFileInfo.h +++ llvm/include/llvm/MC/MCObjectFileInfo.h @@ -230,7 +230,7 @@ MCSection *ReadOnly16Section = nullptr; // Swift5 Reflection Data Sections - std::array + std::array Swift5ReflectionSections = {}; public: @@ -430,8 +430,9 @@ // Swift5 Reflection Data Sections MCSection *getSwift5ReflectionSection( - llvm::swift::Swift5ReflectionSectionKind ReflSectionKind) { - return ReflSectionKind != llvm::swift::Swift5ReflectionSectionKind::unknown + llvm::swiftbinaryformat::Swift5ReflectionSectionKind ReflSectionKind) { + return ReflSectionKind != + llvm::swiftbinaryformat::Swift5ReflectionSectionKind::unknown ? Swift5ReflectionSections[ReflSectionKind] : nullptr; } Index: llvm/include/llvm/Object/MachO.h =================================================================== --- llvm/include/llvm/Object/MachO.h +++ llvm/include/llvm/Object/MachO.h @@ -584,7 +584,7 @@ StringRef mapDebugSectionName(StringRef Name) const override; - llvm::swift::Swift5ReflectionSectionKind + llvm::swiftbinaryformat::Swift5ReflectionSectionKind mapReflectionSectionNameToEnumValue(StringRef SectionName) const override; bool hasPageZeroSegment() const { return HasPageZeroSegment; } Index: llvm/include/llvm/Object/ObjectFile.h =================================================================== --- llvm/include/llvm/Object/ObjectFile.h +++ llvm/include/llvm/Object/ObjectFile.h @@ -291,9 +291,9 @@ virtual void getRelocationTypeName(DataRefImpl Rel, SmallVectorImpl &Result) const = 0; - virtual llvm::swift::Swift5ReflectionSectionKind + virtual llvm::swiftbinaryformat::Swift5ReflectionSectionKind mapReflectionSectionNameToEnumValue(StringRef SectionName) const { - return llvm::swift::Swift5ReflectionSectionKind::unknown; + return llvm::swiftbinaryformat::Swift5ReflectionSectionKind::unknown; }; Expected getSymbolValue(DataRefImpl Symb) const; Index: llvm/lib/DWARFLinker/DWARFStreamer.cpp =================================================================== --- llvm/lib/DWARFLinker/DWARFStreamer.cpp +++ llvm/lib/DWARFLinker/DWARFStreamer.cpp @@ -305,8 +305,8 @@ } void DwarfStreamer::emitSwiftReflectionSection( - llvm::swift::Swift5ReflectionSectionKind ReflSectionKind, StringRef Buffer, - uint32_t Alignment, uint32_t Size) { + llvm::swiftbinaryformat::Swift5ReflectionSectionKind ReflSectionKind, + StringRef Buffer, uint32_t Alignment, uint32_t Size) { MCSection *ReflectionSection = MOFI->getSwift5ReflectionSection(ReflSectionKind); if (ReflectionSection == nullptr) Index: llvm/lib/MC/MCObjectFileInfo.cpp =================================================================== --- llvm/lib/MC/MCObjectFileInfo.cpp +++ llvm/lib/MC/MCObjectFileInfo.cpp @@ -304,9 +304,10 @@ // these sections in the __DWARF segment instead. if (!Ctx->getSwift5ReflectionSegmentName().empty()) { #define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) \ - Swift5ReflectionSections[llvm::swift::Swift5ReflectionSectionKind::KIND] = \ - Ctx->getMachOSection(Ctx->getSwift5ReflectionSegmentName().data(), \ - MACHO, 0, SectionKind::getMetadata()); + Swift5ReflectionSections \ + [llvm::swiftbinaryformat::Swift5ReflectionSectionKind::KIND] = \ + Ctx->getMachOSection(Ctx->getSwift5ReflectionSegmentName().data(), \ + MACHO, 0, SectionKind::getMetadata()); #include "llvm/BinaryFormat/Swift.def" } Index: llvm/lib/Object/MachOObjectFile.cpp =================================================================== --- llvm/lib/Object/MachOObjectFile.cpp +++ llvm/lib/Object/MachOObjectFile.cpp @@ -4767,13 +4767,14 @@ return ObjectPaths; } -llvm::swift::Swift5ReflectionSectionKind +llvm::swiftbinaryformat::Swift5ReflectionSectionKind MachOObjectFile::mapReflectionSectionNameToEnumValue( StringRef SectionName) const { #define HANDLE_SWIFT_SECTION(KIND, MACHO, ELF, COFF) \ - .Case(MACHO, llvm::swift::Swift5ReflectionSectionKind::KIND) - return StringSwitch(SectionName) + .Case(MACHO, llvm::swiftbinaryformat::Swift5ReflectionSectionKind::KIND) + return StringSwitch( + SectionName) #include "llvm/BinaryFormat/Swift.def" - .Default(llvm::swift::Swift5ReflectionSectionKind::unknown); + .Default(llvm::swiftbinaryformat::Swift5ReflectionSectionKind::unknown); #undef HANDLE_SWIFT_SECTION } Index: llvm/tools/dsymutil/DwarfLinkerForBinary.cpp =================================================================== --- llvm/tools/dsymutil/DwarfLinkerForBinary.cpp +++ llvm/tools/dsymutil/DwarfLinkerForBinary.cpp @@ -331,7 +331,7 @@ } NameOrErr->consume_back("__TEXT"); if (Object->mapReflectionSectionNameToEnumValue(*NameOrErr) != - llvm::swift::Swift5ReflectionSectionKind::unknown) { + llvm::swiftbinaryformat::Swift5ReflectionSectionKind::unknown) { return true; } }