[Openmp-commits] [PATCH] Improve OMPT code: remove use of assignment to multiple struct fields using .fieldname

John Mellor-Crummey johnmc at rice.edu
Mon Jun 29 01:32:30 PDT 2015


Hi jcownie,

Remove use of assignment to multiple struct fields using .fieldname syntax. This doesn't work with gcc 4.8 and earlier.
Replace with elementwise field assignments.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10798

Files:
  runtime/src/kmp_tasking.c

Index: runtime/src/kmp_tasking.c
===================================================================
--- runtime/src/kmp_tasking.c
+++ runtime/src/kmp_tasking.c
@@ -758,10 +758,8 @@
 {
     task->ompt_task_info.task_id = __ompt_task_id_new(tid);
     task->ompt_task_info.function = NULL;
-    task->ompt_task_info.frame = (ompt_frame_t) {
-        .exit_runtime_frame = NULL,
-        .reenter_runtime_frame = NULL
-    };
+    task->ompt_task_info.frame.exit_runtime_frame = NULL;
+    task->ompt_task_info.frame.reenter_runtime_frame = NULL;
 }
 #endif
 
@@ -1035,8 +1033,8 @@
     if (ompt_status & ompt_status_track) {
         taskdata->ompt_task_info.task_id = __ompt_task_id_new(gtid);
         taskdata->ompt_task_info.function = (void*) task_entry;
-        taskdata->ompt_task_info.frame = (ompt_frame_t)
-            { .exit_runtime_frame = NULL, .reenter_runtime_frame = NULL };
+        taskdata->ompt_task_info.frame.exit_runtime_frame = NULL; 
+        taskdata->ompt_task_info.frame.reenter_runtime_frame = NULL;
     }
 #endif

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10798.28649.patch
Type: text/x-patch
Size: 1047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20150629/f0d9eb2f/attachment.bin>


More information about the Openmp-commits mailing list