23 const std::string &pattern,
24 const char *header_file,
27 std::istringstream hdr(header_file);
29 while(std::getline(hdr, line))
32 if(
has_prefix(line,
"//") || line.find(pattern) == std::string::npos)
44 const std::ostringstream &s,
48 std::istringstream in(s.str());
78 symbol_tablet::symbolst::const_iterator s_it=
79 new_symbol_table.
symbols.find(identifier);
81 if(s_it==new_symbol_table.
symbols.end())
84 message.
error() <<
"failed to produce built-in symbol '" << identifier
90 symbol_table.
add(s_it->second);
100 bool support_float16_type,
105 const std::string pattern=
' '+
id2string(identifier)+
'(';
107 std::ostringstream s;
115 return convert(identifier, s, symbol_table, mh);
121 return convert(identifier, s, symbol_table, mh);
128 return convert(identifier, s, symbol_table, mh);
135 return convert(identifier, s, symbol_table, mh);
145 return convert(identifier, s, symbol_table, mh);
148 return convert(identifier, s, symbol_table, mh);
151 return convert(identifier, s, symbol_table, mh);
154 return convert(identifier, s, symbol_table, mh);
157 return convert(identifier, s, symbol_table, mh);
160 return convert(identifier, s, symbol_table, mh);
163 return convert(identifier, s, symbol_table, mh);
170 return convert(identifier, s, symbol_table, mh);
173 return convert(identifier, s, symbol_table, mh);
176 return convert(identifier, s, symbol_table, mh);
179 return convert(identifier, s, symbol_table, mh);
182 return convert(identifier, s, symbol_table, mh);
185 return convert(identifier, s, symbol_table, mh);
193 return convert(identifier, s, symbol_table, mh);
203 return convert(identifier, s, symbol_table, mh);
210 return convert(identifier, s, symbol_table, mh);
const char cprover_builtin_headers[]
const char gcc_builtin_headers_ia32[]
const char gcc_builtin_headers_ia32_2[]
const char gcc_builtin_headers_ia32_5[]
const char gcc_builtin_headers_ubsan[]
void ansi_c_internal_additions(std::string &code, bool support_float16_type)
const char windows_builtin_headers[]
const char gcc_builtin_headers_mem_string[]
const char gcc_builtin_headers_ia32_4[]
const char gcc_builtin_headers_generic[]
const char gcc_builtin_headers_tm[]
const char cw_builtin_headers[]
const char gcc_builtin_headers_math[]
const char gcc_builtin_headers_arm[]
const char gcc_builtin_headers_ia32_6[]
const char gcc_builtin_headers_mips[]
const char clang_builtin_headers[]
const char arm_builtin_headers[]
const char gcc_builtin_headers_omp[]
const char gcc_builtin_headers_ia32_3[]
const char gcc_builtin_headers_power[]
ansi_c_parsert ansi_c_parser
void ansi_c_scanner_init()
bool ansi_c_typecheck(ansi_c_parse_treet &ansi_c_parse_tree, symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)
ANSI-C Language Type Checking.
static bool convert(const irep_idt &identifier, const std::ostringstream &s, symbol_table_baset &symbol_table, message_handlert &message_handler)
bool builtin_factory(const irep_idt &identifier, bool support_float16_type, symbol_table_baset &symbol_table, message_handlert &mh)
Check whether given identifier is a compiler built-in.
static bool find_pattern(const std::string &pattern, const char *header_file, std::ostream &out)
ansi_c_parse_treet parse_tree
virtual void clear() override
virtual bool parse() override
struct configt::ansi_ct ansi_c
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Class that provides messages with a built-in verbosity 'level'.
virtual void set_message_handler(message_handlert &_message_handler)
void set_file(const irep_idt &file)
The symbol table base class interface.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
bool add(const symbolt &symbol)
Add a new symbol to the symbol table.
bool has_prefix(const std::string &s, const std::string &prefix)
const std::string & id2string(const irep_idt &d)
std::string strip_string(const std::string &s)
Remove all whitespace characters from either end of a string.