diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-30 14:09:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-30 20:44:39 +0200 |
commit | 70093d815379e703a570e9cab3e8746555706ea0 (patch) | |
tree | a5b5478483ac5d862fd0ad0b8a03eb9c90af9574 /compilerplugins | |
parent | 3e4a311d22ee3f20621537db3db25f1481c9f66b (diff) |
adapt to runToolOnCodeWithArgs API change in clang 10
which required including config_host in generator, which in turn
required adapting the makefile
Change-Id: Icafa3b59816f52c349fbbd76ce71305856c9ce33
Reviewed-on: https://gerrit.libreoffice.org/78293
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/Makefile-clang.mk | 2 | ||||
-rw-r--r-- | compilerplugins/clang/sharedvisitor/generator.cxx | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk index ef80cfc0812d..370a58ef5e14 100644 --- a/compilerplugins/Makefile-clang.mk +++ b/compilerplugins/Makefile-clang.mk @@ -221,7 +221,7 @@ $(CLANGOUTDIR)/sharedvisitor/generator$(CLANG_EXE_EXT): $(CLANGINDIR)/sharedvisi | $(CLANGOUTDIR)/sharedvisitor $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,1) $(QUIET)$(COMPILER_PLUGINS_CXX) $(CLANGCXXFLAGS) $(CLANGWERROR) $(CLANGDEFS) $(CLANGTOOLDEFS) $(CLANGINCLUDES) \ - -DCLANGDIR=$(CLANGDIR) -DBUILDDIR=$(BUILDDIR) -I$(BUILDDIR)/config_host \ + -DCLANGDIR=$(CLANGDIR) -I$(BUILDDIR)/config_host \ -c $< -o $(CLANGOUTDIR)/sharedvisitor/generator.o -MMD -MT $@ -MP \ -MF $(CLANGOUTDIR)/sharedvisitor/generator.d $(QUIET)$(COMPILER_PLUGINS_CXX) $(CLANGCXXFLAGS) $(CLANGOUTDIR)/sharedvisitor/generator.o \ diff --git a/compilerplugins/clang/sharedvisitor/generator.cxx b/compilerplugins/clang/sharedvisitor/generator.cxx index ddcd901f47b6..286d57e6d4e1 100644 --- a/compilerplugins/clang/sharedvisitor/generator.cxx +++ b/compilerplugins/clang/sharedvisitor/generator.cxx @@ -60,8 +60,10 @@ TODO: #include <cstring> #include <iostream> #include <fstream> +#include <memory> #include <set> +#include "config_clang.h" #include "../check.hxx" #include "../check.cxx" @@ -552,7 +554,7 @@ int main(int argc, char** argv) args.insert( args.end(), { - "-I" STRINGIFY(BUILDDIR) "/config_host", // plugin sources use e.g. config_global.h + "-I" BUILDDIR "/config_host", // plugin sources use e.g. config_global.h "-I" STRINGIFY(CLANGDIR) "/include", // clang's headers "-I" STRINGIFY(CLANGSYSINCLUDE), // clang system headers STDOPTION, @@ -566,7 +568,11 @@ int main(int argc, char** argv) if( contents.empty()) continue; foundSomething = false; +#if CLANG_VERSION >= 100000 + if( !clang::tooling::runToolOnCodeWithArgs( std::unique_ptr<FindNamedClassAction>(new FindNamedClassAction), contents, args, argv[ i ] )) +#else if( !clang::tooling::runToolOnCodeWithArgs( new FindNamedClassAction, contents, args, argv[ i ] )) +#endif { cerr << "Failed to analyze: " << argv[ i ] << endl; return 2; |