Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextAPI] Introduce Records & RecordSlice Types #74115

Merged
merged 2 commits into from
Dec 2, 2023

Conversation

cyndyishida
Copy link
Member

Record's hold target triple specific information about APIs and symbols. This holds information about the relationship between ObjC symbols and their linkage properties. It will be used to compare and run significant operations between the frontend representation of symbols in AST and symbol information extracted from Mach-O binaries. This differs from the lighter weight Symbol and SymbolSet class where they are deduplicated across targets and only represent exported symbols, that class is mostly used for serializing.

@cyndyishida cyndyishida force-pushed the eng/PR-tapi-api-records branch 2 times, most recently from 1aad4f5 to 919a120 Compare December 1, 2023 17:55
llvm/include/llvm/TextAPI/Record.h Outdated Show resolved Hide resolved
llvm/include/llvm/TextAPI/RecordsSlice.h Show resolved Hide resolved
llvm/lib/TextAPI/RecordsSlice.cpp Outdated Show resolved Hide resolved
llvm/include/llvm/TextAPI/RecordsSlice.h Show resolved Hide resolved
Copy link
Collaborator

@ributzka ributzka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you Cyndy

StringRef ParentUmbrella;
StringRef InstallName;
StringRef UUID;
StringRef Path;
FileType fileType = FileType::Invalid;
llvm::MachO::PackedVersion CurrentVersion;
llvm::MachO::PackedVersion CompatVersion;
uint8_t SwiftABI = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is SwiftABI still used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, the linker continues to check it. I imagine since abi stability the value is always 7 though. We chatted about this a while back with @cooperp, but the details are slipping my mind.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, the linker still enforces that the Swift ABI matches in all object files. Thats logic we needed back when changing the ABI happened each release. Its still there, but just never finds a mismatch.

If the Swift team did ever need to bump this version then the linker will be there to complain if it goes wrong :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the check/requirement just object files or also dylibs that link into the final linked image?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like dylibs too yeah. ld64 gets the swift version from used dylibs, tbds and object files, and makes sure they all match

`Record`'s hold target triple specific information about APIs and symbols. This holds information about the relationship between ObjC symbols and their linkage properties. It will be used to compare and run significant operations between the frontend representation of symbols in AST and symbol information extracted from Mach-O binaries.
This differs from the lighter weight Symbol and SymbolSet class where they are deduplicated across targets and only represent exported symbols, that class is mostly used for serializing.
@cyndyishida cyndyishida merged commit b04b897 into llvm:main Dec 2, 2023
3 checks passed
cyndyishida added a commit to cyndyishida/llvm-project that referenced this pull request Jan 4, 2024
`Record`'s hold target triple specific information about APIs and
symbols. This holds information about the relationship between ObjC
symbols and their linkage properties. It will be used to compare and run
significant operations between the frontend representation of symbols in
AST and symbol information extracted from Mach-O binaries. This differs
from the lighter weight Symbol and SymbolSet class where they are
deduplicated across targets and only represent exported symbols, that
class is mostly used for serializing.

(cherry picked from commit b04b897)
cyndyishida added a commit to apple/llvm-project that referenced this pull request Jan 5, 2024
`Record`'s hold target triple specific information about APIs and
symbols. This holds information about the relationship between ObjC
symbols and their linkage properties. It will be used to compare and run
significant operations between the frontend representation of symbols in
AST and symbol information extracted from Mach-O binaries. This differs
from the lighter weight Symbol and SymbolSet class where they are
deduplicated across targets and only represent exported symbols, that
class is mostly used for serializing.

(cherry picked from commit b04b897)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants