From 7aa0e40f91ecc7b8c6be6044e9314529cb7a4cfd Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 18 May 2019 13:46:40 +0800 Subject: Forgotten header --- src/hir_conv/constant_evaluation.hpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/hir_conv/constant_evaluation.hpp (limited to 'src') diff --git a/src/hir_conv/constant_evaluation.hpp b/src/hir_conv/constant_evaluation.hpp new file mode 100644 index 00000000..dff6e73e --- /dev/null +++ b/src/hir_conv/constant_evaluation.hpp @@ -0,0 +1,33 @@ +/* + */ +#include + +namespace HIR { + + +struct Evaluator +{ + class Newval + { + public: + virtual ::HIR::Path new_static(::HIR::TypeRef type, ::HIR::Literal value) = 0; + }; + + const Span& root_span; + StaticTraitResolve resolve; + Newval& nvs; + + Evaluator(const Span& sp, const ::HIR::Crate& crate, Newval& nvs): + root_span(sp), + resolve(crate), + nvs( nvs ) + { + } + + ::HIR::Literal evaluate_constant(const ::HIR::ItemPath& ip, const ::HIR::ExprPtr& expr, ::HIR::TypeRef exp, MonomorphState ms={}); + + ::HIR::Literal evaluate_constant_mir(const ::HIR::ItemPath& ip, const ::MIR::Function& fcn, MonomorphState ms, ::HIR::TypeRef exp, ::std::vector< ::HIR::Literal> args); +}; + +} // namespace HIR + -- cgit v1.2.3