[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - compilerplugins/clang

Stephan Bergmann sbergman at redhat.com
Thu Jun 30 08:17:52 UTC 2016


 compilerplugins/clang/compat.hxx              |   14 ++++++++++++++
 compilerplugins/clang/constantparam.cxx       |    2 +-
 compilerplugins/clang/unuseddefaultparams.cxx |    2 +-
 compilerplugins/clang/unusedfields.cxx        |    2 +-
 compilerplugins/clang/unusedmethods.cxx       |    4 ++--
 compilerplugins/clang/unusedmethodsremove.cxx |    2 +-
 6 files changed, 20 insertions(+), 6 deletions(-)

New commits:
commit 3624d0d1bd54d262b39cdc6aeffb8a2f7c3c7ad7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jun 24 16:46:55 2016 +0200

    Adpat to <https://llvm.org/svn/llvm-project/cfe/trunk@273647>
    
    "Use more ArrayRefs"
    
    Change-Id: Ied0ab11dd9366b3f499100b2627f4919cca52c9c
    (cherry picked from commit f8a18a464eb2cd8ee7a07b8ddef0fa5d79d638ef)
    Reviewed-on: https://gerrit.libreoffice.org/26775
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index db573f5..7a87944 100644
--- a/compilerplugins/clang/compat.hxx
+++ b/compilerplugins/clang/compat.hxx
@@ -128,6 +128,20 @@ inline clang::QualType getReturnType(clang::FunctionDecl const & decl) {
 #endif
 }
 
+#if CLANG_VERSION >= 30900
+inline clang::ArrayRef<clang::ParmVarDecl *> parameters(
+    clang::FunctionDecl const & decl)
+{
+    return decl.parameters();
+}
+#else
+inline clang::FunctionDecl::param_const_range parameters(
+    clang::FunctionDecl const & decl)
+{
+    return decl.params();
+}
+#endif
+
 inline clang::QualType getReturnType(clang::FunctionProtoType const & type) {
 #if CLANG_VERSION >= 30500
     return type.getReturnType();
diff --git a/compilerplugins/clang/constantparam.cxx b/compilerplugins/clang/constantparam.cxx
index 99db545..ab6a7cd 100644
--- a/compilerplugins/clang/constantparam.cxx
+++ b/compilerplugins/clang/constantparam.cxx
@@ -123,7 +123,7 @@ MyCallSiteInfo ConstantParam::niceName(const FunctionDecl* functionDecl, int par
     }
     aInfo.nameAndParams += functionDecl->getNameAsString() + "(";
     bool bFirst = true;
-    for (const ParmVarDecl *pParmVarDecl : functionDecl->params()) {
+    for (const ParmVarDecl *pParmVarDecl : compat::parameters(*functionDecl)) {
         if (bFirst)
             bFirst = false;
         else
diff --git a/compilerplugins/clang/unuseddefaultparams.cxx b/compilerplugins/clang/unuseddefaultparams.cxx
index 0a3ce28..6d2094e 100644
--- a/compilerplugins/clang/unuseddefaultparams.cxx
+++ b/compilerplugins/clang/unuseddefaultparams.cxx
@@ -107,7 +107,7 @@ MyFuncInfo UnusedDefaultParams::niceName(const FunctionDecl* functionDecl)
     }
     aInfo.nameAndParams += functionDecl->getNameAsString() + "(";
     bool bFirst = true;
-    for (const ParmVarDecl *pParmVarDecl : functionDecl->params()) {
+    for (const ParmVarDecl *pParmVarDecl : compat::parameters(*functionDecl)) {
         if (bFirst)
             bFirst = false;
         else
diff --git a/compilerplugins/clang/unusedfields.cxx b/compilerplugins/clang/unusedfields.cxx
index a370cb3..8174511 100644
--- a/compilerplugins/clang/unusedfields.cxx
+++ b/compilerplugins/clang/unusedfields.cxx
@@ -124,7 +124,7 @@ std::string UnusedFields::fullyQualifiedName(const FunctionDecl* functionDecl)
     }
     ret += functionDecl->getNameAsString() + "(";
     bool bFirst = true;
-    for (const ParmVarDecl *pParmVarDecl : functionDecl->params()) {
+    for (const ParmVarDecl *pParmVarDecl : compat::parameters(*functionDecl)) {
         if (bFirst)
             bFirst = false;
         else
diff --git a/compilerplugins/clang/unusedmethods.cxx b/compilerplugins/clang/unusedmethods.cxx
index aa645fb..d84449f 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -148,7 +148,7 @@ MyFuncInfo UnusedMethods::niceName(const FunctionDecl* functionDecl)
     }
     aInfo.nameAndParams += functionDecl->getNameAsString() + "(";
     bool bFirst = true;
-    for (const ParmVarDecl *pParmVarDecl : functionDecl->params()) {
+    for (const ParmVarDecl *pParmVarDecl : compat::parameters(*functionDecl)) {
         if (bFirst)
             bFirst = false;
         else
@@ -178,7 +178,7 @@ std::string UnusedMethods::fullyQualifiedName(const FunctionDecl* functionDecl)
     }
     ret += functionDecl->getNameAsString() + "(";
     bool bFirst = true;
-    for (const ParmVarDecl *pParmVarDecl : functionDecl->params()) {
+    for (const ParmVarDecl *pParmVarDecl : compat::parameters(*functionDecl)) {
         if (bFirst)
             bFirst = false;
         else
diff --git a/compilerplugins/clang/unusedmethodsremove.cxx b/compilerplugins/clang/unusedmethodsremove.cxx
index 74c310d..273b415 100644
--- a/compilerplugins/clang/unusedmethodsremove.cxx
+++ b/compilerplugins/clang/unusedmethodsremove.cxx
@@ -79,7 +79,7 @@ std::string niceName(const CXXMethodDecl* functionDecl)
         + "::" + functionDecl->getNameAsString()
         + "(";
     bool bFirst = true;
-    for (const ParmVarDecl *pParmVarDecl : functionDecl->params()) {
+    for (const ParmVarDecl *pParmVarDecl : compat::parameters(*functionDecl)) {
         if (bFirst)
             bFirst = false;
         else


More information about the Libreoffice-commits mailing list