diff --git a/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp b/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp index 40b57b5e40ea33..25b9499d189577 100644 --- a/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp +++ b/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp @@ -408,6 +408,7 @@ Expected DylibReader::readFile(MemoryBufferRef Buffer, Results.emplace_back(std::make_shared(RecordsSlice({T}))); if (auto Err = load(&Obj, *Results.back(), Opt, Arch)) return std::move(Err); + Results.back()->getBinaryAttrs().Path = Buffer.getBufferIdentifier(); } break; } diff --git a/llvm/tools/llvm-readtapi/llvm-readtapi.cpp b/llvm/tools/llvm-readtapi/llvm-readtapi.cpp index 5944b1cd1f5910..80064ed9848517 100644 --- a/llvm/tools/llvm-readtapi/llvm-readtapi.cpp +++ b/llvm/tools/llvm-readtapi/llvm-readtapi.cpp @@ -199,6 +199,7 @@ static void stubifyImpl(std::unique_ptr IF, Context &Ctx) { // TODO: Add inlining and magic merge support. if (Ctx.OutStream == nullptr) { std::error_code EC; + assert(!IF->getPath().empty() && "Unknown output location"); SmallString OutputLoc = IF->getPath(); replace_extension(OutputLoc, ".tbd"); Ctx.OutStream = std::make_unique(OutputLoc, EC);