Skip to content

Commit

Permalink
[readtapi] Ensure universal dylibs record the same input path locatio…
Browse files Browse the repository at this point in the history
…n across slices (llvm#80875)

resolves: llvm#80868
  • Loading branch information
cyndyishida authored Feb 6, 2024
1 parent 1833de3 commit 6eb7273
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions llvm/lib/TextAPI/BinaryReader/DylibReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ Expected<Records> DylibReader::readFile(MemoryBufferRef Buffer,
Results.emplace_back(std::make_shared<RecordsSlice>(RecordsSlice({T})));
if (auto Err = load(&Obj, *Results.back(), Opt, Arch))
return std::move(Err);
Results.back()->getBinaryAttrs().Path = Buffer.getBufferIdentifier();
}
break;
}
Expand Down
1 change: 1 addition & 0 deletions llvm/tools/llvm-readtapi/llvm-readtapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ static void stubifyImpl(std::unique_ptr<InterfaceFile> 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<PATH_MAX> OutputLoc = IF->getPath();
replace_extension(OutputLoc, ".tbd");
Ctx.OutStream = std::make_unique<llvm::raw_fd_stream>(OutputLoc, EC);
Expand Down

0 comments on commit 6eb7273

Please sign in to comment.