diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-05-05 12:42:57 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-05-05 12:42:57 +0800 |
commit | 4c4a7b88914861b644ec56738ced8cfc179f93f9 (patch) | |
tree | b5ab0e30b67698c4d72b224e6b695672966aaeac /src/hir/expr_ptr.cpp | |
parent | a67c91329da4e2840ee4089e5c7854f68bb8afda (diff) | |
download | mrust-4c4a7b88914861b644ec56738ced8cfc179f93f9.tar.gz |
MIR - Wrap HIR::Path-s in MIR::Constant in unique_ptr
Diffstat (limited to 'src/hir/expr_ptr.cpp')
-rw-r--r-- | src/hir/expr_ptr.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/hir/expr_ptr.cpp b/src/hir/expr_ptr.cpp index 0c219e0f..7f493a0d 100644 --- a/src/hir/expr_ptr.cpp +++ b/src/hir/expr_ptr.cpp @@ -91,11 +91,14 @@ void HIR::ExprPtr::set_mir(::MIR::FunctionPointer mir) assert( !this->m_mir ); m_mir = ::std::move(mir); // Reset the HIR tree to be a placeholder node (thus freeing the backing memory) - //if( node ) - //{ - // auto sp = node->span(); - // node = ExprPtrInner(::std::unique_ptr<HIR::ExprNode>(new ::HIR::ExprNode_Tuple(sp, {}))); - //} + if( false && node ) + { + auto sp = node->span(); + node = ExprPtrInner(::std::unique_ptr<HIR::ExprNode>(new ::HIR::ExprNode_Loop( + sp, "", + ::std::unique_ptr<HIR::ExprNode>(new ::HIR::ExprNode_Tuple(sp, {})) + ))); + } } |