diff options
author | John Hodge <tpg@ucc.asn.au> | 2018-10-06 18:14:13 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2018-10-06 18:14:13 +0800 |
commit | 1382500b5fdba00568a86f0122bc2e78584dfb5d (patch) | |
tree | fc293328eea89d6639c4a36f268f5a1e1c826d6e /src/hir/hir.hpp | |
parent | 4a8198baca2cfcee17f83978ab71422a04d53b1a (diff) | |
parent | bd3d69813cc54439fdc0db33943fa1254db3df06 (diff) | |
download | mrust-1382500b5fdba00568a86f0122bc2e78584dfb5d.tar.gz |
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'src/hir/hir.hpp')
-rw-r--r-- | src/hir/hir.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hir/hir.hpp b/src/hir/hir.hpp index 20b9ad58..8024e1c0 100644 --- a/src/hir/hir.hpp +++ b/src/hir/hir.hpp @@ -38,6 +38,8 @@ class Static; class ValueItem; class TypeItem; +class ItemPath; + template<typename Ent> struct VisEnt { @@ -343,6 +345,8 @@ public: // Contains types, traits, and modules ::std::unordered_map< ::std::string, ::std::unique_ptr<VisEnt<TypeItem>> > m_mod_items; + ::std::vector< ::std::pair<::std::string, Static> > m_inline_statics; + Module() {} Module(const Module&) = delete; Module(Module&& x) = default; @@ -533,6 +537,15 @@ public: bool find_trait_impls(const ::HIR::SimplePath& path, const ::HIR::TypeRef& type, t_cb_resolve_type ty_res, ::std::function<bool(const ::HIR::TraitImpl&)> callback) const; bool find_auto_trait_impls(const ::HIR::SimplePath& path, const ::HIR::TypeRef& type, t_cb_resolve_type ty_res, ::std::function<bool(const ::HIR::MarkerImpl&)> callback) const; bool find_type_impls(const ::HIR::TypeRef& type, t_cb_resolve_type ty_res, ::std::function<bool(const ::HIR::TypeImpl&)> callback) const; + + const ::MIR::Function* get_or_gen_mir(const ::HIR::ItemPath& ip, const ::HIR::ExprPtr& ep, const ::HIR::Function::args_t& args, const ::HIR::TypeRef& ret_ty) const; + const ::MIR::Function* get_or_gen_mir(const ::HIR::ItemPath& ip, const ::HIR::Function& fcn) const { + return get_or_gen_mir(ip, fcn.m_code, fcn.m_args, fcn.m_return); + } + const ::MIR::Function* get_or_gen_mir(const ::HIR::ItemPath& ip, const ::HIR::ExprPtr& ep, const ::HIR::TypeRef& exp_ty) const { + static ::HIR::Function::args_t s_args; + return get_or_gen_mir(ip, ep, s_args, exp_ty); + } }; } // namespace HIR |