IR: support setDebugSafety builtin function

This commit is contained in:
Andrew Kelley
2016-11-18 20:57:27 -05:00
parent ed31ae8867
commit bf7cde62c5
6 changed files with 168 additions and 77 deletions

View File

@@ -669,6 +669,17 @@ static void render_node(AstRender *ar, AstNode *node) {
render_node(ar, node->data.while_expr.body);
break;
}
case NodeTypeThisLiteral:
{
fprintf(ar->f, "this");
break;
}
case NodeTypeBoolLiteral:
{
const char *bool_str = node->data.bool_literal.value ? "true" : "false";
fprintf(ar->f, "%s", bool_str);
break;
}
case NodeTypeFnDecl:
case NodeTypeParamDecl:
case NodeTypeErrorValueDecl:
@@ -677,10 +688,8 @@ static void render_node(AstRender *ar, AstNode *node) {
case NodeTypeStructField:
case NodeTypeStructValueField:
case NodeTypeUse:
case NodeTypeBoolLiteral:
case NodeTypeNullLiteral:
case NodeTypeZeroesLiteral:
case NodeTypeThisLiteral:
case NodeTypeIfBoolExpr:
case NodeTypeIfVarExpr:
case NodeTypeForExpr: