aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI
AgeCommit message (Collapse)AuthorFilesLines
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
2021-04-02[TextAPI] run clang-format on violating sections, NFCCyndy Ishida2-32/+32
2021-03-02[lld-macho] Change loadReexport to handle the case where a TAPI re-exports ↵Vy Nguyen1-0/+1
to reference documents nested within other TBD. Currently, it was delibrately impleneted to not handle this case, but as it has turnt out, we need this feature. The concrete use case is `System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa` reexports /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit , which then rexports /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation The current implemention uses a global currentTopLevelTapi, which is not reset until it finishes loading the whole tree. This is a problem because if the top-level is set to Cocoa, then when we get to UIFoundation, it will try to find UIFoundation in the current top level, which is Cocoa and will not find it. The right thing should be: - When loading a library from a TBD file, re-exports need to be looked up in the auxiliary documents within the same TBD. - When loading from an actual dylib, no additional TBD documents need to be examined. - In no case does a re-export mentioned in one TBD file need to be looked up in a document in an auxiliary document from a different TBD file Differential Revision: https://reviews.llvm.org/D97438
2021-02-18[llvm][TextAPI] add equality operator for InterfaceFileSam Powell1-0/+43
This patch adds functionality to compare for the equality between `InterfaceFile`s based on attributes specific to linking. Reviewed By: cishida, steven_wu Differential Revision: https://reviews.llvm.org/D96629
2021-01-17[llvm] Use llvm::sort (NFC)Kazu Hirata1-13/+11
2021-01-14[llvm] Remove redundant return and continue statements (NFC)Kazu Hirata1-2/+0
Identified with readability-redundant-control-flow.
2020-11-13llvmbuildectomy - replace llvm-build by plain cmakeserge-sans-paille2-21/+4
No longer rely on an external tool to build the llvm component layout. Instead, leverage the existing `add_llvm_componentlibrary` cmake function and introduce `add_llvm_component_group` to accurately describe component behavior. These function store extra properties in the created targets. These properties are processed once all components are defined to resolve library dependencies and produce the header expected by llvm-config. Differential Revision: https://reviews.llvm.org/D90848
2020-08-15[TextAPI] update DriverKit string valueCyndy Ishida1-1/+1
String value differed from downstream, where upstream doesn't depend on casing difference. <rdar://problem/67106257>
2020-08-14[MachO] Add skeletal support for DriverKit platformGreg McGary4-1/+10
Define the platform ID = 10, and simple mappings between platform ID & name. Reviewed By: MaskRay, cishida Differential Revision: https://reviews.llvm.org/D85594
2020-08-13[elfabi] Move llvm-elfabi related code to InterfaceStub libraryHaowei Wu3-190/+0
This change moves elfabi related code to llvm/InterfaceStub library so it can be shared by multiple llvm tools without causing cyclic dependencies. Differential Revision: https://reviews.llvm.org/D85678
2020-08-10Revert "Move ELFObjHandler to TextAPI library"Haowei Wu2-390/+1
This reverts commit e6f8ba12e6ea97cbf4374b70e78309c2d859ca1c due to build failures.
2020-08-10Move ELFObjHandler to TextAPI libraryHaowei Wu2-1/+390
This change moves ELFObjHandler to llvm/TextAPI library so it can be used by different llvm tools.
2020-06-24[TextAPI/MachO] Fix style issues. NFCFangrui Song2-15/+10
See https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions
2020-06-11[llvm][llvm-nm] add TextAPI/MachO supportCyndy Ishida2-5/+20
Summary: This completes the needed glueing to support reading tbd files from nm. This includes specifying which slice filtering with `--arch` and a new option specifically for tbd files `--add-inlinedinfo` which will show the reexported libraries that are appended in the tbd file. Reviewers: ributzka, steven_wu, JDevlieghere, jhenderson Reviewed By: JDevlieghere Subscribers: hiraditya, MaskRay, dexonsmith, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D81614
2020-05-30ArchitectureSet.h - reduce raw_ostream.h include to forward declaration. NFC.Simon Pilgrim1-0/+1
Move raw_ostream.h include to ArchitectureSet.cpp.
2020-05-30Architecture.h - reduce includes to forward declarations. NFC.Simon Pilgrim1-0/+2
Move includes to Architecture.cpp.
2020-05-29TextStubCommon.h - move StringSwitch.h include to TextStubCommon.cpp. NFC.Simon Pilgrim2-1/+1
Only TextStubCommon.cpp actually uses StringSwitch
2020-05-29TextAPIContext.h - remove unused MemoryBuffer.h include. NFC.Simon Pilgrim1-1/+0
2020-04-24[cmake] Add headers in TextAPI/Elf and TextAPI/MachO subdirectoriesSimon Pilgrim1-0/+2
2020-04-15PR45561: Return a literal string rather than an error string to avoid ↵David Blaikie1-2/+4
returning reference to local Changing the underlying YAML support to allow returning a literal string, rather than a StringRef, would probably be a bigger refactor so I didn't do that.
2020-04-02[llvm][TextAPI] adding inlining reexported libraries supportCyndy Ishida1-0/+7
Summary: [llvm][TextAPI] adding inlining reexported libraries support * this patch adds reader/writer support for MachO tbd files. The usecase is to represent reexported libraries in top level library that won't need to exist for linker indirection because all of the needed content will be inlined in the same document. Reviewers: ributzka, steven_wu, jhenderson Reviewed By: ributzka Subscribers: JDevlieghere, hiraditya, mgrang, dexonsmith, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67646
2020-03-25Suppress a few -Wunreachable-code warnings.Nico Weber1-4/+2
No behavior change. Also fix a comment to say match reality.
2020-03-02[llvm][MachO] fix adding weak def symsCyndy Ishida1-1/+2
the weak defined symbol flag was missing from the call site for adding symbols which didn't cause issues because it invoked the default parameter.
2020-02-11[llvm][TextAPI] add simulators to outputCyndy Ishida1-0/+6
Summary: * for <= tbd_v3, simulator platforms appear the same as the real platform and we distinct the difference from the architecture. fixes: rdar://problem/59161559 Reviewers: ributzka, steven_wu Reviewed By: ributzka Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D74416
2020-02-10Revert "Remove redundant "std::move"s in return statements"Bill Wendling2-2/+2
The build failed with error: call to deleted constructor of 'llvm::Error' errors. This reverts commit 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2.
2020-02-10Remove redundant "std::move"s in return statementsBill Wendling2-2/+2
2020-01-29Another round of GCC5 fixes.Benjamin Kramer1-1/+1
2020-01-29Fix one round of implicit conversions found by g++5.Benjamin Kramer1-1/+1
2020-01-28Make llvm::StringRef to std::string conversions explicit.Benjamin Kramer4-6/+6
This is how it should've been and brings it more in line with std::string_view. There should be no functional change here. This is mostly mechanical from a custom clang-tidy check, with a lot of manual fixups. It uncovers a lot of minor inefficiencies. This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2020-01-27[llvm][TextAPI/MachO] Support writing single macCatalyst platformJonas Devlieghere1-0/+3
TAPI currently lacks a way to emit the macCatalyst platform. For TBD_V3 is does support zippered frameworks given that both macOS and macCatalyst are part of the PlatformSet. Differential revision: https://reviews.llvm.org/D73325
2019-11-21[cmake] Explicitly mark libraries defined in lib/ as "Component Libraries"Tom Stellard1-1/+1
Summary: Most libraries are defined in the lib/ directory but there are also a few libraries defined in tools/ e.g. libLLVM, libLTO. I'm defining "Component Libraries" as libraries defined in lib/ that may be included in libLLVM.so. Explicitly marking the libraries in lib/ as component libraries allows us to remove some fragile checks that attempt to differentiate between lib/ libraries and tools/ libraires: 1. In tools/llvm-shlib, because llvm_map_components_to_libnames(LIB_NAMES "all") returned a list of all libraries defined in the whole project, there was custom code needed to filter out libraries defined in tools/, none of which should be included in libLLVM.so. This code assumed that any library defined as static was from lib/ and everything else should be excluded. With this change, llvm_map_components_to_libnames(LIB_NAMES, "all") only returns libraries that have been added to the LLVM_COMPONENT_LIBS global cmake property, so this custom filtering logic can be removed. Doing this also fixes the build with BUILD_SHARED_LIBS=ON and LLVM_BUILD_LLVM_DYLIB=ON. 2. There was some code in llvm_add_library that assumed that libraries defined in lib/ would not have LLVM_LINK_COMPONENTS or ARG_LINK_COMPONENTS set. This is only true because libraries defined lib lib/ use LLVMBuild.txt and don't set these values. This code has been fixed now to check if the library has been explicitly marked as a component library, which should now make it easier to remove LLVMBuild at some point in the future. I have tested this patch on Windows, MacOS and Linux with release builds and the following combinations of CMake options: - "" (No options) - -DLLVM_BUILD_LLVM_DYLIB=ON - -DLLVM_LINK_LLVM_DYLIB=ON - -DBUILD_SHARED_LIBS=ON - -DBUILD_SHARED_LIBS=ON -DLLVM_BUILD_LLVM_DYLIB=ON - -DBUILD_SHARED_LIBS=ON -DLLVM_LINK_LLVM_DYLIB=ON Reviewers: beanz, smeenai, compnerd, phosek Reviewed By: beanz Subscribers: wuzish, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, mgorny, mehdi_amini, sbc100, jgravelle-google, hiraditya, aheejin, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, PkmX, jocewei, jsji, dang, Jim, lenary, s.egerton, pzheng, sameer.abuasal, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70179
2019-10-10Reland "[TextAPI] Introduce TBDv4"Cyndy Ishida3-32/+525
Original Patch broke for compilations w/ gcc and exposed asan fail. This reland repairs those bugs. Differential Revision: https://reviews.llvm.org/D67529 llvm-svn: 374277
2019-10-08Revert [TextAPI] Introduce TBDv4Cyndy Ishida3-531/+32
This reverts r374058 (git commit 5d566c5a46aeaa1fa0e5c0b823c9d5f84036dc9a) llvm-svn: 374062
2019-10-08[TextAPI] Introduce TBDv4Cyndy Ishida3-32/+531
Summary: This format introduces new features and platforms The motivation for this format is to support more than 1 platform since previous versions only supported additional architectures and 1 platform, for example ios + ios-simulator and macCatalyst. Reviewers: ributzka, steven_wu Reviewed By: ributzka Subscribers: mgorny, hiraditya, mgrang, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67529 llvm-svn: 374058
2019-09-24[TextAPI] Remove redundant checking causing warnings. NFC.Michael Liao1-4/+4
- Minor coding format. llvm-svn: 372765
2019-09-23[TextAPI] Add New Supported PlatformsCyndy Ishida3-4/+74
Summary: This patch introduces simulators, as well was the restriced zippered and macCatalyst to supported platforms Reviewers: ributzka, steven_wu Reviewed By: ributzka Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67528 llvm-svn: 372618
2019-09-20Fix MSVC "not all control paths return a value" warning. NFCI.Simon Pilgrim1-1/+2
llvm-svn: 372416
2019-09-20[TextAPI] Arch&Platform to TargetCyndy Ishida9-73/+261
Summary: This is a patch for updating TextAPI/Macho to read in targets as opposed to arch/platform. This is because in previous versions tbd files only supported a single platform but that is no longer the case, so, now its tracked by unique triples. This precedes a seperate patch that will add the TBD-v4 format Reviewers: ributzka, steven_wu, plotfi, compnerd, smeenai Reviewed By: ributzka Subscribers: mgorny, hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67527 llvm-svn: 372396
2019-09-11Revert [llvm-nm] Add tapi file supportCyndy Ishida2-22/+5
This reverts r371576 (git commit f88f46358dbffa20af3b054a9346e5154789d50f) llvm-svn: 371676
2019-09-11[llvm-nm] Add tapi file supportCyndy Ishida2-5/+22
Summary: This commit is the final one for adding tapi support to the llvm-nm implementation. This commit also has accompanying tests the additions to lib/Object Reviewers: ributzka, steven_wu Reviewed By: ributzka Subscribers: hiraditya, plotfi, dexonsmith, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66160 llvm-svn: 371576
2019-08-16[TextAPI] Update reader to be supported by lib/ObjectCyndy Ishida1-3/+5
Summary: To be able to use the TextAPI/Reader for tbd file consumption (by libObject) it gets passed a MemoryBufferRef which isn't castable to MemoryBuffer. Updated the tests to expect that input as well. Reviewers: ributzka, steven_wu Reviewed By: steven_wu Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66147 llvm-svn: 369119
2019-08-12[TextAPI] Fix & Add tests for tbd files version 3.Juergen Ributzka1-4/+4
- There was a simple typo in TextStub code that prevented version 3 files to be read. - Included a version 3 unit test to handle the differences in the format. - Also a typo in Error.h inside the comments. https://reviews.llvm.org/D66041 This patch is from Cyndy Ishida <cyndy_ishida@apple.com>. llvm-svn: 368630
2019-06-30Cleanup: llvm::bsearch -> llvm::partition_point after r364719Fangrui Song1-9/+7
llvm-svn: 364720