1#ifndef ESBMC_JIMPLE_AST_H
2#define ESBMC_JIMPLE_AST_H
10#include <nlohmann/json.hpp>
13using json = nlohmann::json;
61 const std::string &name,
62 const std::string &
id,
63 const std::string function_name =
"")
85 const std::string &class_name,
86 const std::string &function_name)
88 static unsigned int counter = 0;
94 "return_value$tmp$" + std::to_string(counter++));
95 name =
"return_value$tmp$";
100 tmp_symbol.lvalue =
true;
101 tmp_symbol.static_lifetime =
false;
102 tmp_symbol.is_extern =
false;
103 tmp_symbol.file_local =
true;
117 std::string allocation_function =
"malloc";
125 symbol.
name = allocation_function;
126 symbol.
id = allocation_function;
142 std::string func =
"__ESBMC_get_object_size";
171 std::ostringstream oss;
172 oss << class_name <<
":" << function_name;
187 std::string class_name,
188 std::string function_name,
191 std::ostringstream oss;
206 if (!function_name.empty())
type2tc get_empty_type()
Definition c_types.cpp:424
type2tc uint_type2()
Definition c_types.cpp:80
Base interface for Jimple AST.
Definition jimple_ast.h:19
static std::string get_method_name(std::string class_name, std::string function_name)
Get the unique method name.
Definition jimple_ast.h:169
int line_location
instruction location
Definition jimple_ast.h:213
virtual void from_json(const json &)=0
Initializes the current instance by parsing a JSON.
static symbolt get_allocation_function()
Get the allocation function symbol.
Definition jimple_ast.h:115
static std::string get_symbol_name(std::string class_name, std::string function_name, std::string symbol)
Get the symbol name id.
Definition jimple_ast.h:186
static symbolt create_jimple_symbolt(const type2tc &t, const std::string &module, const std::string &name, const std::string &id, const std::string function_name="")
creates a symbol with the default characteristics
Definition jimple_ast.h:58
void dump() const
Prints the contents into the the stdout.
Definition jimple_ast.h:25
static locationt get_location(const std::string &module, const std::string function_name="")
initialize a location for the symbol
Definition jimple_ast.h:202
static symbolt get_lengthof_function()
Get the esbmc_get_object_size symbol.
Definition jimple_ast.h:140
static symbolt get_temp_symbol(const type2tc &t, const std::string &class_name, const std::string &function_name)
Create a temporary variable to be used.
Definition jimple_ast.h:83
virtual std::string to_string() const =0
Converts the object into a string.
void set_file(const irep_idt &file)
Definition location.h:31
void set_function(const irep_idt &function)
Definition location.h:56
bool is_extern
Definition symbol.h:24
bool file_local
Definition symbol.h:24
irep_idt module
Definition symbol.h:16
locationt location
Definition symbol.h:14
irep_idt id
Definition symbol.h:15
irep_idt name
Definition symbol.h:17
void set_type(const typet &t)
Definition symbol.cpp:60
irep_idt mode
Definition symbol.h:18
irep_container< type2t > type2tc
Definition irep2.h:430
void from_json(const json &j, jimple_ast &p)
Definition jimple_file.cpp:14
void to_json(json &, const jimple_ast &)
Definition jimple_file.cpp:9
nlohmann::json json
Definition json.cpp:12
#define log_debug(mod, fmt,...)
Definition message.h:104