Browse Source

gcc: Fix codelet wrapper generation with GCC 4.7.

* gcc-plugin/src/starpu.c (build_codelet_wrapper_definition): Make sure
  DECL is initialized by the time `build_local_var' is called (C++).
Ludovic Courtès 13 years ago
parent
commit
91bd802f57
1 changed files with 6 additions and 6 deletions
  1. 6 6
      gcc-plugin/src/starpu.c

+ 6 - 6
gcc-plugin/src/starpu.c

@@ -1611,11 +1611,15 @@ static tree
 build_codelet_wrapper_definition (tree task_impl)
 {
   location_t loc;
-  tree task_decl, decl;
+  tree task_decl, wrapper_name, decl;
 
   loc = DECL_SOURCE_LOCATION (task_impl);
   task_decl = task_implementation_task (task_impl);
 
+  wrapper_name = build_codelet_wrapper_identifier (task_impl);
+  decl = build_decl (loc, FUNCTION_DECL, wrapper_name,
+		     build_codelet_wrapper_type ());
+
   local_define (tree, build_local_var, (const_tree type))
   {
     tree var, t;
@@ -1735,11 +1739,7 @@ build_codelet_wrapper_definition (tree task_impl)
     return chainon (param1, param2);
   };
 
-  tree wrapper_name, vars, result;
-
-  wrapper_name = build_codelet_wrapper_identifier (task_impl);
-  decl = build_decl (loc, FUNCTION_DECL, wrapper_name,
-		     build_codelet_wrapper_type ());
+  tree vars, result;
 
   vars = map (build_local_var,
 	      list_remove (void_type_p,