diff options
| author | Francis Ricci <francisjricci@gmail.com> | 2017-10-05 23:09:17 +0000 |
|---|---|---|
| committer | Francis Ricci <francisjricci@gmail.com> | 2017-10-05 23:09:17 +0000 |
| commit | b4e77d98ed9ccf8593667220b5bd022853691fad (patch) | |
| tree | e77a9bc58427f3a87765df4833294d0d1ef214e5 /llvm/tools | |
| parent | 945cd644714611279791def24808be74ef87f86f (diff) | |
| download | bcm5719-llvm-b4e77d98ed9ccf8593667220b5bd022853691fad.tar.gz bcm5719-llvm-b4e77d98ed9ccf8593667220b5bd022853691fad.zip | |
Revert "[llvm-dsymutil] Add support for __swift_ast MachO DWARF section"
Breaks aarch64 builders
This reverts commit r315014.
llvm-svn: 315034
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/dsymutil/BinaryHolder.h | 12 | ||||
| -rw-r--r-- | llvm/tools/dsymutil/DebugMap.cpp | 12 | ||||
| -rw-r--r-- | llvm/tools/dsymutil/DebugMap.h | 8 | ||||
| -rw-r--r-- | llvm/tools/dsymutil/DwarfLinker.cpp | 29 | ||||
| -rw-r--r-- | llvm/tools/dsymutil/MachODebugMapParser.cpp | 10 |
5 files changed, 16 insertions, 55 deletions
diff --git a/llvm/tools/dsymutil/BinaryHolder.h b/llvm/tools/dsymutil/BinaryHolder.h index f4ca0b2bc3a..5b2061d23aa 100644 --- a/llvm/tools/dsymutil/BinaryHolder.h +++ b/llvm/tools/dsymutil/BinaryHolder.h @@ -66,12 +66,6 @@ class BinaryHolder { MapArchiveAndGetMemberBuffers(StringRef Filename, sys::TimePoint<std::chrono::seconds> Timestamp); - void changeBackingMemoryBuffer(std::unique_ptr<MemoryBuffer> &&MemBuf); - ErrorOr<const object::ObjectFile &> getObjfileForArch(const Triple &T); - -public: - BinaryHolder(bool Verbose) : Verbose(Verbose) {} - /// Return the MemoryBufferRef that holds the memory mapping for the /// given \p Filename. This function will try to parse archive /// member specifications of the form /path/to/archive.a(member.o). @@ -85,6 +79,12 @@ public: GetMemoryBuffersForFile(StringRef Filename, sys::TimePoint<std::chrono::seconds> Timestamp); + void changeBackingMemoryBuffer(std::unique_ptr<MemoryBuffer> &&MemBuf); + ErrorOr<const object::ObjectFile &> getObjfileForArch(const Triple &T); + +public: + BinaryHolder(bool Verbose) : Verbose(Verbose) {} + /// Get the ObjectFiles designated by the \p Filename. This /// might be an archive member specification of the form /// /path/to/archive.a(member.o). diff --git a/llvm/tools/dsymutil/DebugMap.cpp b/llvm/tools/dsymutil/DebugMap.cpp index 7f205767461..636d65836c6 100644 --- a/llvm/tools/dsymutil/DebugMap.cpp +++ b/llvm/tools/dsymutil/DebugMap.cpp @@ -21,9 +21,8 @@ namespace dsymutil { using namespace llvm::object; DebugMapObject::DebugMapObject(StringRef ObjectFilename, - sys::TimePoint<std::chrono::seconds> Timestamp, - uint8_t Type) - : Filename(ObjectFilename), Timestamp(Timestamp), Type(Type) {} + sys::TimePoint<std::chrono::seconds> Timestamp) + : Filename(ObjectFilename), Timestamp(Timestamp) {} bool DebugMapObject::addSymbol(StringRef Name, Optional<uint64_t> ObjectAddress, uint64_t LinkedAddress, uint32_t Size) { @@ -65,9 +64,8 @@ void DebugMapObject::dump() const { print(errs()); } DebugMapObject & DebugMap::addDebugMapObject(StringRef ObjectFilePath, - sys::TimePoint<std::chrono::seconds> Timestamp, - uint8_t Type) { - Objects.emplace_back(new DebugMapObject(ObjectFilePath, Timestamp, Type)); + sys::TimePoint<std::chrono::seconds> Timestamp) { + Objects.emplace_back(new DebugMapObject(ObjectFilePath, Timestamp)); return *Objects.back(); } @@ -243,7 +241,7 @@ MappingTraits<dsymutil::DebugMapObject>::YamlDMO::denormalize(IO &IO) { } } - dsymutil::DebugMapObject Res(Path, sys::toTimePoint(Timestamp), MachO::N_OSO); + dsymutil::DebugMapObject Res(Path, sys::toTimePoint(Timestamp)); for (auto &Entry : Entries) { auto &Mapping = Entry.second; Optional<uint64_t> ObjAddress; diff --git a/llvm/tools/dsymutil/DebugMap.h b/llvm/tools/dsymutil/DebugMap.h index 0b564149488..eab0cb0a800 100644 --- a/llvm/tools/dsymutil/DebugMap.h +++ b/llvm/tools/dsymutil/DebugMap.h @@ -94,8 +94,7 @@ public: /// debug map. DebugMapObject & addDebugMapObject(StringRef ObjectFilePath, - sys::TimePoint<std::chrono::seconds> Timestamp, - uint8_t Type); + sys::TimePoint<std::chrono::seconds> Timestamp); const Triple &getTriple() const { return BinaryTriple; } @@ -155,8 +154,6 @@ public: return Timestamp; } - uint8_t getType() const { return Type; } - iterator_range<StringMap<SymbolMapping>::const_iterator> symbols() const { return make_range(Symbols.begin(), Symbols.end()); } @@ -169,13 +166,12 @@ private: friend class DebugMap; /// DebugMapObjects can only be constructed by the owning DebugMap. DebugMapObject(StringRef ObjectFilename, - sys::TimePoint<std::chrono::seconds> Timestamp, uint8_t Type); + sys::TimePoint<std::chrono::seconds> Timestamp); std::string Filename; sys::TimePoint<std::chrono::seconds> Timestamp; StringMap<SymbolMapping> Symbols; DenseMap<uint64_t, DebugMapEntry *> AddressToMapping; - uint8_t Type; /// For YAMLIO support. ///@{ diff --git a/llvm/tools/dsymutil/DwarfLinker.cpp b/llvm/tools/dsymutil/DwarfLinker.cpp index be662f49e1a..fba23b6517d 100644 --- a/llvm/tools/dsymutil/DwarfLinker.cpp +++ b/llvm/tools/dsymutil/DwarfLinker.cpp @@ -525,9 +525,6 @@ public: /// Emit the string table described by \p Pool. void emitStrings(const NonRelocatableStringpool &Pool); - /// Emit the swift_ast section stored in \p Buffers. - void emitSwiftAST(const std::vector<MemoryBufferRef> &Buffers); - /// Emit debug_ranges for \p FuncRange by translating the /// original \p Entries. void emitRangesEntries( @@ -711,15 +708,6 @@ void DwarfStreamer::emitStrings(const NonRelocatableStringpool &Pool) { StringRef(Entry->getKey().data(), Entry->getKey().size() + 1)); } -/// Emit the swift_ast section stored in \p Buffers. -void DwarfStreamer::emitSwiftAST(const std::vector<MemoryBufferRef> &Buffers) { - MCSection *SwiftASTSection = MOFI->getDwarfSwiftASTSection(); - SwiftASTSection->setAlignment(1 << 5); - MS->SwitchSection(SwiftASTSection); - for (auto Buf : Buffers) - MS->EmitBytes(Buf.getBuffer()); -} - /// Emit the debug_range section contents for \p FuncRange by /// translating the original \p Entries. The debug_range section /// format is totally trivial, consisting just of pairs of address @@ -3341,8 +3329,8 @@ void DwarfLinker::loadClangModule(StringRef Filename, StringRef ModulePath, else sys::path::append(Path, Filename); BinaryHolder ObjHolder(Options.Verbose); - auto &Obj = ModuleMap.addDebugMapObject( - Path, sys::TimePoint<std::chrono::seconds>(), MachO::N_OSO); + auto &Obj = + ModuleMap.addDebugMapObject(Path, sys::TimePoint<std::chrono::seconds>()); auto ErrOrObj = loadObject(ObjHolder, Obj, ModuleMap); if (!ErrOrObj) { // Try and emit more helpful warnings by applying some heuristics. @@ -3487,19 +3475,6 @@ bool DwarfLinker::link(const DebugMap &Map) { if (Options.Verbose) outs() << "DEBUG MAP OBJECT: " << Obj->getObjectFilename() << "\n"; - - // N_AST objects (swiftmodule files) should get dumped directly into the - // appropriate DWARF section. - if (Obj->getType() == MachO::N_AST) { - auto ErrOrMemBufferRefs = BinHolder.GetMemoryBuffersForFile( - Obj->getObjectFilename(), Obj->getTimestamp()); - if (ErrOrMemBufferRefs.getError()) - continue; - if (!Options.NoOutput) - Streamer->emitSwiftAST(ErrOrMemBufferRefs.get()); - continue; - } - auto ErrOrObj = loadObject(BinHolder, *Obj, Map); if (!ErrOrObj) continue; diff --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp b/llvm/tools/dsymutil/MachODebugMapParser.cpp index 79b19137119..866196fb27e 100644 --- a/llvm/tools/dsymutil/MachODebugMapParser.cpp +++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp @@ -135,8 +135,7 @@ void MachODebugMapParser::switchToNewDebugMapObject( Err.message() + "\n"); } - CurrentDebugMapObject = - &Result->addDebugMapObject(Path, Timestamp, MachO::N_OSO); + CurrentDebugMapObject = &Result->addDebugMapObject(Path, Timestamp); loadCurrentObjectFileSymbols(*ErrOrAchObj); } @@ -350,13 +349,6 @@ void MachODebugMapParser::handleStabSymbolTableEntry(uint32_t StringIndex, if (Type == MachO::N_OSO) return switchToNewDebugMapObject(Name, sys::toTimePoint(Value)); - if (Type == MachO::N_AST) { - SmallString<80> Path(PathPrefix); - sys::path::append(Path, Name); - Result->addDebugMapObject(Path, sys::toTimePoint(Value), Type); - return; - } - // If the last N_OSO object file wasn't found, // CurrentDebugMapObject will be null. Do not update anything // until we find the next valid N_OSO entry. |

