diff sources/c_parser_postfix_expression.c @ 1:aa09c34b90d3

add quicksort_for_pcc add sources, figures.
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Mon, 01 Feb 2010 20:37:36 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sources/c_parser_postfix_expression.c	Mon Feb 01 20:37:36 2010 +0900
@@ -0,0 +1,26 @@
+case RID_CbC_RET:
+
+  stmt = c_begin_stmt_expr ();
+
+  /* create label declaration.  */
+  label = get_identifier ("_cbc_exit0");
+  tlab = declare_label (label);
+  add_stmt (build_stmt (DECL_EXPR, tlab));
+
+  /* declare retval.  (int retval;) */
+  tree decl_cond =
+      build_decl(VAR_DECL,get_identifier ("retval"),
+                 TREE_TYPE(current_function_decl));
+  pushdecl (decl_cond);
+
+  /* define nested function.  */
+  decl = cbc_define_nested_code(label, decl_cond);
+
+  /* define if-ed goto label and return statement. */
+  cbc_define_if_closed_goto (label, decl_cond);
+
+  /* get pointer to nested function.  */
+  value = build_addr (decl , current_function_decl);
+  add_stmt (value);
+
+  expr.value = c_finish_stmt_expr (stmt);