IR: add more instructions

* MaybeWrap
 * TestErr
 * UnwrapErrCode
 * UnwrapErrPayload
 * ErrUnionTypeChild
 * ErrWrapCode
 * ErrWrapPayload
This commit is contained in:
Andrew Kelley
2016-12-17 16:06:48 -05:00
parent 3a3cc7bf76
commit 12fcbecbf8
8 changed files with 863 additions and 520 deletions

View File

@@ -862,10 +862,20 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
fprintf(ar->f, "const");
break;
}
case NodeTypeUnwrapErrorExpr:
{
render_node_ungrouped(ar, node->data.unwrap_err_expr.op1);
fprintf(ar->f, " %%%% ");
if (node->data.unwrap_err_expr.symbol) {
Buf *var_name = node->data.unwrap_err_expr.symbol->data.symbol_expr.symbol;
fprintf(ar->f, "|%s| ", buf_ptr(var_name));
}
render_node_ungrouped(ar, node->data.unwrap_err_expr.op2);
break;
}
case NodeTypeFnDecl:
case NodeTypeParamDecl:
case NodeTypeErrorValueDecl:
case NodeTypeUnwrapErrorExpr:
case NodeTypeStructField:
case NodeTypeUse:
case NodeTypeZeroesLiteral: