summaryrefslogtreecommitdiff
path: root/tools/standalone_miri/module_tree.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-02-11 21:57:10 +0800
committerJohn Hodge <tpg@mutabah.net>2018-02-11 21:57:10 +0800
commita3a0c6437302c60bd6f521fc11e30c0a16bd79fc (patch)
tree83b536f1d5b170a88417015ec0a7f378ab6ea4c4 /tools/standalone_miri/module_tree.hpp
parent14fea32f414df2d1e0b8e2669c8fe13132210ae9 (diff)
downloadmrust-a3a0c6437302c60bd6f521fc11e30c0a16bd79fc.tar.gz
Standalone MIRI - Implementation sprint, statics in process.
Diffstat (limited to 'tools/standalone_miri/module_tree.hpp')
-rw-r--r--tools/standalone_miri/module_tree.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/standalone_miri/module_tree.hpp b/tools/standalone_miri/module_tree.hpp
index ce831621..96a77718 100644
--- a/tools/standalone_miri/module_tree.hpp
+++ b/tools/standalone_miri/module_tree.hpp
@@ -10,8 +10,11 @@
#include "../../src/mir/mir.hpp"
#include "hir_sim.hpp"
+struct Value;
+
struct Function
{
+ ::HIR::Path my_path;
::std::vector<::HIR::TypeRef> args;
::HIR::TypeRef ret_ty;
::MIR::Function m_mir;
@@ -25,6 +28,9 @@ class ModuleTree
::std::set<::std::string> loaded_files;
::std::map<::HIR::Path, Function> functions;
+ ::std::map<::HIR::Path, Value> statics;
+ // TODO: statics
+
// Hack: Tuples are stored as `::""::<A,B,C,...>`
::std::map<::HIR::GenericPath, ::std::unique_ptr<DataType>> data_types;
public:
@@ -34,6 +40,9 @@ public:
::HIR::SimplePath find_lang_item(const char* name) const;
const Function& get_function(const ::HIR::Path& p) const;
+ const Function* get_function_opt(const ::HIR::Path& p) const;
+ Value& get_static(const ::HIR::Path& p);
+ Value* get_static_opt(const ::HIR::Path& p);
};
// struct/union/enum