diff options
author | John Hodge <tpg@mutabah.net> | 2018-05-12 17:54:27 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-05-12 17:54:27 +0800 |
commit | 835519441441dcff3bb39e9a82f433a37c61d6ef (patch) | |
tree | 1d406288ed9a4b0985fa8846d1d3ed9d48f87fd7 /tools/standalone_miri/module_tree.cpp | |
parent | d667b43bd5971f63d396d2a1a587743c3cfceb68 (diff) | |
download | mrust-835519441441dcff3bb39e9a82f433a37c61d6ef.tar.gz |
Standalone MIRI - Get type for statics, add some pthread_* FFI stubs
Diffstat (limited to 'tools/standalone_miri/module_tree.cpp')
-rw-r--r-- | tools/standalone_miri/module_tree.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/standalone_miri/module_tree.cpp b/tools/standalone_miri/module_tree.cpp index d62695d1..d6c7dcec 100644 --- a/tools/standalone_miri/module_tree.cpp +++ b/tools/standalone_miri/module_tree.cpp @@ -154,10 +154,12 @@ bool Parser::parse_one() } lex.check_consume(';'); - Value val = Value(ty); - val.write_bytes(0, data.data(), data.size()); + Static s; + s.val = Value(ty); + s.val.write_bytes(0, data.data(), data.size()); + s.ty = ty; - tree.statics.insert(::std::make_pair( ::std::move(p), ::std::move(val) )); + tree.statics.insert(::std::make_pair( ::std::move(p), ::std::move(s) )); } else if( lex.consume_if("type") ) { @@ -1311,7 +1313,7 @@ const Function* ModuleTree::get_function_opt(const ::HIR::Path& p) const } return &it->second; } -Value& ModuleTree::get_static(const ::HIR::Path& p) +Static& ModuleTree::get_static(const ::HIR::Path& p) { auto it = statics.find(p); if(it == statics.end()) @@ -1321,7 +1323,7 @@ Value& ModuleTree::get_static(const ::HIR::Path& p) } return it->second; } -Value* ModuleTree::get_static_opt(const ::HIR::Path& p) +Static* ModuleTree::get_static_opt(const ::HIR::Path& p) { auto it = statics.find(p); if(it == statics.end()) |