aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI
AgeCommit message (Collapse)AuthorFilesLines
2025-08-06[TextAPI] Seperate out Arch name from enum label, NFCI (#152332)Cyndy Ishida2-7/+7
The enum label e.g. `AK_arm64` is often the same as the architecture name, but doesn't have to be. Seperate it out.
2025-07-26[TextAPI] Fix memory leak in SymbolSet. (#150589)Lang Hames1-0/+5
The SymbolSet class bump-ptr-allocates Symbol objects, but Symbol has a non-trivial destructor (since Symbol's Targets member is a SmallVector): we need to explicitly destroy the Symbol objects to ensure that no memory is leaked. rdar://154778728
2025-07-14[TextAPI] print symbols in a stable order in v5 format (#148687)Cyndy Ishida1-0/+6
resolves: rdar://151765704
2025-06-10[TextAPI] Use MapVector::try_emplace (NFC) (#143564)Kazu Hirata1-1/+1
- try_emplace(Key) is shorter than insert({Key, nullptr}). - try_emplace performs value initialization without value parameters. - We overwrite values on successful insertion anyway.
2025-06-10[clang][Darwin] Align all OS Versions for 26 (#143548)Cyndy Ishida1-1/+3
* Translate the following versions to 26. * watchOS 12 -> 26 * visionOS 3 -> 26 * macos 16 -> 26 * iOS 19 -> 26 * tvOS 19 -> 26 * Emit diagnostics, but allow conversion when clients attempt to use invalid gaps in OS versioning in availability. * For target-triples, only allow "valid" versions for implicit conversions.
2025-06-04[llvm] Remove unused includes (NFC) (#142733)Kazu Hirata3-4/+0
These are identified by misc-include-cleaner. I've filtered out those that break builds. Also, I'm staying away from llvm-config.h, config.h, and Compiler.h, which likely cause platform- or compiler-specific build failures.
2025-05-26[llvm] Value-initialize values with *Map::try_emplace (NFC) (#141522)Kazu Hirata1-4/+3
try_emplace value-initializes values, so we do not need to pass nullptr to try_emplace when the value types are raw pointers or std::unique_ptr<T>.
2025-05-16[TextAPI] Use llvm::replace (NFC) (#140201)Kazu Hirata1-2/+1
2025-03-18[TextAPI] Track RPaths in the order its provided via command line. (#131665)Cyndy Ishida2-14/+57
RPaths are basically search paths for how to load dependent libraries. The order they appear is the order the linker will search, we should preserve that order in tbd files. * Additionally add this level of detection to llvm-readtapi. resolves: rdar://145603347
2024-11-19[TextAPI] Add missing attribute to remove/merge/extract operations (#116729)Cyndy Ishida1-0/+5
2024-11-15[Clang][Darwin] Introduce `SubFrameworks` as a SDK default location (#115048)Cyndy Ishida1-0/+3
* Have clang always append & pass System/Library/SubFrameworks when determining default sdk search paths. * Teach clang-installapi to traverse there for framework input. * Teach llvm-readtapi that the library files (TBD or binary) in there should be considered private. resolves: rdar://137457006
2024-08-14[TextAPI] Use range-based for loops (NFC) (#103530)Kazu Hirata1-4/+6
2024-08-05[TextAPI] Add an assertion for adding duplicate libraries into a single TBD ↵Cyndy Ishida1-0/+3
file (#101744) This would lead to a malformed TBD file.
2024-06-13[llvm-project] Fix typo "seperate" (#95373)Jay Foad1-1/+1
2024-05-19[llvm] Use StringRef::contains (NFC) (#92710)Kazu Hirata1-1/+1
2024-05-10[InstallAPI] Support mutually exclusive parse options (#90686)Cyndy Ishida1-0/+10
Projects like libc use mutually exclusive macros to compile files multiple times and then merge the result into the final library. For installapi to accept these, we'd need to parse the same declarations in different ways. This patch adds the basic pipelining for installapi to create the correct TBD file. * -Xproject allows: -fmodules, -fobjc-arc, fvisibility=hidden, prefix headers * -Xlabel allows: -D and -U settings * Error on 'private' and 'public' labels -X<label> * Xplatform allows: -iframework <path> This is to support the case where zippered frameworks want to pass in iOSSupport search path.
2024-04-19[LLVM][TextAPI] Refactor Redundant Condition (#86542)Troy Butler1-2/+2
Fixes #83241 --------- Signed-off-by: Troy-Butler <squintik@outlook.com> Co-authored-by: Troy-Butler <squintik@outlook.com>
2024-04-18[InstallAPI] Add support for aliased exports (#88750)Cyndy Ishida1-0/+34
Apple's ld supports alias_lists, described as ``` -alias_list filename The specified filename contains a list of aliases. The symbol name and its alias are on one line, separated by whitespace. Lines starting with # are ignored. ``` To handle this for installapi-produced TBD files, pass along the same input and account for it in verification.
2024-04-14[TextAPI] Apply NFC code fixups (#88639)Cyndy Ishida1-1/+1
* Remove unnecessary cast * Annotate `#endif`
2024-04-04[TextAPI] Reorder addRPath parameters (#87601)Cyndy Ishida2-5/+5
It matches up with other _attribute_ adding member functions and helps simplify InterfaceFile assignment for InstallAPI.
2024-03-29[InstallAPI] Add support for parsing dSYMs (#86852)Cyndy Ishida2-1/+111
InstallAPI does not directly look at object files in the dylib for verification. To help diagnose violations where a declaration is undiscovered in headers, parse the dSYM and look up the source location for symbols. Emitting out the source location with a diagnostic is enough for some IDE's (e.g. Xcode) to have them map back to editable source files.
2024-03-25Reapply "[InstallAPI] Add --extra* and --exclude* cli options for header ↵Cyndy Ishida1-0/+46
input (#86522)" (#86574)
2024-03-25Revert "[InstallAPI] Add --extra* and --exclude* cli options for header ↵Cyndy Ishida1-46/+0
input (#86522)" This reverts commit b7d8c6188986f62573b9516fe27fdd0c7df1aaf9. And This reverts commit 2d40f179124f874aca4cf1145fdbc42fb8fb17f3. It caused a build failure i'll need to reproduce. ` error: could not convert ‘Rule’ from ‘llvm::Regex’ to ‘llvm::Expected<llvm::Regex>’`
2024-03-25[TextAPI] Add missing include for Expected typeCyndy Ishida1-2/+2
2024-03-25[InstallAPI] Add --extra* and --exclude* cli options for header input (#86522)Cyndy Ishida1-0/+46
InstallAPI takes a json list of headers that is typically generated from a build system like Xcode based on a project's attributes. Sometimes, maintainers may want to alter this for tapi input. Using e.g. `--extra-public-headers`, users can manipulate what headers will be used for TBD file generation.
2024-03-21[InstallAPI] Report exports discovered in binary but not in interface (#86025)Cyndy Ishida1-2/+5
This patch completes the classes of errors installapi can detect.
2024-03-16[InstallAPI] Add installapi specific options & diagnostics (#85100)Cyndy Ishida1-4/+4
* A lot of `tapi installapi` options are already shared with clang, but not all. This patch handles installapi-specific options by filtering for them in the initial argv input, then passing the rest to the clang driver. * Installapi not only generates a text file but also reports to library developers when there are inconsistencies between an interface and its implementation. To allow this, add support for reporting installapi diagnostics. This will be leveraged in the verifier service.
2024-03-07[InstallAPI] Collect global functions (#83952)Cyndy Ishida1-3/+3
* Include whether functions are inlinable as they impact whether to add them into the tbd file and for future verification. * Fix how clang arguments got passed along, previously spacing was passed along to CC1 causing search path inputs to look non-existent.
2024-03-05[TextAPI] add missing platforms for translating triples to tapi targetsCyndy Ishida1-1/+7
2024-03-04[InstallAPI] Collect symbols from ObjC Ivars (#83632)Cyndy Ishida1-0/+1
2024-02-29[TextAPI] Fixup symbol names of ivars from extensions (#83525)Cyndy Ishida1-1/+1
2024-02-12[TextAPI] Refactor BinaryAttrs to InterfaceFile assignment (#81551)Cyndy Ishida5-24/+34
Create a helper method for this operation, so it can be reused in multiple places. Additonally move FileType enum into its own header to avoid include cycles.
2024-02-06[readtapi] Ensure universal dylibs record the same input path location ↵Cyndy Ishida1-0/+1
across slices (#80875) resolves: https://github.com/llvm/llvm-project/issues/80868
2024-02-03[readtapi] Add support for stubify-ing directories (#76885)Cyndy Ishida1-0/+114
When given a directory input `llvm-readtapi` traverses through the directory to find dylibs or tbd files to operate on. TBD files will be created with the same base file name as the dylib. Symlinks should be created if the input is one. This also introduces options to delete input files which are defined as library files that existed before `readtapi -stubify` was invoked. Also the ability to delete private libraries where private libraries are in a predefined file system locations on darwin based platforms.
2024-01-29[TextAPI] Introduce granularity for handling ObjC Interface symbols (#79928)Cyndy Ishida4-36/+106
ObjCInterfaceRecords roughly align to the objc-classes key in tbd-files. They condensely represent up to 3 symbols. The problem here is that when represented this way, we lose granularity when these symbols could have different linkages or outright don't exist. This can happen frequently in interoptable code generated by the swift compiler. This adds fields and utility functions to express unique properties for these symbols. If the record does represent the same properties across all of its symbols, it will be treated the same in the TBD. Otherwise it will be printed in global's section. Reviewed seperately before by Juergen Ributzka
2024-01-26[TextAPI] Rename SymbolKind to EncodeKind (#79622)Cyndy Ishida6-63/+63
A distinction that doesn't _usually_ matter is that the MachO::SymbolKind is really a mapping of entries in TBD files not symbols. To better understand this, rename the enum so it represents an encoding mapped to TBDs as opposed to symbols alone. For example, it can be a bit confusing that "GlobalSymbol" is a enum value when all of those values can represent a GlobalSymbol.
2024-01-16[llvm] Introduce XROS platform (#77707)Cyndy Ishida1-0/+4
Accepts but otherwise ignores visionOS/XROS target triples as Darwin based platform. https://developer.apple.com/documentation/visionos
2024-01-13[llvm] Use range-based for loops with llvm::drop_begin (NFC)Kazu Hirata1-3/+2
2024-01-09[TextAPI] Skip adding empty attributes (#77400)Cyndy Ishida1-0/+8
An empty string attribute value (e.g. a parent-umbrella: "") is equivalent to omitting it. Theres no reason to write it out.
2024-01-02[TextAPI] Use function_ref where possible, NFCI (#76732)Cyndy Ishida1-3/+4
2023-12-20[readtapi] Setup simple stubify support (#76075)Cyndy Ishida2-0/+41
Stubify broadly takes either tbd files or binary dylibs and turns them into tbd files. In future patches, stubify will also allow additional information to be embedded into the final TBD output too. Add Util APIs to TextAPI for common operations used by readtapi for now.
2023-12-20[TextAPI] Add support to convert RecordSlices -> InterfaceFile (#75007)Cyndy Ishida4-2/+194
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.
2023-12-19[TextAPI] use unique sorted vector for holding target triples for (#75959)Cyndy Ishida1-18/+31
reading dylibs * This is a better fix than what I originally did to appease CI.
2023-12-18[TextAPI] switch container for holding triples in dylibCyndy Ishida1-25/+21
Resolves buildbot failure reported on windows bot
2023-12-18Reland '[TextAPI] Add DylibReader' (#75862)Cyndy Ishida3-0/+421
> Add support for reading binary Mach-o dynamic libraries. It uses libObject APIs for extracting information relevant to TAPI and tbd files. This includes but is not limited to load commands encode data like install names, current/compat versions, and symbols. This originally broke because DylibReader uses Object and Object depends on TextAPI. Breaking this up in a nested library prevents this cycle.
2023-12-12Revert "[TextAPI] Add missing link to libObject" and "[TextAPI] Add ↵Cyndy Ishida2-412/+0
DylibReader (#75006)" This reverts commit aa217eb04459039b5ff18b6b134020ed0248a241. This reverts commit 634feddc84bfd402fc916d331627528c41346d8c. This breaks buildbots by introducing cycle dependency between libObject and TextAPI and breaks gcc compiles on buildbots.
2023-12-12[TextAPI] Add missing link to libObjectCyndy Ishida1-0/+1
* Reported in buildbot failures
2023-12-12[TextAPI] Add DylibReader (#75006)Cyndy Ishida2-0/+411
Add support for reading binary Mach-o dynamic libraries. It uses libObject APIs for extracting information relavant to TAPI and tbd files. This includes but is not limited to load commands encode data like install names, current/compat versions and symbols.
2023-12-11[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)Kazu Hirata3-15/+15
This patch replaces uses of StringRef::{starts,ends}with with StringRef::{starts,ends}_with for consistency with std::{string,string_view}::{starts,ends}_with in C++20. I'm planning to deprecate and eventually remove StringRef::{starts,ends}with.
2023-12-02[TextAPI] Introduce Records & RecordSlice Types (#74115)Cyndy Ishida3-0/+251
`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.