瀏覽代碼

gcc: Move `read_pragma_expressions' to utils.c.

* gcc-plugin/src/starpu.c (read_pragma_expressions): Move to...
* gcc-plugin/src/utils.c (read_pragma_expressions): ... here.
* gcc-plugin/src/utils.h (read_pragma_expressions): New declaration.
Ludovic Courtès 12 年之前
父節點
當前提交
bca1705007
共有 3 個文件被更改,包括 22 次插入22 次删除
  1. 0 22
      gcc-plugin/src/starpu.c
  2. 20 0
      gcc-plugin/src/utils.c
  3. 2 0
      gcc-plugin/src/utils.h

+ 0 - 22
gcc-plugin/src/starpu.c

@@ -66,11 +66,6 @@
 #define STARPU_DONT_INCLUDE_CUDA_HEADERS
 
 
-/* C expression parser, possibly with C++ linkage.  */
-
-extern int yyparse (location_t, const char *, tree *);
-extern int yydebug;
-
 #ifndef STRINGIFY
 # define STRINGIFY_(x) # x
 # define STRINGIFY(x)  STRINGIFY_ (x)
@@ -660,23 +655,6 @@ handle_pragma_wait (struct cpp_reader *reader)
     }
 }
 
-/* The minimal C expression parser.  */
-
-/* Parse expressions from the CPP reader for PRAGMA, which is located at LOC.
-   Return a TREE_LIST of C expressions.  */
-
-static tree
-read_pragma_expressions (const char *pragma, location_t loc)
-{
-  tree expr = NULL_TREE;
-
-  if (yyparse (loc, pragma, &expr))
-    /* Parse error or memory exhaustion.  */
-    expr = NULL_TREE;
-
-  return expr;
-}
-
 /* Build a `starpu_vector_data_register' call for the COUNT elements pointed
    to by POINTER.  */
 

+ 20 - 0
gcc-plugin/src/utils.c

@@ -42,3 +42,23 @@ task_p (const_tree decl)
 	  lookup_attribute (task_attribute_name,
 			    DECL_ATTRIBUTES (decl)) != NULL_TREE);
 }
+
+/* C expression parser, possibly with C++ linkage.  */
+
+extern int yyparse (location_t, const char *, tree *);
+extern int yydebug;
+
+/* Parse expressions from the CPP reader for PRAGMA, which is located at LOC.
+   Return a TREE_LIST of C expressions.  */
+
+tree
+read_pragma_expressions (const char *pragma, location_t loc)
+{
+  tree expr = NULL_TREE;
+
+  if (yyparse (loc, pragma, &expr))
+    /* Parse error or memory exhaustion.  */
+    expr = NULL_TREE;
+
+  return expr;
+}

+ 2 - 0
gcc-plugin/src/utils.h

@@ -51,6 +51,8 @@ extern bool verbose_output_p;
 extern const char task_attribute_name[];
 extern bool task_p (const_tree decl);
 
+extern tree read_pragma_expressions (const char *pragma, location_t loc);
+
 
 #include <tree.h>