Skip to content

Commit 6eb7273

Browse files
authored
[readtapi] Ensure universal dylibs record the same input path location across slices (#80875)
resolves: #80868
1 parent 1833de3 commit 6eb7273

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

llvm/lib/TextAPI/BinaryReader/DylibReader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ Expected<Records> DylibReader::readFile(MemoryBufferRef Buffer,
408408
Results.emplace_back(std::make_shared<RecordsSlice>(RecordsSlice({T})));
409409
if (auto Err = load(&Obj, *Results.back(), Opt, Arch))
410410
return std::move(Err);
411+
Results.back()->getBinaryAttrs().Path = Buffer.getBufferIdentifier();
411412
}
412413
break;
413414
}

llvm/tools/llvm-readtapi/llvm-readtapi.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ static void stubifyImpl(std::unique_ptr<InterfaceFile> IF, Context &Ctx) {
199199
// TODO: Add inlining and magic merge support.
200200
if (Ctx.OutStream == nullptr) {
201201
std::error_code EC;
202+
assert(!IF->getPath().empty() && "Unknown output location");
202203
SmallString<PATH_MAX> OutputLoc = IF->getPath();
203204
replace_extension(OutputLoc, ".tbd");
204205
Ctx.OutStream = std::make_unique<llvm::raw_fd_stream>(OutputLoc, EC);

0 commit comments

Comments
 (0)