diff options
author | Cyndy Ishida <cyndy_ishida@apple.com> | 2023-12-20 08:47:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-20 08:47:10 -0800 |
commit | 5ea15fab19eb005c6032ea453c7a01ae32269336 (patch) | |
tree | cb886ce71496c46e52dba158137169baab0f9a2a /llvm/lib/TextAPI/BinaryReader/DylibReader.cpp | |
parent | 8bbeed05c4da832a2abf532fee8665c0d6576cbc (diff) | |
download | llvm-5ea15fab19eb005c6032ea453c7a01ae32269336.zip llvm-5ea15fab19eb005c6032ea453c7a01ae32269336.tar.gz llvm-5ea15fab19eb005c6032ea453c7a01ae32269336.tar.bz2 |
[TextAPI] Add support to convert RecordSlices -> InterfaceFile (#75007)
Introduce RecordVisitor. This is used for different clients that want to
extract information out of RecordSlice types.
The first and immediate use case is for serializing symbol information
into TBD files.
Diffstat (limited to 'llvm/lib/TextAPI/BinaryReader/DylibReader.cpp')
-rw-r--r-- | llvm/lib/TextAPI/BinaryReader/DylibReader.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp b/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp index b01130c..40b57b5 100644 --- a/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp +++ b/llvm/lib/TextAPI/BinaryReader/DylibReader.cpp @@ -417,3 +417,13 @@ Expected<Records> DylibReader::readFile(MemoryBufferRef Buffer, return make_error<TextAPIError>(TextAPIErrorCode::EmptyResults); return Results; } + +Expected<std::unique_ptr<InterfaceFile>> +DylibReader::get(MemoryBufferRef Buffer) { + ParseOption Options; + auto SlicesOrErr = readFile(Buffer, Options); + if (!SlicesOrErr) + return SlicesOrErr.takeError(); + + return convertToInterfaceFile(*SlicesOrErr); +} |