diff options
author | John Hodge <tpg@mutabah.net> | 2018-12-29 13:32:51 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-12-29 13:32:51 +0800 |
commit | 24086285e2b5035dd23a4e5088baeb27f7774fe9 (patch) | |
tree | 0725015e99ba3c2f492184b20663ccb850e3c222 /src/mir/cleanup.cpp | |
parent | 0a47863a680677817631f507ea6f6565b537487e (diff) | |
download | mrust-24086285e2b5035dd23a4e5088baeb27f7774fe9.tar.gz |
Lower MIR - Handing of irrefutable enum matches, some other tweaks
Diffstat (limited to 'src/mir/cleanup.cpp')
-rw-r--r-- | src/mir/cleanup.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mir/cleanup.cpp b/src/mir/cleanup.cpp index 1a15ea22..f3e987d6 100644 --- a/src/mir/cleanup.cpp +++ b/src/mir/cleanup.cpp @@ -214,8 +214,8 @@ const ::HIR::Literal* MIR_Cleanup_GetConstant(const MIR::TypeResolve& state, con TU_MATCH_DEF( ::HIR::TypeRef::Data, (ty.m_data), (te), ( if( path == ::HIR::GenericPath() ) - MIR_TODO(state, "Literal of type " << ty << " - " << path << " - " << lit); - DEBUG("Unknown type " << ty << " - Return BorrowOf"); + MIR_TODO(state, "Literal of type " << ty << " - " << lit); + DEBUG("Unknown type " << ty << ", but a path was provided - Return ItemAddr " << path); return ::MIR::Constant( mv$(path) ); ), (Tuple, @@ -454,6 +454,11 @@ const ::HIR::Literal* MIR_Cleanup_GetConstant(const MIR::TypeResolve& state, con else { MIR_TODO(state, "Const with type " << ty); } + ), + (Function, + //MIR_TODO(state, "Const function pointer " << lit << " w/ type " << ty); + MIR_ASSERT(state, lit.is_BorrowPath(), ""); + return ::MIR::Constant::make_ItemAddr( lit.as_BorrowPath().clone() ); ) ) } |