Skip to content

Commit d2c0451

Browse files
committed
[lldb][DWAFASTParserClang][NFC] Rename GetCXXObjectParameter to GetObjectParameter
Since this is used for Objective-C too.
1 parent c7d9eab commit d2c0451

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,9 @@ static bool TagIsRecordType(dw_tag_t tag) {
159159
}
160160
}
161161

162-
/// Get the object parameter DIE if one exists, otherwise returns
163-
/// a default DWARFDIE. If \c containing_decl_ctx is not a valid
164-
/// C++ declaration context for class methods, assume no object
165-
/// parameter exists for the given \c subprogram.
166162
DWARFDIE
167-
DWARFASTParserClang::GetCXXObjectParameter(const DWARFDIE &subprogram,
168-
const DWARFDIE &decl_ctx_die) {
163+
DWARFASTParserClang::GetObjectParameter(const DWARFDIE &subprogram,
164+
const DWARFDIE &decl_ctx_die) {
169165
assert(subprogram);
170166
assert(subprogram.Tag() == DW_TAG_subprogram ||
171167
subprogram.Tag() == DW_TAG_inlined_subroutine ||
@@ -1305,7 +1301,7 @@ DWARFASTParserClang::ParseSubroutine(const DWARFDIE &die,
13051301
clang::CallingConv calling_convention =
13061302
ConvertDWARFCallingConventionToClang(attrs);
13071303

1308-
const DWARFDIE object_parameter = GetCXXObjectParameter(die, decl_ctx_die);
1304+
const DWARFDIE object_parameter = GetObjectParameter(die, decl_ctx_die);
13091305

13101306
// clang_type will get the function prototype clang type after this
13111307
// call
@@ -2417,7 +2413,7 @@ DWARFASTParserClang::ConstructDemangledNameFromDWARF(const DWARFDIE &die) {
24172413
assert(containing_decl_ctx);
24182414

24192415
const unsigned cv_quals =
2420-
GetCXXMethodCVQuals(die, GetCXXObjectParameter(die, decl_ctx_die));
2416+
GetCXXMethodCVQuals(die, GetObjectParameter(die, decl_ctx_die));
24212417

24222418
ParseChildParameters(containing_decl_ctx, die, is_variadic,
24232419
has_template_params, param_types, param_names);

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,19 @@ class DWARFASTParserClang : public lldb_private::plugin::dwarf::DWARFASTParser {
112112
void MapDeclDIEToDefDIE(const lldb_private::plugin::dwarf::DWARFDIE &decl_die,
113113
const lldb_private::plugin::dwarf::DWARFDIE &def_die);
114114

115-
lldb_private::plugin::dwarf::DWARFDIE GetCXXObjectParameter(
116-
const lldb_private::plugin::dwarf::DWARFDIE &subprogram,
117-
const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die);
115+
/// Get the object parameter DIE if one exists, otherwise returns
116+
/// a default DWARFDIE.
117+
///
118+
/// \param[in] subprogram DIE of function for which to get the object
119+
/// parameter. \param[in] containing_decl_ctx DIE representing declaration
120+
/// context of \a subprogram. If this DIE isn't a valid declaration context
121+
/// for class methods, assume no object parameter exists.
122+
///
123+
/// \returns DIE of object parameter if one exists.
124+
///
125+
lldb_private::plugin::dwarf::DWARFDIE
126+
GetObjectParameter(const lldb_private::plugin::dwarf::DWARFDIE &subprogram,
127+
const lldb_private::plugin::dwarf::DWARFDIE &decl_ctx_die);
118128

119129
protected:
120130
/// Protected typedefs and members.

lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,8 +898,7 @@ TEST_F(DWARFASTParserClangTests, TestParseDWARFAttributes_ObjectPointer) {
898898
auto param_die = decl_die.GetFirstChild();
899899
ASSERT_TRUE(param_die.IsValid());
900900

901-
EXPECT_EQ(param_die,
902-
ast_parser.GetCXXObjectParameter(decl_die, context_die));
901+
EXPECT_EQ(param_die, ast_parser.GetObjectParameter(decl_die, context_die));
903902
}
904903

905904
{
@@ -912,8 +911,8 @@ TEST_F(DWARFASTParserClangTests, TestParseDWARFAttributes_ObjectPointer) {
912911
auto param_die = subprogram_definition.GetFirstChild();
913912
ASSERT_TRUE(param_die.IsValid());
914913

915-
EXPECT_EQ(param_die, ast_parser.GetCXXObjectParameter(subprogram_definition,
916-
context_die));
914+
EXPECT_EQ(param_die, ast_parser.GetObjectParameter(subprogram_definition,
915+
context_die));
917916
}
918917
}
919918

0 commit comments

Comments
 (0)