Skip to content
  • Alexey Bataev's avatar
    [OPENMP 4.5] Fixed codegen for 'priority' and destructors in task-based · 60f07699
    Alexey Bataev authored
    directives.
    
    'kmp_task_t' record type added a new field for 'priority' clause and
    changed the representation of pointer to destructors for privates used
    within loop-based directives.
    Old representation:
    
    typedef struct kmp_task {                   /* GEH: Shouldn't this be
    aligned somehow? */
      void *shareds;                            /**< pointer to block of
        pointers to shared vars   */
      kmp_routine_entry_t routine;              /**< pointer to routine
        to call for executing task */
      kmp_int32 part_id;                        /**< part id for the
        task                          */
      kmp_routine_entry_t destructors;        /* pointer to function to
      invoke deconstructors of firstprivate C++ objects */
      /*  private vars  */
    } kmp_task_t;
    
    New representation:
    
    typedef struct kmp_task {                   /* GEH: Shouldn't this be
    aligned somehow? */
      void *shareds;                            /**< pointer to block of
        pointers to shared vars   */
      kmp_routine_entry_t routine;              /**< pointer to routine
        to call for executing task */
      kmp_int32 part_id;                        /**< part id for the
        task                          */
      kmp_cmplrdata_t data1; /* Two known
    optional additions: destructors and priority */
      kmp_cmplrdata_t data2; /* Process
    destructors first, priority second */
    /* future data */
      /*  private vars  */
    } kmp_task_t;
    
    Also excessive initialization of 'destructors' fields to 'null' was
    removed from codegen if it is known that no destructors shal be used.
    Currently a special bit is used in 'kmp_tasking_flags_t' bitfields
    ('destructors_thunk' bitfield).
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271201 91177308-0d34-0410-b5e6-96231b3b80d8
    60f07699