diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-05-18 13:46:40 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-05-18 13:46:40 +0800 |
commit | 7aa0e40f91ecc7b8c6be6044e9314529cb7a4cfd (patch) | |
tree | 708e793f2f24daa6ecfc546013043f7169604a94 /src | |
parent | c4b5f0abb1b67e7f691c105841ce6e37fe2b0432 (diff) | |
download | mrust-7aa0e40f91ecc7b8c6be6044e9314529cb7a4cfd.tar.gz |
Forgotten header
Diffstat (limited to 'src')
-rw-r--r-- | src/hir_conv/constant_evaluation.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
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 <hir/hir.hpp> + +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 + |