summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-06-24 16:46:55 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-06-24 16:46:55 +0200
commitf8a18a464eb2cd8ee7a07b8ddef0fa5d79d638ef (patch)
treeeee657910eee1b4d3615ab99d3797779a3e3803a /compilerplugins/clang
parent2ff98b560cfaa747b19e013857d89d16fe99fd76 (diff)
Adpat to <https://llvm.org/svn/llvm-project/cfe/trunk@273647>
"Use more ArrayRefs" Change-Id: Ied0ab11dd9366b3f499100b2627f4919cca52c9c
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r--compilerplugins/clang/compat.hxx14
-rw-r--r--compilerplugins/clang/constantparam.cxx2
-rw-r--r--compilerplugins/clang/unuseddefaultparams.cxx2
-rw-r--r--compilerplugins/clang/unusedfields.cxx2
-rw-r--r--compilerplugins/clang/unusedmethods.cxx4
-rw-r--r--compilerplugins/clang/unusedmethodsremove.cxx2
6 files changed, 20 insertions, 6 deletions
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index db573f5047d2..7a87944a3157 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 54fe00c7477e..88d0ec0a73e9 100644
--- a/compilerplugins/clang/constantparam.cxx
+++ b/compilerplugins/clang/constantparam.cxx
@@ -122,7 +122,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 0a3ce28cc761..6d2094e8ab87 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 a370cb37c449..81745117c7a7 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 aa645fb7cc4a..d84449fe7522 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 74c310dbba46..273b4153c325 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