@@ -1230,14 +1230,10 @@ void cpp_typecheckt::typecheck_expr_member(
12301230 if (expr.type ().id ()==ID_code)
12311231 {
12321232 // Check if the function body has to be typechecked
1233- symbol_table_baset::symbolst::const_iterator it =
1234- symbol_table.symbols .find (component_name);
1233+ symbolt &component_symbol = symbol_table.get_writeable_ref (component_name);
12351234
1236- CHECK_RETURN (it != symbol_table.symbols .end ());
1237-
1238- if (it->second .value .id () == ID_cpp_not_typechecked)
1239- symbol_table.get_writeable_ref (component_name)
1240- .value .set (ID_is_used, true );
1235+ if (component_symbol.value .id () == ID_cpp_not_typechecked)
1236+ component_symbol.value .set (ID_is_used, true );
12411237 }
12421238}
12431239
@@ -1938,9 +1934,9 @@ void cpp_typecheckt::typecheck_method_application(
19381934 exprt member_expr;
19391935 member_expr.swap (expr.function ());
19401936
1941- const symbolt &symbol= lookup (member_expr. get (ID_component_name));
1942- symbolt &method_symbol= symbol_table.get_writeable_ref (symbol. name );
1943- const symbolt &tag_symbol = lookup (symbol .type .get (ID_C_member_name));
1937+ symbolt &method_symbol =
1938+ symbol_table.get_writeable_ref (member_expr. get (ID_component_name) );
1939+ const symbolt &tag_symbol = lookup (method_symbol .type .get (ID_C_member_name));
19441940
19451941 // build the right template map
19461942 // if this is an instantiated template class method
@@ -1954,21 +1950,21 @@ void cpp_typecheckt::typecheck_method_application(
19541950 static_cast <const cpp_template_args_tct &>(template_args));
19551951 add_method_body (&method_symbol);
19561952#ifdef DEBUG
1957- std::cout << " MAP for " << symbol << " :\n " ;
1953+ std::cout << " MAP for " << method_symbol << " :\n " ;
19581954 template_map.print (std::cout);
19591955#endif
19601956 }
19611957 else
19621958 add_method_body (&method_symbol);
19631959
19641960 // build new function expression
1965- exprt new_function (cpp_symbol_expr (symbol ));
1961+ exprt new_function (cpp_symbol_expr (method_symbol ));
19661962 new_function.add_source_location ()=member_expr.source_location ();
19671963 expr.function ().swap (new_function);
19681964
19691965 if (!expr.function ().type ().get_bool (ID_C_is_static))
19701966 {
1971- const code_typet &func_type= to_code_type (symbol .type );
1967+ const code_typet &func_type = to_code_type (method_symbol .type );
19721968 typet this_type=func_type.parameters ().front ().type ();
19731969
19741970 // Special case. Make it a reference.
@@ -2002,10 +1998,10 @@ void cpp_typecheckt::typecheck_method_application(
20021998 }
20031999
20042000 if (
2005- symbol .value .id () == ID_cpp_not_typechecked &&
2006- !symbol .value .get_bool (ID_is_used))
2001+ method_symbol .value .id () == ID_cpp_not_typechecked &&
2002+ !method_symbol .value .get_bool (ID_is_used))
20072003 {
2008- symbol_table. get_writeable_ref (symbol. name ) .value .set (ID_is_used, true );
2004+ method_symbol .value .set (ID_is_used, true );
20092005 }
20102006}
20112007
@@ -2253,13 +2249,11 @@ void cpp_typecheckt::typecheck_expr_function_identifier(exprt &expr)
22532249 if (expr.id ()==ID_symbol)
22542250 {
22552251 // Check if the function body has to be typechecked
2256- symbol_table_baset::symbolst::const_iterator it =
2257- symbol_table.symbols .find (expr.get (ID_identifier));
2258-
2259- CHECK_RETURN (it != symbol_table.symbols .end ());
2252+ symbolt &function_symbol =
2253+ symbol_table.get_writeable_ref (expr.get (ID_identifier));
22602254
2261- if (it-> second .value .id () == ID_cpp_not_typechecked)
2262- symbol_table. get_writeable_ref (it-> first ) .value .set (ID_is_used, true );
2255+ if (function_symbol .value .id () == ID_cpp_not_typechecked)
2256+ function_symbol .value .set (ID_is_used, true );
22632257 }
22642258
22652259 c_typecheck_baset::typecheck_expr_function_identifier (expr);
0 commit comments