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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri May 3 08:22:49 UTC 2019


 compilerplugins/clang/constantparam.cxx             |    4 ++++
 compilerplugins/clang/countusersofdefaultparams.cxx |    6 ++++++
 compilerplugins/clang/expandablemethods.cxx         |    2 ++
 compilerplugins/clang/methodcycles.cxx              |    2 ++
 compilerplugins/clang/unusedmethods.cxx             |    2 ++
 5 files changed, 16 insertions(+)

New commits:
commit a010011fd362536beb8d1cd44cf058180f7c06ec
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu May 2 20:55:04 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri May 3 10:21:26 2019 +0200

    Fix building compilerplugins with Clang trunk towards Clang 9
    
    ...after <https://github.com/llvm/llvm-project/commit/
    f19a8b05171a67a290e7d3bd6eba0c95c7b3259c> "Replace ad-hoc tracking of pattern
    for an instantiated class-scope" removed
    ASTContext::getClassScopeSpecializationPattern.  None of the affected plugins
    are enabled by default (nor checked by
    solenv/CompilerTest_compilerplugins_clang.mk), so just make sure they still
    compile, leaving any potentially necessary adaptions to another commit.
    
    Change-Id: I7102851409e78eff284b50337f7ad0f721e1e548
    Reviewed-on: https://gerrit.libreoffice.org/71702
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/compilerplugins/clang/constantparam.cxx b/compilerplugins/clang/constantparam.cxx
index ffacf1102022..7fab25406236 100644
--- a/compilerplugins/clang/constantparam.cxx
+++ b/compilerplugins/clang/constantparam.cxx
@@ -104,8 +104,10 @@ void ConstantParam::addToCallSet(const FunctionDecl* functionDecl, int paramInde
 {
     if (functionDecl->getInstantiatedFromMemberFunction())
         functionDecl = functionDecl->getInstantiatedFromMemberFunction();
+#if CLANG_VERSION < 90000
     else if (functionDecl->getClassScopeSpecializationPattern())
         functionDecl = functionDecl->getClassScopeSpecializationPattern();
+#endif
     else if (functionDecl->getTemplateInstantiationPattern())
         functionDecl = functionDecl->getTemplateInstantiationPattern();
 
@@ -252,8 +254,10 @@ bool ConstantParam::VisitCallExpr(const CallExpr * callExpr) {
     // work our way back to the root definition for template methods
     if (functionDecl->getInstantiatedFromMemberFunction())
         functionDecl = functionDecl->getInstantiatedFromMemberFunction();
+#if CLANG_VERSION < 90000
     else if (functionDecl->getClassScopeSpecializationPattern())
         functionDecl = functionDecl->getClassScopeSpecializationPattern();
+#endif
     else if (functionDecl->getTemplateInstantiationPattern())
         functionDecl = functionDecl->getTemplateInstantiationPattern();
 
diff --git a/compilerplugins/clang/countusersofdefaultparams.cxx b/compilerplugins/clang/countusersofdefaultparams.cxx
index 0f434689a6c2..b469833b27b9 100644
--- a/compilerplugins/clang/countusersofdefaultparams.cxx
+++ b/compilerplugins/clang/countusersofdefaultparams.cxx
@@ -93,8 +93,10 @@ void CountUsersOfDefaultParams::niceName(const FunctionDecl* functionDecl, MyFun
 {
     if (functionDecl->getInstantiatedFromMemberFunction())
         functionDecl = functionDecl->getInstantiatedFromMemberFunction();
+#if CLANG_VERSION < 90000
     else if (functionDecl->getClassScopeSpecializationPattern())
         functionDecl = functionDecl->getClassScopeSpecializationPattern();
+#endif
     else if (functionDecl->getTemplateInstantiationPattern())
         functionDecl = functionDecl->getTemplateInstantiationPattern();
 
@@ -155,8 +157,10 @@ bool CountUsersOfDefaultParams::VisitCallExpr(const CallExpr * callExpr) {
     // work our way back to the root definition for template methods
     if (functionDecl->getInstantiatedFromMemberFunction())
         functionDecl = functionDecl->getInstantiatedFromMemberFunction();
+#if CLANG_VERSION < 90000
     else if (functionDecl->getClassScopeSpecializationPattern())
         functionDecl = functionDecl->getClassScopeSpecializationPattern();
+#endif
     else if (functionDecl->getTemplateInstantiationPattern())
         functionDecl = functionDecl->getTemplateInstantiationPattern();
     int n = functionDecl->getNumParams() - 1;
@@ -184,8 +188,10 @@ bool CountUsersOfDefaultParams::VisitCXXConstructExpr(const CXXConstructExpr * c
     // work our way back to the root definition for template methods
     if (constructorDecl->getInstantiatedFromMemberFunction())
         constructorDecl = dyn_cast<CXXConstructorDecl>(constructorDecl->getInstantiatedFromMemberFunction());
+#if CLANG_VERSION < 90000
     else if (constructorDecl->getClassScopeSpecializationPattern())
         constructorDecl = dyn_cast<CXXConstructorDecl>(constructorDecl->getClassScopeSpecializationPattern());
+#endif
     else if (constructorDecl->getTemplateInstantiationPattern())
         constructorDecl = dyn_cast<CXXConstructorDecl>(constructorDecl->getTemplateInstantiationPattern());
     int n = constructorDecl->getNumParams() - 1;
diff --git a/compilerplugins/clang/expandablemethods.cxx b/compilerplugins/clang/expandablemethods.cxx
index 8277ae838028..e91a3c0ecf4c 100644
--- a/compilerplugins/clang/expandablemethods.cxx
+++ b/compilerplugins/clang/expandablemethods.cxx
@@ -114,8 +114,10 @@ MyFuncInfo ExpandableMethods::niceName(const FunctionDecl* functionDecl)
 {
     if (functionDecl->getInstantiatedFromMemberFunction())
         functionDecl = functionDecl->getInstantiatedFromMemberFunction();
+#if CLANG_VERSION < 90000
     else if (functionDecl->getClassScopeSpecializationPattern())
         functionDecl = functionDecl->getClassScopeSpecializationPattern();
+#endif
     else if (functionDecl->getTemplateInstantiationPattern())
         functionDecl = functionDecl->getTemplateInstantiationPattern();
 
diff --git a/compilerplugins/clang/methodcycles.cxx b/compilerplugins/clang/methodcycles.cxx
index fb1a88b80a94..0a57e5d38a7b 100644
--- a/compilerplugins/clang/methodcycles.cxx
+++ b/compilerplugins/clang/methodcycles.cxx
@@ -126,8 +126,10 @@ MyFuncInfo MethodCycles::niceName(const FunctionDecl* functionDecl)
 {
     if (functionDecl->getInstantiatedFromMemberFunction())
         functionDecl = functionDecl->getInstantiatedFromMemberFunction();
+#if CLANG_VERSION < 90000
     else if (functionDecl->getClassScopeSpecializationPattern())
         functionDecl = functionDecl->getClassScopeSpecializationPattern();
+#endif
     else if (functionDecl->getTemplateInstantiationPattern())
         functionDecl = functionDecl->getTemplateInstantiationPattern();
 
diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx
index 8ca645335c43..e24fec99c3d2 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -132,8 +132,10 @@ MyFuncInfo UnusedMethods::niceName(const FunctionDecl* functionDecl)
 {
     if (functionDecl->getInstantiatedFromMemberFunction())
         functionDecl = functionDecl->getInstantiatedFromMemberFunction();
+#if CLANG_VERSION < 90000
     else if (functionDecl->getClassScopeSpecializationPattern())
         functionDecl = functionDecl->getClassScopeSpecializationPattern();
+#endif
     else if (functionDecl->getTemplateInstantiationPattern())
         functionDecl = functionDecl->getTemplateInstantiationPattern();
 


More information about the Libreoffice-commits mailing list