Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / mc / Variable.hpp
index ec1e071..5f43e5c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2014. The SimGrid Team.
+/* Copyright (c) 2007-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -7,30 +7,40 @@
 #ifndef SIMGRID_MC_VARIABLE_HPP
 #define SIMGRID_MC_VARIABLE_HPP
 
+#include <cstddef>
+
 #include <string>
 
-#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() {}
+  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;
+
+  /** Address of the variable (if it is fixed) */
+  void* address = nullptr;
+
+  /** Description of the location of the variable (if it's not fixed) */
+  simgrid::dwarf::LocationList location_list;
 
-  // Use either of:
-  simgrid::mc::LocationList location_list;
-  void* address;
+  /** 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;
 
-  size_t start_scope;
-  simgrid::mc::ObjectInformation* object_info;
+  simgrid::mc::ObjectInformation* object_info = nullptr;
 };
 
 }