Commit c73da2bf authored by Jeroen Meijer's avatar Jeroen Meijer
Browse files

dvecompile: implement maybe check using exception handling (setjmp).

parent 870850b7
This diff is collapsed.
...@@ -119,7 +119,7 @@ struct dve_compiler: public dve_explicit_system_t ...@@ -119,7 +119,7 @@ struct dve_compiler: public dve_explicit_system_t
void write_bound_check_C(dve_expression_t & expr, std::ostream & ostr, std::string state_name); void write_bound_check_C(dve_expression_t & expr, std::ostream & ostr, std::string state_name);
void write_maybe_check_C(dve_expression_t & expr, std::ostream & ostr, std::string state_name); void write_maybe_check_C(dve_expression_t & expr, std::ostream & ostr, std::string state_name);
void write_C(dve_expression_t & expr, std::ostream & ostr, std::string state_name); void write_C(dve_expression_t & expr, std::ostream & ostr, std::string state_name, bool wrap);
bool m_if_disjoint; bool m_if_disjoint;
bool m_if_empty; bool m_if_empty;
...@@ -146,7 +146,7 @@ struct dve_compiler: public dve_explicit_system_t ...@@ -146,7 +146,7 @@ struct dve_compiler: public dve_explicit_system_t
void if_cexpr_clause( dve_expression_t *expr, std::string state ) { void if_cexpr_clause( dve_expression_t *expr, std::string state ) {
if (!expr) if (!expr)
return; return;
if_clause( cexpr( *expr, state ) ); if_clause( cexpr( *expr, state, false ) );
} }
void if_end() { void if_end() {
...@@ -200,10 +200,10 @@ struct dve_compiler: public dve_explicit_system_t ...@@ -200,10 +200,10 @@ struct dve_compiler: public dve_explicit_system_t
} }
std::string cmaybe( dve_expression_t &expr, std::string state ); std::string cmaybe( dve_expression_t &expr, std::string state );
std::string cexpr( dve_expression_t &expr, std::string state ); std::string cexpr( dve_expression_t &expr, std::string state, bool wrap );
void print_cexpr( dve_expression_t &expr, std::string state ) void print_cexpr( dve_expression_t &expr, std::string state )
{ {
line( cexpr( expr, state ) + ";" ); line( cexpr( expr, state, false ) + ";" );
} }
void new_label() { void new_label() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment