aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI
AgeCommit message (Collapse)AuthorFilesLines
2023-11-17[TextAPI] don't write out empty/zeroed out min os (#72603)Cyndy Ishida1-1/+2
2023-11-15[readtapi] Use OptParser.td for options (#72183)Cyndy Ishida1-4/+7
This includes revamping how --compare was handled and adds `-o` ontop of tablegen approach. This will be used to add more complex options.
2023-11-09[TextAPI] Add error code for invalid input formats (#71824)Cyndy Ishida1-0/+3
2023-11-09[llvm][TextAPI] Add new `not_for_dyld_shared_cache` attribute to file… ↵Cyndy Ishida4-1/+16
(#71735) … format. Formats >= TBDv4 will now encode new attribute that the system static linker wil read when tbd files replace binary dylibs.
2023-10-25[llvm] Followup fix for "Use XMACROS for MachO platforms" (#70140)Juergen Ributzka1-1/+1
Fix the use of tapi_target in getPlatformFromName.
2023-10-20[llvm] Use XMACROS for MachO platforms. (#69262)Juergen Ributzka3-75/+19
This change adds the PLATFORM XMACRO to simplify the addition of new MachO platforms and reduce the number of required changes. Many of the changes needed for adding a new platform are mechanical, such as adding new cases to a switch statement. This will help streamline the process by consolidating much of the necessary information into the MachO.def file.
2023-09-27[NFC] Use const references to avoid copying objects in for-loopsGregory Alfonso1-1/+1
Differential Revision: https://reviews.llvm.org/D139487
2023-09-15[TextAPI] Add missing flag input for <=tbdv3 formatsCyndy Ishida1-2/+2
2023-09-14[TextAPI] Consolidate TextAPI Reader/Writer APIs. (#66108)Cyndy Ishida3-31/+45
Both Swift & LLD use TextAPI reader/writer apis to interface with TBD files. Add doc strings to document what each API does. Also, add shortcut APIs for validating input is a TBD file. This reduces the differences between downstream and how tapi calls into these APIs.
2023-09-07[TextAPI] Support more constructors for PackedVersionsCyndy Ishida1-2/+2
TBD files now record minimum deplyoment versions and tapi interfaces with apple system linker by a packed version encoding. Support mapping between that and `VersionTuple`s.
2023-09-02[llvm] Use range-based for loops (NFC)Kazu Hirata1-2/+2
2023-08-30[llvm][ReadTAPI] Add & fix rpath comparison checksCyndy Ishida2-7/+9
* Check and emit out differences in rpath inputs * Prevent rpaths from being overwritten * Capture file path for tbd-v5
2023-08-11[TextAPI] Express MH_SIM_SUPPORT in tbd files.Cyndy Ishida3-3/+10
This adds a new optional flag sim_support which is the same as MH_SIM_SUPPORT in the MachO header. Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D157433
2023-08-10[llvm] Use DenseMap::lookup (NFC)Kazu Hirata1-4/+1
2023-07-28[TextAPI] Make min-os deployment version optional in tbd-v5.Cyndy Ishida1-8/+7
The minOS version is recorded in tbd-v5 so the linker can report diagnostics when a library and client are misconfigured. Dylibs should always have a minOS recorded, but in was not recorded in previous TBD versions. To accommodate the format transition, treat unrecorded minOS versions as 0. Reviewed By: zixuw Differential Revision: https://reviews.llvm.org/D156487
2023-07-27[TextAPI] Update missing enum cases & utility functionsCyndy Ishida1-1/+1
* Expand understood `FileType`s that InterfaceFile class can represent. * Add `hasTarget` function. * Cleanup symbol `<` comparator to account for SymbolSet operations.
2023-07-25[TextAPI] Add functionality to manipulate over InterfaceFilesCyndy Ishida3-0/+296
InterfaceFile is the in-memory representation for tbd files. Add APIs to merge, extract, remove, and inline reexported libraries. Reviewed By: zixuw Differential Revision: https://reviews.llvm.org/D153398
2023-07-24[TextAPI] Remove TBD file attributes that aren't used anymore.Cyndy Ishida4-53/+9
UUID's & `installapi` flag are no longer useful in recent apple linker/tapi. The reason for removing them is that these are attributes that record how a library was built but not really about the library itself. TBD files now only track information this is important as link time dependencies. Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D149861
2023-07-24[TextAPI] Introduce SymbolSetCyndy Ishida4-41/+41
SymbolSet is a structure that acts as a simple container class for exported symbols that belong to a library interface. It allows tapi to decouple the globals from the other library attributes. It's uniqued by symbol name and `kind`, which all contain their assigned target triples. Reviewed By: zixuw Differential Revision: https://reviews.llvm.org/D149860
2023-07-14Hide some implementation details so they can't cause ODR conflicts. NFC.Benjamin Kramer1-0/+2
2023-06-14[TextAPI] add osx to possible string to platform inputCyndy Ishida1-0/+1
2023-04-01[llvm][TextAPI] only compare deployment version for InterfaceFile.Cyndy Ishida2-0/+9
2023-03-23[llvm][TextAPI] Handle implicitly upgraded deployment versionsCyndy Ishida2-2/+11
Sometimes the clang driver will receive a target triple where the deployment version is too low to support the platform + arch. In those cases, the compiler upgrades the final minOS which is what gets recorded ultimately by the linker in LC_BUILD_VERSION. TextAPI should also reuse this logic for capturing minOS in recorded TBDv5 files. Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D145690
2023-02-26[TextAPI] Use const auto& in foreach loop to avoid pass-by-value static ↵Simon Pilgrim1-2/+2
analyzer warnings. NFCI.
2023-02-22[TextAPI] Add support for TBDv5 Files to nm & tapi-diffCyndy Ishida2-0/+30
This includes handling of new attributes for symbols & rpath. In the event that an older format file is compared to tbd_v5, ignore these new attributes. Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D144529
2023-02-22[llvm][TextAPI] Clean up minor bugs in YAML TextStubCyndy Ishida3-24/+25
* Always print out maccatalyst in format * Traverse symbols via InterfaceFile symbol APIs * Properly track addition of flags. Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D144428
2023-02-22Reland "[TextAPI] Implement TBDv5 Writer"Cyndy Ishida4-1/+313
Create writer for new JSON format. The new JSON format allows practically all attributes to be defined per target in a universal library however the internal representation only allows one for the time being. For now the write will always write those attributes as default available for all targets (install name, compatability & current version, swift abi, flags e.g. flatnamepace & app exenstion safety) rdar://102076911 Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D144339
2023-02-22Revert "[TextAPI] Implement TBDv5 Writer"Cyndy Ishida4-313/+1
This reverts commit 8217932aabcb271df7eb30e069fdace904299cba. Breaks buildbots.
2023-02-22[TextAPI] Implement TBDv5 WriterCyndy Ishida4-1/+313
Create writer for new JSON format. The new JSON format allows practically all attributes to be defined per target in a universal library however the internal representation only allows one for the time being. For now the write will always write those attributes as default available for all targets (install name, compatability & current version, swift abi, flags e.g. flatnamepace & app exenstion safety) rdar://102076911 Reviewed By: ributzka Differential Revision: https://reviews.llvm.org/D144339
2023-02-18[TextAPI] Capture new properties from TBD to InterfaceFileCyndy Ishida3-14/+51
* Deployment Versions for targets * Run Search Paths * Text vs Data Segment attributes to symbols Reviewed By: pete Differential Revision: https://reviews.llvm.org/D144158
2023-02-17Reland "[TextAPI] Implement TBDv5 Reader"Cyndy Ishida5-14/+758
Introduce initial reader for TBDv5 which is in JSON. This captures all the currently understood fields within the internal structure `InterfaceFile`. New fields will be followed up in future PRs. Reviewed By: pete Differential Revision: https://reviews.llvm.org/D144156
2023-02-17Revert "[TextAPI] Implement TBDv5 Reader"Cyndy Ishida5-758/+14
This reverts commit b861b1225380175a5a724e2a677754f5f74e5b0d. This reverts commit 4be17641b05df1e63fa8e069af92676f1246eb83. This patch wont build on some compilers on buildbot.
2023-02-17[TextAPI] wrap returned Errors in std::moveCyndy Ishida1-4/+4
2023-02-17[TextAPI] Implement TBDv5 ReaderCyndy Ishida5-14/+758
[TextAPI] Implement TBDv5 Reader Introduce initial reader for TBDv5 which is in JSON. This captures all the currently understood fields within the internal structure `InterfaceFile`. New fields & follow up tests will be followed up in future PRs. Reviewed By: pete Differential Revision: https://reviews.llvm.org/D144156
2023-02-07[NFC][TargetParser] Remove llvm/ADT/Triple.hArchibald Elliott2-3/+3
I also ran `git clang-format` to get the headers in the right order for the new location, which has changed the order of other headers in two files.
2022-12-20[Support] Move TargetParsers to new componentArchibald Elliott1-0/+1
This is a fairly large changeset, but it can be broken into a few pieces: - `llvm/Support/*TargetParser*` are all moved from the LLVM Support component into a new LLVM Component called "TargetParser". This potentially enables using tablegen to maintain this information, as is shown in https://reviews.llvm.org/D137517. This cannot currently be done, as llvm-tblgen relies on LLVM's Support component. - This also moves two files from Support which use and depend on information in the TargetParser: - `llvm/Support/Host.{h,cpp}` which contains functions for inspecting the current Host machine for info about it, primarily to support getting the host triple, but also for `-mcpu=native` support in e.g. Clang. This is fairly tightly intertwined with the information in `X86TargetParser.h`, so keeping them in the same component makes sense. - `llvm/ADT/Triple.h` and `llvm/Support/Triple.cpp`, which contains the target triple parser and representation. This is very intertwined with the Arm target parser, because the arm architecture version appears in canonical triples on arm platforms. - I moved the relevant unittests to their own directory. And so, we end up with a single component that has all the information about the following, which to me seems like a unified component: - Triples that LLVM Knows about - Architecture names and CPUs that LLVM knows about - CPU detection logic for LLVM Given this, I have also moved `RISCVISAInfo.h` into this component, as it seems to me to be part of that same set of functionality. If you get link errors in your components after this patch, you likely need to add TargetParser into LLVM_LINK_COMPONENTS in CMake. Differential Revision: https://reviews.llvm.org/D137838
2022-09-19[llvm][TextAPI] add driverkit as supported platform for older tbdCyndy Ishida1-0/+1
versions It looks like being able to write it was added, but missed the ability to read it.
2022-08-08[llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFCFangrui Song1-3/+3
With C++17 there is no Clang pedantic warning or MSVC C5051.
2022-01-26Cleanup LLVMTextAPI headersserge-sans-paille4-8/+9
Based on the output of iwyu. A full rebuild of llvm-project doesn't exhibit any significant false dependencies. The impact on preprocessed output is larger than expected, given the small amount of changes $ clang++ -E -Iinclude -I../llvm/include ../llvm/lib/TextAPI/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l before: 635319 After: 643716 Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup
2022-01-13Fix MSVC "not all control paths return a value" warnings. NFC.Simon Pilgrim1-0/+2
2022-01-13Replace PlatformKind with PlatformType.Juergen Ributzka4-115/+109
The PlatformKind/PlatformType enums contain the same information, which requires them to be kept in-sync. This commit changes over to PlatformType as the sole source of truth, which allows the removal of the redundant PlatformKind. The majority of the changes were in LLD and TextAPI. Reviewed By: cishida Differential Revision: https://reviews.llvm.org/D117163
2021-09-16[llvm] Use drop_begin (NFC)Kazu Hirata1-2/+2
2021-06-09Reland "[llvm] llvm-tapi-diff"Sam Powell2-0/+35
This is relanding commit d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096 . This patch additionally addresses failures found in buildbots due to unstable build ordering & post review comments. This patch introduces a new tool, llvm-tapi-diff, that compares and returns the diff of two TBD files. Reviewed By: ributzka, JDevlieghere Differential Revision: https://reviews.llvm.org/D101835
2021-06-09Revert "Reland "[llvm] llvm-tapi-diff""Cyndy Ishida2-35/+0
This reverts commit 20126c9fd4afe2fe11510becccaa769332da302f. The sorting fixes failed to have stable output on different platforms.
2021-06-09Reland "[llvm] llvm-tapi-diff"Sam Powell2-0/+35
This is relanding commit d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096 . This patch additionally addresses failures found in buildbots & post review comments. This patch introduces a new tool, llvm-tapi-diff, that compares and returns the diff of two TBD files. Reviewed By: ributzka, JDevlieghere Differential Revision: https://reviews.llvm.org/D101835
2021-06-03Revert "[llvm] llvm-tapi-diff"Cyndy Ishida2-35/+0
This reverts commit d1d36f7ad2ae82bea8a6fcc40d6c42a72e21f096. Reverting this patch to investigate linux bot failures + fix with author offline
2021-06-03[llvm] llvm-tapi-diffSam Powell2-0/+35
This patch introduces a new tool, llvm-tapi-diff, that compares and returns the diff of two TBD files. Reviewed By: ributzka, JDevlieghere Differential Revision: https://reviews.llvm.org/D101835
2021-05-11[TextAPI] Reformat llvm_unreachable messageSam Powell1-2/+2
Change llvm_unreachable message from "Unknown llvm.MachO.PlatformKind enum" to "Unknown llvm::MachO::PlatformKind enum". Differential revision: https://reviews.llvm.org/D102250
2021-05-06[llvm][TextAPI] add mapping from OS string to PlatformCyndy Ishida1-0/+16
* add utility for matching target triple OS value strings to PlatformKind This was reviewed offline by ributzka, steven_wu
2021-04-05[TextAPI] move source code files out of subdirectory, NFCCyndy Ishida12-37/+35
TextAPI/ELF has moved out into InterfaceStubs, so theres no longer a need to seperate out TextAPI between formats. Reviewed By: ributzka, int3, #lld-macho Differential Revision: https://reviews.llvm.org/D99811