Skip to content

Commit

Permalink
Mark already-typechecked types as such
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Jun 11, 2018
1 parent d5183fb commit 4a47de6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/cpp/cpp_typecheck_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ void cpp_typecheckt::typecheck_decl(codet &code)
return;
}

// mark as 'already typechecked'
make_already_typechecked(type);

codet new_code(ID_decl_block);
new_code.reserve_operands(declaration.declarators().size());

Expand Down
4 changes: 4 additions & 0 deletions src/cpp/cpp_typecheck_declaration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ void cpp_typecheckt::convert_non_template_declaration(
if(!is_typedef)
elaborate_class_template(declaration_type);

// mark as 'already typechecked'
if(!declaration.declarators().empty())
make_already_typechecked(declaration_type);

// Special treatment for anonymous unions
if(declaration.declarators().empty() &&
follow(declaration.type()).get_bool(ID_C_is_anonymous))
Expand Down
4 changes: 4 additions & 0 deletions src/cpp/cpp_typecheck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ void cpp_typecheckt::typecheck_type(typet &type)
else if(type.id()==ID_nullptr)
{
}
else if(type.id()==ID_already_typechecked)
{
c_typecheck_baset::typecheck_type(type);
}
else
{
error().source_location=type.source_location();
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/cpp_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exprt cpp_symbol_expr(const symbolt &symbol);

inline void already_typechecked(irept &irep)
{
exprt tmp("already_typechecked");
exprt tmp(ID_already_typechecked);
tmp.copy_to_operands(static_cast<exprt &>(irep));
irep.swap(tmp);
}
Expand Down

0 comments on commit 4a47de6

Please sign in to comment.