Skip to content

Commit e323778

Browse files
committed
Delete an unused parameter in the parser
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent bcdc2cf commit e323778

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

src/CppParser/Parser.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,8 +1571,7 @@ FunctionTemplate* Parser::WalkFunctionTemplate(const clang::FunctionTemplateDecl
15711571
if (auto MD = dyn_cast<CXXMethodDecl>(TemplatedDecl))
15721572
Function = WalkMethodCXX(MD);
15731573
else
1574-
Function = WalkFunction(TemplatedDecl, /*IsDependent=*/true,
1575-
/*AddToNamespace=*/false);
1574+
Function = WalkFunction(TemplatedDecl, /*AddToNamespace=*/false);
15761575

15771576
FT = new FunctionTemplate();
15781577
HandleDeclaration(TD, FT);
@@ -3157,12 +3156,11 @@ void Parser::MarkValidity(Function* F)
31573156
c->getSema().getDiagnostics().setClient(existingClient, false);
31583157
}
31593158

3160-
void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F,
3161-
bool IsDependent)
3159+
void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F)
31623160
{
31633161
using namespace clang;
31643162

3165-
assert (FD->getBuiltinID() == 0);
3163+
assert(FD->getBuiltinID() == 0);
31663164
auto FT = FD->getType()->getAs<clang::FunctionType>();
31673165

31683166
auto NS = GetNamespace(FD);
@@ -3206,7 +3204,7 @@ void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F,
32063204
HandlePreprocessedEntities(F, FTL.getParensRange(), MacroLocation::FunctionParameters);
32073205
}
32083206
}
3209-
3207+
32103208
auto ReturnType = FD->getReturnType();
32113209
if (FD->isExternallyVisible())
32123210
CompleteIfSpecializationType(ReturnType);
@@ -3232,7 +3230,7 @@ void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F,
32323230
if (FTL)
32333231
{
32343232
auto FTInfo = FTL.castAs<FunctionTypeLoc>();
3235-
assert (!FTInfo.isNull());
3233+
assert(!FTInfo.isNull());
32363234

32373235
ParamStartLoc = FTInfo.getLParenLoc();
32383236
ResultLoc = FTInfo.getReturnLoc().getBeginLoc();
@@ -3283,7 +3281,7 @@ void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F,
32833281
const CXXMethodDecl* MD;
32843282
if (FD->isDependentContext() ||
32853283
((MD = dyn_cast<CXXMethodDecl>(FD)) && !MD->isStatic() &&
3286-
!HasLayout(cast<CXXRecordDecl>(MD->getDeclContext()))) ||
3284+
!HasLayout(cast<CXXRecordDecl>(MD->getDeclContext()))) ||
32873285
!CanCheckCodeGenInfo(c->getSema(), FD->getReturnType().getTypePtr()) ||
32883286
std::any_of(FD->parameters().begin(), FD->parameters().end(),
32893287
[this](auto* P) { return !CanCheckCodeGenInfo(c->getSema(), P->getType().getTypePtr()); }))
@@ -3307,8 +3305,7 @@ void Parser::WalkFunction(const clang::FunctionDecl* FD, Function* F,
33073305
F->qualifiedType = GetQualifiedType(FD->getType(), &FTL);
33083306
}
33093307

3310-
Function* Parser::WalkFunction(const clang::FunctionDecl* FD, bool IsDependent,
3311-
bool AddToNamespace)
3308+
Function* Parser::WalkFunction(const clang::FunctionDecl* FD, bool AddToNamespace)
33123309
{
33133310
using namespace clang;
33143311

@@ -3328,7 +3325,7 @@ Function* Parser::WalkFunction(const clang::FunctionDecl* FD, bool IsDependent,
33283325
if (AddToNamespace)
33293326
NS->Functions.push_back(F);
33303327

3331-
WalkFunction(FD, F, IsDependent);
3328+
WalkFunction(FD, F);
33323329

33333330
return F;
33343331
}

src/CppParser/Parser.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ class Parser
7373
Declaration* WalkDeclarationDef(clang::Decl* D);
7474
Enumeration* WalkEnum(const clang::EnumDecl* ED);
7575
Enumeration::Item* WalkEnumItem(clang::EnumConstantDecl* ECD);
76-
Function* WalkFunction(const clang::FunctionDecl* FD, bool IsDependent = false,
77-
bool AddToNamespace = true);
76+
Function* WalkFunction(const clang::FunctionDecl* FD, bool AddToNamespace = true);
7877
void EnsureCompleteRecord(const clang::RecordDecl* Record, DeclarationContext* NS, Class* RC);
7978
Class* GetRecord(const clang::RecordDecl* Record, bool& IsComplete);
8079
Class* WalkRecord(const clang::RecordDecl* Record);
@@ -137,8 +136,7 @@ class Parser
137136
void SetBody(const clang::FunctionDecl* FD, Function* F);
138137
std::stack<clang::Scope> GetScopesFor(clang::FunctionDecl* FD);
139138
void MarkValidity(Function* F);
140-
void WalkFunction(const clang::FunctionDecl* FD, Function* F,
141-
bool IsDependent = false);
139+
void WalkFunction(const clang::FunctionDecl* FD, Function* F);
142140
void HandlePreprocessedEntities(Declaration* Decl);
143141
void HandlePreprocessedEntities(Declaration* Decl, clang::SourceRange sourceRange,
144142
MacroLocation macroLocation = MacroLocation::Unknown);

0 commit comments

Comments
 (0)