summaryrefslogtreecommitdiff
path: root/src/hir_expand/annotate_value_usage.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2018-09-22 16:25:01 +0800
committerJohn Hodge <tpg@ucc.asn.au>2018-09-22 16:25:01 +0800
commit5c63b46f8dca1d65c1906c77169555229ab07412 (patch)
tree5580be06c7a535c3b46bdc3ae9f766697aa1158b /src/hir_expand/annotate_value_usage.cpp
parentdd4e3c887fa2eef2db6fa2795d4283636a1cc26e (diff)
downloadmrust-5c63b46f8dca1d65c1906c77169555229ab07412.tar.gz
All - Generate MIR for constant evaluation (has too many const_cast calls, but it's less ugly)
- Also includes some MIR optimisation changes to reduce some compile times (hopefully) - Removed duplicated MIR consteval and now-unused HIR consteval
Diffstat (limited to 'src/hir_expand/annotate_value_usage.cpp')
-rw-r--r--src/hir_expand/annotate_value_usage.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/hir_expand/annotate_value_usage.cpp b/src/hir_expand/annotate_value_usage.cpp
index 58a4604a..693c7745 100644
--- a/src/hir_expand/annotate_value_usage.cpp
+++ b/src/hir_expand/annotate_value_usage.cpp
@@ -10,6 +10,7 @@
#include <hir_typeck/static.hpp>
#include <algorithm>
#include "main_bindings.hpp"
+#include <hir/expr_state.hpp>
namespace {
@@ -654,6 +655,16 @@ namespace {
};
}
+void HIR_Expand_AnnotateUsage_Expr(const ::HIR::Crate& crate, ::HIR::ExprPtr& exp)
+{
+ assert(exp);
+ StaticTraitResolve resolve { crate };
+ if(exp.m_state->m_impl_generics) resolve.set_impl_generics(*exp.m_state->m_impl_generics);
+ if(exp.m_state->m_item_generics) resolve.set_item_generics(*exp.m_state->m_item_generics);
+ ExprVisitor_Mark ev { resolve };
+ ev.visit_root(exp);
+}
+
void HIR_Expand_AnnotateUsage(::HIR::Crate& crate)
{
OuterVisitor ov(crate);