@@ -1047,8 +1047,6 @@ void ClangExpressionDeclMap::LookupInModulesDeclVendor(
1047
1047
MaybeRegisterFunctionBody (copied_function);
1048
1048
1049
1049
context.AddNamedDecl (copied_function);
1050
-
1051
- context.m_found_function_with_type_info = true ;
1052
1050
} else if (auto copied_var = dyn_cast<clang::VarDecl>(copied_decl)) {
1053
1051
context.AddNamedDecl (copied_var);
1054
1052
context.m_found_variable = true ;
@@ -1217,11 +1215,11 @@ SymbolContextList ClangExpressionDeclMap::SearchFunctionsInSymbolContexts(
1217
1215
return sc_func_list;
1218
1216
}
1219
1217
1220
- void ClangExpressionDeclMap::LookupFunction (
1218
+ bool ClangExpressionDeclMap::LookupFunction (
1221
1219
NameSearchContext &context, lldb::ModuleSP module_sp, ConstString name,
1222
1220
const CompilerDeclContext &namespace_decl) {
1223
1221
if (!m_parser_vars)
1224
- return ;
1222
+ return false ;
1225
1223
1226
1224
Target *target = m_parser_vars->m_exe_ctx .GetTargetPtr ();
1227
1225
@@ -1281,6 +1279,8 @@ void ClangExpressionDeclMap::LookupFunction(
1281
1279
}
1282
1280
}
1283
1281
1282
+ bool found_function_with_type_info = false ;
1283
+
1284
1284
if (sc_list.GetSize ()) {
1285
1285
Symbol *extern_symbol = nullptr ;
1286
1286
Symbol *non_extern_symbol = nullptr ;
@@ -1297,7 +1297,7 @@ void ClangExpressionDeclMap::LookupFunction(
1297
1297
continue ;
1298
1298
1299
1299
AddOneFunction (context, sym_ctx.function , nullptr );
1300
- context. m_found_function_with_type_info = true ;
1300
+ found_function_with_type_info = true ;
1301
1301
} else if (sym_ctx.symbol ) {
1302
1302
Symbol *symbol = sym_ctx.symbol ;
1303
1303
if (target && symbol->GetType () == eSymbolTypeReExported) {
@@ -1313,27 +1313,29 @@ void ClangExpressionDeclMap::LookupFunction(
1313
1313
}
1314
1314
}
1315
1315
1316
- if (!context. m_found_function_with_type_info ) {
1316
+ if (!found_function_with_type_info ) {
1317
1317
for (clang::NamedDecl *decl : decls_from_modules) {
1318
1318
if (llvm::isa<clang::FunctionDecl>(decl)) {
1319
1319
clang::NamedDecl *copied_decl =
1320
1320
llvm::cast_or_null<FunctionDecl>(CopyDecl (decl));
1321
1321
if (copied_decl) {
1322
1322
context.AddNamedDecl (copied_decl);
1323
- context. m_found_function_with_type_info = true ;
1323
+ found_function_with_type_info = true ;
1324
1324
}
1325
1325
}
1326
1326
}
1327
1327
}
1328
1328
1329
- if (!context. m_found_function_with_type_info ) {
1329
+ if (!found_function_with_type_info ) {
1330
1330
if (extern_symbol) {
1331
1331
AddOneFunction (context, nullptr , extern_symbol);
1332
1332
} else if (non_extern_symbol) {
1333
1333
AddOneFunction (context, nullptr , non_extern_symbol);
1334
1334
}
1335
1335
}
1336
1336
}
1337
+
1338
+ return found_function_with_type_info;
1337
1339
}
1338
1340
1339
1341
void ClangExpressionDeclMap::FindExternalVisibleDecls (
@@ -1432,10 +1434,7 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
1432
1434
}
1433
1435
}
1434
1436
1435
- LookupFunction (context, module_sp, name, namespace_decl);
1436
-
1437
- // Try the modules next.
1438
- if (!context.m_found_function_with_type_info )
1437
+ if (!LookupFunction (context, module_sp, name, namespace_decl))
1439
1438
LookupInModulesDeclVendor (context, name);
1440
1439
1441
1440
if (target && !context.m_found_variable && !namespace_decl) {
0 commit comments