summaryrefslogtreecommitdiff
path: root/elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp')
-rw-r--r--elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp47
1 files changed, 0 insertions, 47 deletions
diff --git a/elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp b/elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp
deleted file mode 100644
index 64ea7aa..0000000
--- a/elpa/irony-20220110.849/server/cmake/LibClangDiagnosticsChecker.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- This program takes some forward its command line arguments to libclang and
- returns the number of diagnostics that occured during the parsing.
-
- It is used during CMake generation to adjust the default parameters to
- libclang.
-*/
-
-#include <clang-c/Index.h>
-
-#include <stdio.h>
-
-int main(int argc, const char *argv[]) {
- for (int i = 1; i < argc; ++i) {
- fprintf(stdout, "argv[%d]: %s\n", i, argv[i]);
- }
-
- CXIndex Idx = clang_createIndex(0, 0);
- CXTranslationUnit TU = clang_parseTranslationUnit(
- Idx, NULL, &argv[1], argc - 1, 0, 0, CXTranslationUnit_None);
- int NumDiagnostics;
-
- if (TU == NULL) {
- NumDiagnostics = 1;
- fprintf(stderr, "failed to create translation unit!\n");
- } else {
- int i;
-
- NumDiagnostics = clang_getNumDiagnostics(TU);
-
- for (i = 0; i < NumDiagnostics; ++i) {
- CXDiagnostic Diag = clang_getDiagnostic(TU, i);
- CXString DiagStr =
- clang_formatDiagnostic(Diag, clang_defaultDiagnosticDisplayOptions());
-
- fprintf(stderr, "%s\n", clang_getCString(DiagStr));
-
- clang_disposeString(DiagStr);
- clang_disposeDiagnostic(Diag);
- }
-
- clang_disposeTranslationUnit(TU);
- }
-
- clang_disposeIndex(Idx);
- return NumDiagnostics;
-}