summaryrefslogtreecommitdiff
path: root/clang/test/InstallAPI
AgeCommit message (Collapse)Author
2025-10-10[clang-installapi] Add test for -Xproject -fvisibility=* (#162908)Cyndy Ishida
2025-04-03[clang][modules] Determine if the SDK supports builtin modules independent ↵Ian Anderson
of the target (#134005) Whether the SDK supports builtin modules is a property of the SDK itself, and really has nothing to do with the target. This was already worked around for Mac Catalyst, but there are some other more esoteric non-obvious target-to-sdk mappings that aren't handled. Have the SDK parse its OS out of CanonicalName and use that instead of the target to determine if builtin modules are supported.
2024-07-25[InstallAPI] Fix early return for scanning sub-directories (#100636)Cyndy Ishida
2024-07-19Fix diagnostics-dsym.test on mac-arm64 (#99399)Haowei
The check ordering of diagnostics-dsym.test is wrong and it causes test failure when running on mac-arm64 machine. This patch fixes it.
2024-07-10[InstallAPI] Don't look for linker directive symbols in reexports (#98171)Cyndy Ishida
`$ld$previous` symbols need to be exported for them to be seen by clients. TAPI cannot omit them in tbd files, so account for this in installapi verification when handling reexport verification. Reviewed internally by Zixu Wang resolves: rdar://131317591
2024-06-14[InstallAPI] Pick up input headers by directory traversal (#94508)Cyndy Ishida
Match TAPI behavior and allow input headers to be resolved via a passed directory, which is expected to be a library sitting in a build directory.
2024-05-23Fix more diagnostic wording for style; NFC (#93190)Aaron Ballman
This tries to fix all of the places where a diagnostic message starts with a capital letter (other than acroynyms or proper nouns) or ends with punctuation (other than a question mark). This is in support of a planned change to tablegen to start diagnosing incorrect diagnostic message styles.
2024-05-20[InstallAPI] add JSON option to pass X<label> arguments (#91770)Cyndy Ishida
2024-05-10[InstallAPI] Pass explicit module cache to avoid permissions issues.Cyndy Ishida
Fixes: https://lab.llvm.org/buildbot/#/builders/192/builds/9313
2024-05-10[InstallAPI] Support mutually exclusive parse options (#90686)Cyndy Ishida
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-18[InstallAPI][Tests] Update tests to be resilient to reversion iteration ↵Cyndy Ishida
config (#89270)
2024-04-18[InstallAPI] Add support for aliased exports (#88750)Cyndy Ishida
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-11[InstallAPI] Handle zippered frameworks (#88205)Cyndy Ishida
A zippered framework is a single framework that can be loaded in both macOS and macatalyst processes. Broadly to InstallAPI, it means the same interface can represent two separate platforms. A dylib's symbol table does not distinguish between macOS/macCatalyst. `InstallAPI` provides the ability for the tbd file to distinct symbols between them. The verifier handles this special logic by tracking all unavailable and obsoleted APIs in this context and checking against those when determining dylib symbols with no matching declaration. * If there exists an available decl for either platform, do not warn. * If there is no available decl, emit a diagnostic and print the source location for both decls.
2024-04-05[InstallAPI] Capture & compare load commands that may differ per arch slice ↵Cyndy Ishida
(#87674) * Capture reexported libraries, allowable clients, rpaths, shared cache eligibility. * Add support for select Xarch options. * Add diagnostics related to capturing these options. * Add support for verifying these attributes against what is encoded in the dylib.
2024-04-04[InstallAPI] Add test to validate cc1 arg forwarding (#87666)Cyndy Ishida
2024-04-04[InstallAPI][Test] Add test for invalid verification mode (#87602)Cyndy Ishida
2024-04-01[InstallAPI] Fixup dsym test (#87299)Cyndy Ishida
Update the test to run when the compiler is built to support arm64-darwin targets.
2024-03-29[InstallAPI][test] Add requires x86_64 for hardcoded target testCyndy Ishida
2024-03-29[InstallAPI][test] Tweak test to run on older CI configCyndy Ishida
2024-03-29[InstallAPI] Add support for parsing dSYMs (#86852)Cyndy Ishida
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-27[InstallAPI] Add *umbrella-header options (#86587)Cyndy Ishida
Umbrella headers are a concept for Darwin-based libraries. They allow framework authors to control the order in which their headers should be parsed and allow clients to access available headers by including a single header. InstallAPI will attempt to find the umbrella based on the name of the framework. Users can also specify this explicitly by using command line options specifying the umbrella header by file path. There can be an umbrella header per access level.
2024-03-25Reapply "[InstallAPI] Add --extra* and --exclude* cli options for header ↵Cyndy Ishida
input (#86522)" (#86574)
2024-03-25Revert "[InstallAPI] Add --extra* and --exclude* cli options for header ↵Cyndy Ishida
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[InstallAPI] Add --extra* and --exclude* cli options for header input (#86522)Cyndy Ishida
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 Ishida
This patch completes the classes of errors installapi can detect.
2024-03-20[InstallAPI] Simplify & improve symbol printing for diagnostics (#85894)Cyndy Ishida
* Defer mangling of symbols until an error is ready to report * Pass around fewer parameters when reporting
2024-03-19[InstallAPI] Verify that declarations in headers map to exports found in ↵Cyndy Ishida
dylib (#85348) * This completes support for verifying every declaration found in a header is discovered in the dylib. Diagnostics are reported for each class for differences that are representable in TBD files. * This patch also now captures unavailable attributes that depend on target triples. This is needed for proper tbd file generation.
2024-03-16[InstallAPI] Introduce Basic Verifier (#85106)Cyndy Ishida
This adds basic support for calling the verifier on global declarations that are expected to represent symbol exports. The driver now exclusively uses this for knowing what symbols make up a TBD file. Future patches will check against the dylib's symbol table.
2024-03-16[InstallAPI] Add installapi specific options & diagnostics (#85100)Cyndy Ishida
* 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-14[InstallAPI] capture compatibility versions (#85261)Cyndy Ishida
2024-03-11[InstallAPI] Collect C++ Decls (#84403)Cyndy Ishida
This includes capturing symbols for global variables, functions, classes, and templated defintions. As pre-determing what symbols are generated from C++ declarations can be non-trivial, InstallAPI only parses select declarations for symbol generation when parsing c++. For example, installapi only looks at explicit template instantiations or full template specializations, instead of general function or class templates, for symbol emittion.
2024-03-07[InstallAPI] Collect global functions (#83952)Cyndy Ishida
* 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-04[InstallAPI] Collect symbols from ObjC Ivars (#83632)Cyndy Ishida
2024-03-01[InstallAPI] Collect frontend attributes & ObjCInterface decls (#83378)Cyndy Ishida
* This patch introduces a container class, for holding records and attributes only collectible from the clang frontend, which is a subclass of `llvm::MachO::RecordsSlice` * This also prunes out collecting declarations from headers that aren't considered input to installapi. * Uses these constructs for collecting global objective-c interfaces.
2024-02-28[InstallAPI] Hookup Input files & basic ASTVisitor (#82552)Cyndy Ishida
This patch takes in json files as input to determine that header files to process, and in which order, to pass along for CC1 invocations. This patch also includes an ASTVisitor to collect simple global variables.
2024-02-22[clang] Rename installapi tests, NFCCyndy Ishida
* Reduces redundancy
2024-02-21[InstallAPI] Set InstallAPI as a standalone tool instead of CC1 action (#82293)Cyndy Ishida
Installapi has important distinctions when compared to the clang driver, so much that, it doesn't make much sense to try to integrate into it. This patch partially reverts the CC1 action & driver support to replace with its own driver as a clang tool. For distribution, we could use `LLVM_TOOL_LLVM_DRIVER_BUILD` mechanism for integrating the functionality into clang such that the toolchain size is less impacted.
2024-02-13 [clang][InstallAPI] Introduce basic driver to write out tbd files (#81571)Cyndy Ishida
This introduces a basic outline of installapi as a clang driver option. It captures relevant information as cc1 args, which are common arguments already passed to the linker to encode into TBD file outputs. This is effectively an upstream for what already exists as `tapi installapi` in Xcode toolchains, but directly in Clang. This patch does not handle any AST traversing on input yet. InstallAPI is broadly an operation that takes a series of header files that represent a single dynamic library and generates a TBD file out of it which represents all the linkable symbols and necessary attributes for statically linking in clients. It is the linkable object in all Apple SDKs and when building dylibs in Xcode. `clang -installapi` also will support verification where it compares all the information recorded for the TBD files against the already built binary, to catch possible mismatches like when a declaration is missing a definition for an exported symbol.