[Libreoffice-commits] core.git: compilerplugins/clang compilerplugins/Makefile-clang.mk

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 30 18:45:33 UTC 2019


 compilerplugins/Makefile-clang.mk                 |    2 +-
 compilerplugins/clang/sharedvisitor/generator.cxx |    8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 70093d815379e703a570e9cab3e8746555706ea0
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Aug 30 14:09:22 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Aug 30 20:44:39 2019 +0200

    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 at collabora.co.uk>

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;


More information about the Libreoffice-commits mailing list