diff options
author | John Hodge <tpg@mutabah.net> | 2016-12-14 22:33:02 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-12-14 22:33:02 +0800 |
commit | 2a45f78605089afebfaf628aac50fc5fd51dfb25 (patch) | |
tree | f3bc7e7c0118c7f9990a50b7859d0ca8e81607a5 /src/mir/optimise.cpp | |
parent | db8c101b11d5f7a926144ccdb8d156fa11944d2a (diff) | |
download | mrust-2a45f78605089afebfaf628aac50fc5fd51dfb25.tar.gz |
Consteval - Re-enabled full first-pass consteval
Diffstat (limited to 'src/mir/optimise.cpp')
-rw-r--r-- | src/mir/optimise.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mir/optimise.cpp b/src/mir/optimise.cpp index d599c07c..3086ec3f 100644 --- a/src/mir/optimise.cpp +++ b/src/mir/optimise.cpp @@ -12,6 +12,7 @@ #include <hir_typeck/static.hpp> #include <mir/helpers.hpp> #include <mir/operations.hpp> +#include <mir/visit_crate_mir.hpp> namespace { ::MIR::BasicBlockId get_new_target(const ::MIR::TypeResolve& state, ::MIR::BasicBlockId bb) @@ -173,3 +174,14 @@ void MIR_Optimise(const StaticTraitResolve& resolve, const ::HIR::ItemPath& path } } } + +void MIR_OptimiseCrate(::HIR::Crate& crate) +{ + ::MIR::OuterVisitor ov { crate, [](const auto& res, const auto& p, auto& expr, const auto& args, const auto& ty) + { + MIR_Optimise(res, p, *expr.m_mir, args, ty); + } + }; + ov.visit_crate(crate); +} + |