summaryrefslogtreecommitdiff
path: root/src/hir/hir.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-12-03 08:00:04 +0800
committerJohn Hodge <tpg@mutabah.net>2016-12-03 08:00:04 +0800
commit55bc4a9e019b1b5e51fec58030a30ea9146de45c (patch)
treefa17e394ab154cdb7512edc0515449969cf2b5ce /src/hir/hir.hpp
parent892b1029b5c9fa2bc12316dcf927d1aa36135538 (diff)
downloadmrust-55bc4a9e019b1b5e51fec58030a30ea9146de45c.tar.gz
HIR/MIR - VTable work
Diffstat (limited to 'src/hir/hir.hpp')
-rw-r--r--src/hir/hir.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/hir/hir.hpp b/src/hir/hir.hpp
index 6843e93d..1a933993 100644
--- a/src/hir/hir.hpp
+++ b/src/hir/hir.hpp
@@ -231,10 +231,15 @@ struct AssociatedType
::std::vector< ::HIR::TraitPath> m_trait_bounds;
::HIR::TypeRef m_default;
};
-TAGGED_UNION(TraitValueItem, Constant,
+TAGGED_UNION_EX(TraitValueItem, (), Constant, (
(Constant, Constant),
(Static, Static),
(Function, Function)
+ ),
+ (),(),
+ (
+ unsigned int vtable_ofs = ~0u;
+ )
);
struct Trait
{
@@ -247,6 +252,9 @@ struct Trait
::std::unordered_map< ::std::string, AssociatedType > m_types;
::std::unordered_map< ::std::string, TraitValueItem > m_values;
+ // Indexes in the parameter list for each associated type
+ ::std::unordered_map< ::std::string, unsigned int > m_type_indexes;
+
Trait( GenericParams gps, ::std::string lifetime, ::std::vector< ::HIR::TraitPath> parents):
m_params( mv$(gps) ),
m_lifetime( mv$(lifetime) ),