"Use more ArrayRefs" Change-Id: Ied0ab11dd9366b3f499100b2627f4919cca52c9c
This commit is contained in:
@@ -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();
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user