Skip to content

Commit b908881

Browse files
committed
Simplified Parser::GetDeclMangledName.
1 parent 1d5b986 commit b908881

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/CppParser/Parser.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ void Parser::SetupHeader()
297297

298298
//-----------------------------------//
299299

300-
std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI,
301-
bool IsDependent)
300+
std::string Parser::GetDeclMangledName(clang::Decl* D)
302301
{
303302
using namespace clang;
304303

@@ -313,7 +312,7 @@ std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI,
313312
NamedDecl* ND = cast<NamedDecl>(D);
314313
std::unique_ptr<MangleContext> MC;
315314

316-
switch(ABI.getKind())
315+
switch(TargetABI)
317316
{
318317
default:
319318
MC.reset(ItaniumMangleContext::create(*AST, AST->getDiagnostics()));
@@ -329,6 +328,7 @@ std::string Parser::GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI,
329328
std::string Mangled;
330329
llvm::raw_string_ostream Out(Mangled);
331330

331+
bool IsDependent = false;
332332
if (const ValueDecl *VD = dyn_cast<ValueDecl>(ND))
333333
IsDependent |= VD->getType()->isDependentType();
334334

@@ -2241,7 +2241,7 @@ void Parser::WalkFunction(clang::FunctionDecl* FD, Function* F,
22412241
F->ReturnType = GetQualifiedType(FD->getReturnType(),
22422242
WalkType(FD->getReturnType(), &RTL));
22432243

2244-
String Mangled = GetDeclMangledName(FD, TargetABI, IsDependent);
2244+
String Mangled = GetDeclMangledName(FD);
22452245
F->Mangled = Mangled;
22462246

22472247
clang::SourceLocation ParamStartLoc = FD->getLocStart();
@@ -2442,7 +2442,7 @@ Variable* Parser::WalkVariable(clang::VarDecl *VD)
24422442
auto TL = VD->getTypeSourceInfo()->getTypeLoc();
24432443
Var->QualifiedType = GetQualifiedType(VD->getType(), WalkType(VD->getType(), &TL));
24442444

2445-
auto Mangled = GetDeclMangledName(VD, TargetABI, /*IsDependent=*/false);
2445+
auto Mangled = GetDeclMangledName(VD);
24462446
Var->Mangled = Mangled;
24472447

24482448
NS->Variables.push_back(Var);

src/CppParser/Parser.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ class Parser
104104
// Clang helpers
105105
SourceLocationKind GetLocationKind(const clang::SourceLocation& Loc);
106106
bool IsValidDeclaration(const clang::SourceLocation& Loc);
107-
std::string GetDeclMangledName(clang::Decl* D, clang::TargetCXXABI ABI,
108-
bool IsDependent = false);
107+
std::string GetDeclMangledName(clang::Decl* D);
109108
std::string GetTypeName(const clang::Type* Type);
110109
void WalkFunction(clang::FunctionDecl* FD, Function* F,
111110
bool IsDependent = false);

0 commit comments

Comments
 (0)