Skip to content

Commit 82800df

Browse files
committed
[lldb][NFC] Remove ClangASTContext::GetAsDeclContext
Everything we pass to this function is already a DeclContext.
1 parent 02e9113 commit 82800df

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

lldb/include/lldb/Symbol/ClangASTContext.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,7 @@ class ClangASTContext : public TypeSystem {
308308
class_template_specialization_decl);
309309

310310
static clang::DeclContext *
311-
GetAsDeclContext(clang::CXXMethodDecl *cxx_method_decl);
312-
313-
static clang::DeclContext *
314-
GetAsDeclContext(clang::ObjCMethodDecl *objc_method_decl);
311+
GetAsDeclContext(clang::FunctionDecl *function_decl);
315312

316313
static bool CheckOverloadedOperatorKindParameterCount(
317314
bool is_method, clang::OverloadedOperatorKind op_kind,

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
894894
attrs.accessibility, attrs.is_artificial, is_variadic);
895895
type_handled = objc_method_decl != NULL;
896896
if (type_handled) {
897-
LinkDeclContextToDIE(
898-
ClangASTContext::GetAsDeclContext(objc_method_decl), die);
897+
LinkDeclContextToDIE(objc_method_decl, die);
899898
m_ast.SetMetadataAsUserID(objc_method_decl, die.GetID());
900899
} else {
901900
dwarf->GetObjectFile()->GetModule()->ReportError(
@@ -1009,10 +1008,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
10091008
if (method_decl->getType() ==
10101009
ClangUtil::GetQualType(clang_type)) {
10111010
add_method = false;
1012-
LinkDeclContextToDIE(
1013-
ClangASTContext::GetAsDeclContext(
1014-
method_decl),
1015-
die);
1011+
LinkDeclContextToDIE(method_decl, die);
10161012
type_handled = true;
10171013

10181014
break;
@@ -1054,9 +1050,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
10541050
type_handled |= attrs.is_artificial;
10551051

10561052
if (cxx_method_decl) {
1057-
LinkDeclContextToDIE(
1058-
ClangASTContext::GetAsDeclContext(cxx_method_decl),
1059-
die);
1053+
LinkDeclContextToDIE(cxx_method_decl, die);
10601054

10611055
ClangASTMetadata metadata;
10621056
metadata.SetUserID(die.GetID());

lldb/source/Symbol/ClangASTContext.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,16 +2487,6 @@ ClangASTMetadata *ClangASTContext::GetMetadata(clang::ASTContext *ast,
24872487
return nullptr;
24882488
}
24892489

2490-
clang::DeclContext *
2491-
ClangASTContext::GetAsDeclContext(clang::CXXMethodDecl *cxx_method_decl) {
2492-
return llvm::dyn_cast<clang::DeclContext>(cxx_method_decl);
2493-
}
2494-
2495-
clang::DeclContext *
2496-
ClangASTContext::GetAsDeclContext(clang::ObjCMethodDecl *objc_method_decl) {
2497-
return llvm::dyn_cast<clang::DeclContext>(objc_method_decl);
2498-
}
2499-
25002490
bool ClangASTContext::SetTagTypeKind(clang::QualType tag_qual_type,
25012491
int kind) const {
25022492
const clang::Type *clang_type = tag_qual_type.getTypePtr();

0 commit comments

Comments
 (0)