25 for(scopest::const_reverse_iterator it=
scopes.rbegin();
29 scopet::name_mapt::const_iterator n_it=
30 it->name_map.find(scope_name);
32 if(n_it!=it->name_map.end())
34 identifier=n_it->second.prefixed_name;
35 return n_it->second.id_class;
58 const std::string scope_name=
63 if(prefixed_name!=tag.
get(ID_identifier))
70 tag.
set(ID_identifier, prefixed_name);
83 new_declarator.
build(declarator);
94 ansi_c_declaration.
declarators().push_back(new_declarator);
103 if(!base_name.
empty())
109 bool force_root_scope=
false;
113 if(new_declarator.
type().
id()==ID_code &&
116 force_root_scope=
true;
120 force_root_scope=
true;
130 irep_idt prefixed_name=force_root_scope?
133 new_declarator.
set_name(prefixed_name);
144 ansi_c_declaration.
declarators().push_back(new_declarator);
149 if(type.
id()==ID_typedef)
151 else if(type.
id()==ID_struct ||
152 type.
id()==ID_union ||
153 type.
id()==ID_c_enum)
155 else if(type.
id()==ID_merged_type)
197 auto found = top.find(name);
198 return found != top.end() && found->second != enabled;
205 std::map<irep_idt, bool> flattened;
208 for(
const auto &pragma : pragma_set)
209 flattened[pragma.first] = pragma.second;
213 for(
const auto &pragma : flattened)
215 std::string check_name =
id2string(pragma.first);
216 std::string full_name =
217 (pragma.second ?
"enable:" :
"disable:") + check_name;
ansi_c_declarationt & to_ansi_c_declaration(exprt &expr)
bool get_is_member() const
bool get_is_parameter() const
void set_is_global(bool is_global)
const declaratorst & declarators() const
void set_name(const irep_idt &name)
irep_idt get_base_name() const
ansi_c_id_classt id_class
void pragma_cprover_pop()
Pops a level in the CPROVER pragma stack.
void set_pragma_cprover()
Tags source_location with the current CPROVER pragma stack.
bool pragma_cprover_empty()
True iff the CPROVER pragma stack is empty.
void add_declarator(exprt &declaration, irept &declarator)
std::list< std::map< const irep_idt, bool > > pragma_cprover_stack
void add_tag_with_body(irept &tag)
bool pragma_cprover_clash(const irep_idt &name, bool enabled)
Returns true iff the same check with polarity is already present at top of the stack.
static ansi_c_id_classt get_class(const typet &type)
ansi_c_id_classt lookup(const irep_idt &base_name, irep_idt &identifier, bool tag, bool label)
void pragma_cprover_push()
Pushes an empty level in the CPROVER pragma stack.
void pragma_cprover_add_check(const irep_idt &name, bool enabled)
Adds a check to the CPROVER pragma stack.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
const irep_idt & get(const irep_idt &name) const
void remove(const irep_idt &name)
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
const std::string & get_string(const irep_idt &name) const
source_locationt source_location
void add_pragma(const irep_idt &pragma)
The type of an expression, extends irept.
const std::string & id2string(const irep_idt &d)
#define PRECONDITION(CONDITION)
const type_with_subtypest & to_type_with_subtypes(const typet &type)
const type_with_subtypet & to_type_with_subtype(const typet &type)