Skip to content

Instantly share code, notes, and snippets.

@kubkon
Created August 9, 2023 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kubkon/88be6dfd5f4f67bf1c53d6327f043371 to your computer and use it in GitHub Desktop.
Save kubkon/88be6dfd5f4f67bf1c53d6327f043371 to your computer and use it in GitHub Desktop.
If anyone is crazy enough to wanting to build Apple's TAPI project from source, here's the patch...
diff --git a/tools/tapi-binary-reader/CMakeLists.txt b/tools/tapi-binary-reader/CMakeLists.txt
index d3722ac..4f1f6b7 100644
--- a/tools/tapi-binary-reader/CMakeLists.txt
+++ b/tools/tapi-binary-reader/CMakeLists.txt
@@ -11,6 +11,7 @@ add_tapi_executable(tapi-binary-reader
target_link_libraries(tapi-binary-reader
PRIVATE
tapiCore
+ tapiObjCMetadata
)
install(TARGETS tapi-binary-reader
diff --git a/tools/tapi-frontend/CMakeLists.txt b/tools/tapi-frontend/CMakeLists.txt
index 2021d7e..8dd3d94 100644
--- a/tools/tapi-frontend/CMakeLists.txt
+++ b/tools/tapi-frontend/CMakeLists.txt
@@ -10,7 +10,6 @@ add_tapi_executable(tapi-frontend
target_link_libraries(tapi-frontend
PRIVATE
- tapiAPIVerifier
tapiCore
tapiFrontend
)
diff --git a/tools/tapi-frontend/tapi-frontend.cpp b/tools/tapi-frontend/tapi-frontend.cpp
index 07fbf0e..fec45ca 100644
--- a/tools/tapi-frontend/tapi-frontend.cpp
+++ b/tools/tapi-frontend/tapi-frontend.cpp
@@ -12,7 +12,6 @@
/// A tool to run the TAPI frontent for testing.
///
//===----------------------------------------------------------------------===//
-#include "tapi/APIVerifier/APIVerifier.h"
#include "tapi/Config/Version.h"
#include "tapi/Core/APIPrinter.h"
#include "tapi/Core/APIJSONSerializer.h"
@@ -69,12 +68,6 @@ static cl::opt<bool> noPrint("no-print", cl::desc("don't print the API"),
cl::cat(tapiCategory));
static cl::opt<bool> verify("verify", cl::desc("run verifier"),
cl::cat(tapiCategory));
-static cl::opt<APIVerifierDiagStyle> diagStyle(
- "verifier-diag-style", cl::init(APIVerifierDiagStyle::Warning),
- cl::desc("APIVerifier Diagnostic Style, options: silent, warning, error"),
- cl::values(clEnumValN(APIVerifierDiagStyle::Silent, "silent", "Silent"),
- clEnumValN(APIVerifierDiagStyle::Warning, "warning", "Warning"),
- clEnumValN(APIVerifierDiagStyle::Error, "error", "Error")));
static cl::opt<bool> skipExtern("skip-external-headers",
cl::desc("skip external headers"),
cl::cat(tapiCategory));
@@ -164,34 +157,6 @@ int main(int argc, const char *argv[]) {
results.emplace_back(std::move(result.getValue()));
}
- if (verify) {
- if (results.size() != 2) {
- errs() << "error: invalid number of targets to verify (expected exactly "
- "two taregts)\n";
- return -1;
- }
- DiagnosticsEngine diag;
- APIVerifier apiVerifier(diag);
- if (!allowlist.empty()) {
- auto inputBuf = MemoryBuffer::getFile(allowlist);
- if (!inputBuf) {
- errs() << "cannot open allowlist file: " << allowlist << "\n";
- return -1;
- }
-
- auto error = apiVerifier.getConfiguration().readConfig(
- (*inputBuf)->getMemBufferRef());
- if (error) {
- errs() << "cannot parse allowlist file: " << toString(std::move(error))
- << "\n";
- return -1;
- }
- }
-
- apiVerifier.verify(results.front(), results.back(), diagnosticDepth,
- !skipExtern, diagStyle, missingAPI, noCascadingDiags);
- }
-
if (!noPrint) {
for (auto &result : results) {
APIPrinter printer(errs(), !noColors);
diff --git a/llvm/include/llvm/TextAPI/MachO/ArchitectureSet.h b/llvm/include/llvm/TextAPI/MachO/ArchitectureSet.h
index c48a4a702363..f7a48f1ea5f7 100644
--- a/llvm/include/llvm/TextAPI/MachO/ArchitectureSet.h
+++ b/llvm/include/llvm/TextAPI/MachO/ArchitectureSet.h
@@ -40,6 +40,8 @@ public:
ArchitectureSet(Architecture Arch) : ArchitectureSet() { set(Arch); }
ArchitectureSet(const std::vector<Architecture> &Archs);
+ static ArchitectureSet All() { return ArchitectureSet(EndIndexVal); }
+
void set(Architecture Arch) {
if (Arch == AK_unknown)
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment