Skip to content

Commit 69cef32

Browse files
committed
Simplify code (NFC).
llvm-svn: 369179
1 parent 0b5ecef commit 69cef32

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

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

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,32 +2502,29 @@ size_t SymbolFileDWARF::FindTypes(const std::vector<CompilerContext> &context,
25022502
m_index->GetTypes(name, die_offsets);
25032503
const size_t num_die_matches = die_offsets.size();
25042504

2505-
if (num_die_matches) {
2506-
size_t num_matches = 0;
2507-
for (size_t i = 0; i < num_die_matches; ++i) {
2508-
const DIERef &die_ref = die_offsets[i];
2509-
DWARFDIE die = GetDIE(die_ref);
2510-
2511-
if (die) {
2512-
std::vector<CompilerContext> die_context;
2513-
die.GetDeclContext(die_context);
2514-
if (die_context != context)
2515-
continue;
2505+
size_t num_matches = 0;
2506+
for (size_t i = 0; i < num_die_matches; ++i) {
2507+
const DIERef &die_ref = die_offsets[i];
2508+
DWARFDIE die = GetDIE(die_ref);
2509+
2510+
if (die) {
2511+
std::vector<CompilerContext> die_context;
2512+
die.GetDeclContext(die_context);
2513+
if (die_context != context)
2514+
continue;
25162515

2517-
Type *matching_type = ResolveType(die, true, true);
2518-
if (matching_type) {
2519-
// We found a type pointer, now find the shared pointer form our type
2520-
// list
2521-
types.InsertUnique(matching_type->shared_from_this());
2522-
++num_matches;
2523-
}
2524-
} else {
2525-
m_index->ReportInvalidDIERef(die_ref, name.GetStringRef());
2516+
Type *matching_type = ResolveType(die, true, true);
2517+
if (matching_type) {
2518+
// We found a type pointer, now find the shared pointer form our type
2519+
// list
2520+
types.InsertUnique(matching_type->shared_from_this());
2521+
++num_matches;
25262522
}
2523+
} else {
2524+
m_index->ReportInvalidDIERef(die_ref, name.GetStringRef());
25272525
}
2528-
return num_matches;
25292526
}
2530-
return 0;
2527+
return num_matches;
25312528
}
25322529

25332530
CompilerDeclContext

0 commit comments

Comments
 (0)