X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f43536687685f8e4ff5c43fa22e571750327e5ed..30f40863fc506c7013dec1902201d4bdffe3a101:/src/mc/Variable.hpp diff --git a/src/mc/Variable.hpp b/src/mc/Variable.hpp index 31f49c9c47..bf7f86a532 100644 --- a/src/mc/Variable.hpp +++ b/src/mc/Variable.hpp @@ -7,45 +7,41 @@ #ifndef SIMGRID_MC_VARIABLE_HPP #define SIMGRID_MC_VARIABLE_HPP -#include +#include -#include +#include -#include "mc_forward.h" -#include "mc_location.h" +#include "src/mc/mc_forward.hpp" +#include "src/mc/LocationList.hpp" namespace simgrid { namespace mc { +/** A variable (global or local) in the model-checked program */ class Variable { public: - Variable(); - - unsigned dwarf_offset; /* Global offset of the field. */ - int global; + Variable() = default; + std::uint32_t id = 0; + bool global = false; std::string name; - unsigned type_id; - simgrid::mc::Type* type; + unsigned type_id = 0; + simgrid::mc::Type* type = nullptr; - // Use either of: - simgrid::mc::LocationList location_list; - void* address; + /** Address of the variable (if it is fixed) */ + void* address = nullptr; - size_t start_scope; - simgrid::mc::ObjectInformation* object_info; -}; + /** Description of the location of the variable (if it's not fixed) */ + simgrid::dwarf::LocationList location_list; -inline -Variable::Variable() -{ - this->dwarf_offset = 0; - this->global = 0; - this->type = nullptr; - this->type_id = 0; - this->address = nullptr; - this->start_scope = 0; - this->object_info = nullptr; -} + /** Offset of validity of the variable (DW_AT_start_scope) + * + * This is an offset from the variable scope beginning. This variable + * is only valid starting from this offset. + */ + std::size_t start_scope = 0; + + simgrid::mc::ObjectInformation* object_info = nullptr; +}; } }