home *** CD-ROM | disk | FTP | other *** search
- # include "Init.h"
- # include "yyAInit.w"
- # include <stdio.h>
- # if defined __STDC__ | defined __cplusplus
- # include <stdlib.h>
- # else
- extern void exit ();
- # endif
- # include "Tree.h"
- # include "Definiti.h"
-
- # ifndef NULL
- # define NULL 0L
- # endif
- # ifndef false
- # define false 0
- # endif
- # ifndef true
- # define true 1
- # endif
-
- # ifdef yyInline
- # define yyALLOC(tree, free, max, alloc, nodesize, make, ptr, kind) \
- if ((ptr = (tree) free) >= (tree) max) ptr = alloc (); \
- free += nodesize [kind]; \
- ptr->yyHead.yyMark = 0; \
- ptr->Kind = kind;
- # else
- # define yyALLOC(tree, free, max, alloc, nodesize, make, ptr, kind) ptr = make (kind);
- # endif
-
- # define yyWrite(s) (void) fputs (s, yyf)
- # define yyWriteNl (void) fputc ('\n', yyf)
-
- # line 29 "AdaptInit.puma"
-
- # include <stdio.h>
- # include "Idents.h"
- # include "StringMe.h"
-
- # include "protocol.h"
-
- # include "Types.h"
- # include "Transfor.h" /* CombineACF, ... */
- # include "Shapes.h"
- # include "TempScal.h" /* TempScalarsInitBody, TempScalarsDoneBody */
- # include "F77.h"
-
- tTree NewAllocates;
- tTree NewDeAllocates;
-
- int forall_loops; /* no reductions in FORALL */
-
-
-
- static FILE * yyf = stdout;
-
- static void yyAbort
- # ifdef __cplusplus
- (char * yyFunction)
- # else
- (yyFunction) char * yyFunction;
- # endif
- {
- (void) fprintf (stderr, "Error: module AdaptInit, routine %s failed\n", yyFunction);
- exit (1);
- }
-
- void AdaptInit ARGS((tTree t));
- static void ChangeDistributedArrays ARGS((tTree t));
- static void ChangeVarDecl ARGS((tTree t, tDefinitions Obj));
- static void MakeTreeAllocatable ARGS((tTree val));
- static tTree MakeAllocate ARGS((tTree t));
- static tTree MakeDeallocate ARGS((tTree t));
- static tTree AdaptInitACF ARGS((tTree t));
- static tTree AdaptInitAssign ARGS((tTree assign, int rankvar, int rankexp));
- static bool TranslateArrayOperation ARGS((tTree var, tTree exp, int moves));
-
- void AdaptInit
- # if defined __STDC__ | defined __cplusplus
- (register tTree t)
- # else
- (t)
- register tTree t;
- # endif
- {
- if (t == NoTree) return;
- if (t->Kind == kCOMP_UNIT) {
- # line 62 "AdaptInit.puma"
- {
- # line 63 "AdaptInit.puma"
- open_protocol ("adaptor.ini");
- # line 64 "AdaptInit.puma"
- AdaptInit (t->COMP_UNIT.COMP_ELEMENTS);
- # line 65 "AdaptInit.puma"
- close_protocol ();
- }
- return;
-
- }
- if (t->Kind == kDECL_EMPTY) {
- # line 68 "AdaptInit.puma"
- return;
-
- }
- if (t->Kind == kDECL_LIST) {
- if (t->DECL_LIST.Elem->Kind == kPROGRAM_DECL) {
- # line 71 "AdaptInit.puma"
- {
- tDefinitions Obj;
- {
- # line 72 "AdaptInit.puma"
- set_protocol_unit (t->DECL_LIST.Elem);
- # line 73 "AdaptInit.puma"
-
- # line 74 "AdaptInit.puma"
- Obj = GetDeclEntry (t->DECL_LIST.Elem->PROGRAM_DECL.Name, GetUnitEntries ());
- # line 75 "AdaptInit.puma"
- OpenScope (Obj->ProcObject.Declarations);
- # line 76 "AdaptInit.puma"
- AdaptInit (t->DECL_LIST.Elem->PROGRAM_DECL.PROGRAM_BODY);
- # line 77 "AdaptInit.puma"
- if (! (Obj->ProcObject.Declarations = GetCurrentScope ())) goto yyL3;
- {
- # line 78 "AdaptInit.puma"
- CloseScope ();
- # line 79 "AdaptInit.puma"
- AdaptInit (t->DECL_LIST.Next);
- }
- }
- return;
- }
- yyL3:;
-
- }
- if (t->DECL_LIST.Elem->Kind == kPROC_DECL) {
- # line 82 "AdaptInit.puma"
- {
- tDefinitions Obj;
- {
- # line 83 "AdaptInit.puma"
- set_protocol_unit (t->DECL_LIST.Elem);
- # line 84 "AdaptInit.puma"
-
- # line 85 "AdaptInit.puma"
- Obj = GetDeclEntry (t->DECL_LIST.Elem->PROC_DECL.Name, GetUnitEntries ());
- # line 86 "AdaptInit.puma"
- OpenScope (Obj->ProcObject.Declarations);
- # line 87 "AdaptInit.puma"
- AdaptInit (t->DECL_LIST.Elem->PROC_DECL.PROC_BODY);
- # line 88 "AdaptInit.puma"
- if (! (Obj->ProcObject.Declarations = GetCurrentScope ())) goto yyL4;
- {
- # line 89 "AdaptInit.puma"
- CloseScope ();
- # line 90 "AdaptInit.puma"
- AdaptInit (t->DECL_LIST.Next);
- }
- }
- return;
- }
- yyL4:;
-
- }
- if (t->DECL_LIST.Elem->Kind == kFUNC_DECL) {
- # line 93 "AdaptInit.puma"
- {
- tDefinitions Obj;
- {
- # line 94 "AdaptInit.puma"
- set_protocol_unit (t->DECL_LIST.Elem);
- # line 95 "AdaptInit.puma"
-
- # line 96 "AdaptInit.puma"
- Obj = GetDeclEntry (t->DECL_LIST.Elem->FUNC_DECL.Name, GetUnitEntries ());
- # line 97 "AdaptInit.puma"
- OpenScope (Obj->FuncObject.Declarations);
- # line 98 "AdaptInit.puma"
- AdaptInit (t->DECL_LIST.Elem->FUNC_DECL.FUNC_BODY);
- # line 99 "AdaptInit.puma"
- if (! (Obj->FuncObject.Declarations = GetCurrentScope ())) goto yyL5;
- {
- # line 100 "AdaptInit.puma"
- CloseScope ();
- # line 101 "AdaptInit.puma"
- AdaptInit (t->DECL_LIST.Next);
- }
- }
- return;
- }
- yyL5:;
-
- }
- if (t->DECL_LIST.Elem->Kind == kBLOCK_DATA_DECL) {
- # line 104 "AdaptInit.puma"
- {
- tDefinitions Obj;
- {
- # line 105 "AdaptInit.puma"
- set_protocol_unit (t->DECL_LIST.Elem);
- # line 106 "AdaptInit.puma"
-
- # line 107 "AdaptInit.puma"
- Obj = GetDeclEntry (t->DECL_LIST.Elem->BLOCK_DATA_DECL.Name, GetUnitEntries ());
- # line 108 "AdaptInit.puma"
- OpenScope (Obj->BlockObject.Declarations);
- # line 109 "AdaptInit.puma"
- AdaptInit (t->DECL_LIST.Elem->BLOCK_DATA_DECL.DATA_BODY);
- # line 110 "AdaptInit.puma"
- if (! (Obj->BlockObject.Declarations = GetCurrentScope ())) goto yyL6;
- {
- # line 111 "AdaptInit.puma"
- CloseScope ();
- # line 112 "AdaptInit.puma"
- AdaptInit (t->DECL_LIST.Next);
- }
- }
- return;
- }
- yyL6:;
-
- }
- }
- if (t->Kind == kBODY_NODE) {
- # line 115 "AdaptInit.puma"
- {
- # line 116 "AdaptInit.puma"
- ChangeDistributedArrays (t);
- # line 117 "AdaptInit.puma"
- forall_loops = 0;
- # line 118 "AdaptInit.puma"
- if (! (AdaptInitACF (t))) goto yyL7;
- }
- return;
- yyL7:;
-
- }
- ;
- }
-
- static void ChangeDistributedArrays
- # if defined __STDC__ | defined __cplusplus
- (register tTree t)
- # else
- (t)
- register tTree t;
- # endif
- {
- # line 144 "AdaptInit.puma"
-
- tObject Obj;
-
- if (t == NoTree) return;
- if (t->Kind == kBODY_NODE) {
- # line 148 "AdaptInit.puma"
- {
- # line 149 "AdaptInit.puma"
- NewAllocates = NoTree;
- NewDeAllocates = mACF_EMPTY();
- ChangeDistributedArrays (t->BODY_NODE.DECLS);
-
- t->BODY_NODE.STATS = CombineACF (t->BODY_NODE.STATS, NewDeAllocates);
- t->BODY_NODE.STATS = CombineACF (NewAllocates, t->BODY_NODE.STATS);
-
- }
- return;
-
- }
- if (t->Kind == kDECL_LIST) {
- # line 158 "AdaptInit.puma"
- {
- # line 159 "AdaptInit.puma"
- ChangeDistributedArrays (t->DECL_LIST.Elem);
- # line 160 "AdaptInit.puma"
- ChangeDistributedArrays (t->DECL_LIST.Next);
- }
- return;
-
- }
- if (t->Kind == kDECL_EMPTY) {
- # line 163 "AdaptInit.puma"
- return;
-
- }
- if (t->Kind == kVAR_DECL) {
- if (t->VAR_DECL.VAL->Kind == kARRAY_TYPE) {
- # line 167 "AdaptInit.puma"
- {
- # line 168 "AdaptInit.puma"
- ChangeVarDecl (t, GetLocalDecl (t->VAR_DECL.Name));
- }
- return;
-
- }
- }
- # line 171 "AdaptInit.puma"
- return;
-
- ;
- }
-
- static void ChangeVarDecl
- # if defined __STDC__ | defined __cplusplus
- (register tTree t, register tDefinitions Obj)
- # else
- (t, Obj)
- register tTree t;
- register tDefinitions Obj;
- # endif
- {
- if (t == NoTree) return;
- if (Obj == NoDefinitions) return;
- if (t->Kind == kVAR_DECL) {
- if (Obj->Kind == kVarObject) {
- if (Obj->VarObject.Kind->Kind == kVarLocal) {
- if (Obj->VarObject.Dist->Kind == kNodeDistribution) {
- # line 190 "AdaptInit.puma"
- {
- # line 193 "AdaptInit.puma"
- if (! (Obj->VarObject.Kind->VarLocal.dynamic != arr_allocatable)) goto yyL1;
- {
- # line 195 "AdaptInit.puma"
- if (! (((Obj->VarObject.Kind->VarLocal.dynamic != arr_fixed_size) || (array_kind == DYNAMIC_ARRAYS)))) goto yyL1;
- {
- # line 200 "AdaptInit.puma"
- NewAllocates = CombineACF (NewAllocates, mACF_LIST (MakeAllocate (t), NoTree));
- # line 203 "AdaptInit.puma"
- NewDeAllocates = CombineACF (MakeDeallocate (t), NewDeAllocates);
- # line 205 "AdaptInit.puma"
- if (Obj->VarObject.Kind->VarLocal.dynamic != 1)
- tree_protocol ("automatic distributed array -> allocatable\n", t);
- else
- tree_protocol ("static distributed array -> allocatable\n", t);
-
- # line 210 "AdaptInit.puma"
- MakeTreeAllocatable (t->VAR_DECL.VAL);
- }
- }
- }
- return;
- yyL1:;
-
- }
- # line 219 "AdaptInit.puma"
- {
- # line 222 "AdaptInit.puma"
- if (! (Obj->VarObject.Kind->VarLocal.dynamic == 1)) goto yyL2;
- {
- # line 223 "AdaptInit.puma"
- if (! (array_kind == STATIC_ARRAYS)) goto yyL2;
- {
- # line 225 "AdaptInit.puma"
- NewAllocates = CombineACF (NewAllocates, mACF_LIST (MakeAllocate (t), NoTree));
- # line 228 "AdaptInit.puma"
- NewDeAllocates = CombineACF (MakeDeallocate (t), NewDeAllocates);
- # line 230 "AdaptInit.puma"
- tree_protocol ("automatic host/repl array -> allocatable\n", t);
- # line 232 "AdaptInit.puma"
- MakeTreeAllocatable (t->VAR_DECL.VAL);
- }
- }
- }
- return;
- yyL2:;
-
- }
- # line 236 "AdaptInit.puma"
- return;
-
- }
- }
- ;
- }
-
- static void MakeTreeAllocatable
- # if defined __STDC__ | defined __cplusplus
- (register tTree val)
- # else
- (val)
- register tTree val;
- # endif
- {
- if (val == NoTree) return;
- if (val->Kind == kARRAY_TYPE) {
- # line 248 "AdaptInit.puma"
- {
- # line 249 "AdaptInit.puma"
- MakeTreeAllocatable (val->ARRAY_TYPE.ARRAY_INDEX_TYPES);
- }
- return;
-
- }
- if (val->Kind == kTYPE_LIST) {
- if (val->TYPE_LIST.Elem->Kind == kINDEX_TYPE) {
- # line 252 "AdaptInit.puma"
- {
- tTree new;
- {
- # line 253 "AdaptInit.puma"
-
- # line 254 "AdaptInit.puma"
- new = mDYNAMIC ();
-
- new->DYNAMIC.left_overlap = val->TYPE_LIST.Elem->INDEX_TYPE.left_overlap;
- new->DYNAMIC.right_overlap = val->TYPE_LIST.Elem->INDEX_TYPE.right_overlap;
- val->TYPE_LIST.Elem = new;
-
- # line 260 "AdaptInit.puma"
- MakeTreeAllocatable (val->TYPE_LIST.Next);
- }
- return;
- }
-
- }
- }
- if (val->Kind == kTYPE_EMPTY) {
- # line 263 "AdaptInit.puma"
- return;
-
- }
- # line 266 "AdaptInit.puma"
- {
- # line 267 "AdaptInit.puma"
- printf ("Error in MakeTreeAllocatable: illegal array type\n");
- # line 268 "AdaptInit.puma"
- FileUnparse (stdout, val);
- # line 269 "AdaptInit.puma"
- WriteTree (stdout, val);
- # line 270 "AdaptInit.puma"
- kill_in_protocol ();
- }
- return;
-
- ;
- }
-
- static tTree MakeAllocate
- # if defined __STDC__ | defined __cplusplus
- (register tTree t)
- # else
- (t)
- register tTree t;
- # endif
- {
- # line 283 "AdaptInit.puma"
-
- tTree param, v, h;
-
- if (t->Kind == kVAR_DECL) {
- if (t->VAR_DECL.VAL->Kind == kARRAY_TYPE) {
- # line 287 "AdaptInit.puma"
- {
- # line 288 "AdaptInit.puma"
- param = MakeAllocate (t->VAR_DECL.VAL->ARRAY_TYPE.ARRAY_INDEX_TYPES);
- v = mVAR_OBJ (0, t->VAR_DECL.Name);
- v->VAR_OBJ.Object = GetLocalDecl (t->VAR_DECL.Name);
- param = mINDEXED_VAR (mUSED_VAR (v), param);
- param = mBTP_LIST (mVAR_PARAM (param), mBTP_EMPTY());
- h = mACF_BASIC (mALLOCATE_STMT (param, mDUMMY_VAR()));
-
- }
- return h;
-
- }
- }
- if (t->Kind == kTYPE_LIST) {
- # line 298 "AdaptInit.puma"
- return mBTE_LIST (MakeAllocate (t->TYPE_LIST.Elem), MakeAllocate (t->TYPE_LIST.Next));
-
- }
- if (t->Kind == kTYPE_EMPTY) {
- # line 302 "AdaptInit.puma"
- return mBTE_EMPTY ();
-
- }
- if (t->Kind == kINDEX_TYPE) {
- # line 306 "AdaptInit.puma"
- return (mSLICE_EXP (t->INDEX_TYPE.LOWER, t->INDEX_TYPE.UPPER, mDUMMY_EXP ()));
-
- }
- # line 310 "AdaptInit.puma"
- {
- # line 311 "AdaptInit.puma"
- printf ("Make Allocate failed\n");
- # line 312 "AdaptInit.puma"
- FileUnparse (stdout, t);
- # line 313 "AdaptInit.puma"
- WriteTree (stdout, t);
- # line 314 "AdaptInit.puma"
- kill_in_protocol ();
- }
- return NoTree;
-
- }
-
- static tTree MakeDeallocate
- # if defined __STDC__ | defined __cplusplus
- (register tTree t)
- # else
- (t)
- register tTree t;
- # endif
- {
- # line 328 "AdaptInit.puma"
-
- tTree h, param;
-
- if (t->Kind == kVAR_DECL) {
- if (t->VAR_DECL.VAL->Kind == kARRAY_TYPE) {
- # line 332 "AdaptInit.puma"
- {
- # line 333 "AdaptInit.puma"
- param = mVAR_OBJ (0, t->VAR_DECL.Name);
- param->VAR_OBJ.Object = GetLocalDecl (t->VAR_DECL.Name);
- param = mUSED_VAR (param);
- param = mBTP_LIST (mVAR_PARAM (param), mBTP_EMPTY());
- h = mACF_BASIC (mDEALLOCATE_STMT (param, mDUMMY_VAR()));
-
- }
- return h;
-
- }
- }
- yyAbort ("MakeDeallocate");
- }
-
- static tTree AdaptInitACF
- # if defined __STDC__ | defined __cplusplus
- (register tTree t)
- # else
- (t)
- register tTree t;
- # endif
- {
- # line 350 "AdaptInit.puma"
-
- int i;
- tTree newacf;
-
-
- switch (t->Kind) {
- case kBODY_NODE:
- # line 355 "AdaptInit.puma"
- {
- # line 356 "AdaptInit.puma"
- TempScalarsInitBody (t);
- t->BODY_NODE.STATS = AdaptInitACF (t->BODY_NODE.STATS);
- TempScalarsDoneBody (t);
-
- }
- return t;
-
- case kACF_LIST:
- # line 363 "AdaptInit.puma"
- {
- # line 364 "AdaptInit.puma"
- set_protocol_stmt (t->ACF_LIST.Elem);
- newacf = AdaptInitACF (t->ACF_LIST.Elem);
- t->ACF_LIST.Next = AdaptInitACF (t->ACF_LIST.Next);
- newacf = ReplaceACF (t, newacf, t->ACF_LIST.Next);
-
- }
- return newacf;
-
- case kACF_BASIC:
- if (t->ACF_BASIC.BASIC_STMT->Kind == kASSIGN_STMT) {
- # line 372 "AdaptInit.puma"
- return AdaptInitAssign (t, TreeRank (t->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_VAR), TreeRank (t->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_EXP));
-
- }
- if (t->ACF_BASIC.BASIC_STMT->Kind == kALLOCATE_STMT) {
- # line 384 "AdaptInit.puma"
- {
- # line 385 "AdaptInit.puma"
- SetAllocateShapes (t->ACF_BASIC.BASIC_STMT->ALLOCATE_STMT.PARAMS);
- }
- return t;
-
- }
- if (t->ACF_BASIC.BASIC_STMT->Kind == kDEALLOCATE_STMT) {
- # line 389 "AdaptInit.puma"
- {
- # line 390 "AdaptInit.puma"
- ResetDeallocateShapes (t->ACF_BASIC.BASIC_STMT->DEALLOCATE_STMT.PARAMS);
- }
- return t;
-
- }
- if (t->ACF_BASIC.BASIC_STMT->Kind == kIO_STMT) {
- # line 394 "AdaptInit.puma"
- {
- # line 395 "AdaptInit.puma"
- if (target_language == FORTRAN_77)
- F77IO (t->ACF_BASIC.BASIC_STMT->IO_STMT.IO_ITEMS);
-
- }
- return t;
-
- }
- # line 401 "AdaptInit.puma"
- return t;
-
- case kACF_EMPTY:
- # line 406 "AdaptInit.puma"
- return t;
-
- case kACF_DUMMY:
- # line 410 "AdaptInit.puma"
- return t;
-
- case kACF_WHILE:
- # line 414 "AdaptInit.puma"
- {
- # line 415 "AdaptInit.puma"
- t->ACF_WHILE.WHILE_BODY = AdaptInitACF (t->ACF_WHILE.WHILE_BODY);
- }
- return t;
-
- case kACF_DO:
- # line 419 "AdaptInit.puma"
- {
- # line 420 "AdaptInit.puma"
- t->ACF_DO.DO_BODY = AdaptInitACF (t->ACF_DO.DO_BODY);
- }
- return t;
-
- case kACF_DOLOCAL:
- # line 424 "AdaptInit.puma"
- {
- # line 425 "AdaptInit.puma"
- t->ACF_DOLOCAL.DOLOCAL_BODY = AdaptInitACF (t->ACF_DOLOCAL.DOLOCAL_BODY);
- }
- return t;
-
- case kACF_FORALL:
- # line 429 "AdaptInit.puma"
- {
- # line 430 "AdaptInit.puma"
- forall_loops += 1;
- t->ACF_FORALL.FORALL_BODY = AdaptInitACF (t->ACF_FORALL.FORALL_BODY);
- forall_loops -= 1;
-
- }
- return t;
-
- case kACF_IF:
- # line 438 "AdaptInit.puma"
- {
- # line 439 "AdaptInit.puma"
- t->ACF_IF.THEN_PART = AdaptInitACF (t->ACF_IF.THEN_PART);
- t->ACF_IF.ELSE_PART = AdaptInitACF (t->ACF_IF.ELSE_PART);
-
- }
- return t;
-
- case kACF_WHERE:
- # line 445 "AdaptInit.puma"
- {
- # line 446 "AdaptInit.puma"
- if (target_language == FORTRAN_77)
- { stmt_protocol ("Make F77 from where statement");
- newacf = F77Where (t);
- tree_protocol ("new loop :\n", newacf);
- }
- else
- newacf = t;
-
- }
- return newacf;
-
- }
-
- # line 457 "AdaptInit.puma"
- {
- # line 458 "AdaptInit.puma"
- printf ("AdaptInitACF failed\n");
- # line 459 "AdaptInit.puma"
- WriteTree (stdout, t);
- # line 460 "AdaptInit.puma"
- kill_in_protocol ();
- }
- return t;
-
- }
-
- static tTree AdaptInitAssign
- # if defined __STDC__ | defined __cplusplus
- (register tTree assign, register int rankvar, register int rankexp)
- # else
- (assign, rankvar, rankexp)
- register tTree assign;
- register int rankvar;
- register int rankexp;
- # endif
- {
- # line 472 "AdaptInit.puma"
-
- struct_shape shp;
- tTree new;
-
- if (assign->Kind == kACF_BASIC) {
- if (assign->ACF_BASIC.BASIC_STMT->Kind == kASSIGN_STMT) {
- # line 484 "AdaptInit.puma"
- {
- # line 486 "AdaptInit.puma"
- if (! ((IsReduction (assign) == true))) goto yyL1;
- {
- # line 487 "AdaptInit.puma"
- if (! ((target_language == FORTRAN_77))) goto yyL1;
- {
- # line 489 "AdaptInit.puma"
- new = assign;
- if (forall_loops > 0)
- { stmt_protocol ("Make F77 from reduction in FORALL !!!");
- new = F77Reduction (assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_VAR, assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_EXP);
- tree_protocol ("new reduction loop in FORALL:\n", new);
- }
- else
- { stmt_protocol ("Make F77 from reduction");
- new = F77Reduction (assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_VAR, assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_EXP);
- tree_protocol ("new reduction loop :\n", new);
- }
-
- }
- }
- }
- return new;
- yyL1:;
-
- # line 513 "AdaptInit.puma"
- {
- # line 515 "AdaptInit.puma"
- if (! ((IsArrayOverlapped (assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_VAR) == true))) goto yyL2;
- }
- return assign;
- yyL2:;
-
- if (equalint (rankvar, 0)) {
- if (equalint (rankexp, 0)) {
- # line 525 "AdaptInit.puma"
- return assign;
-
- }
- }
- if (equalint (rankexp, 0)) {
- # line 535 "AdaptInit.puma"
- {
- # line 536 "AdaptInit.puma"
- new = assign;
- if (CountMovements (assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_VAR, assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_EXP) == 0)
- { if (target_language == FORTRAN_77)
- {
- stmt_protocol ("Make F77 from array = scalar");
- new = F77Assign (assign);
- tree_protocol ("new loops :\n", new);
- }
- }
-
- }
- return new;
-
- }
- # line 555 "AdaptInit.puma"
- {
- # line 556 "AdaptInit.puma"
- if (! (rankvar == rankexp)) goto yyL5;
- {
- # line 557 "AdaptInit.puma"
- new = assign;
- if (TranslateArrayOperation (assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_VAR, assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_EXP, CountMovements (assign->ACF_BASIC.BASIC_STMT->ASSIGN_STMT.ASSIGN_VAR, assign->ACF_BASIC.BASIC_STMT->
- ASSIGN_STMT.ASSIGN_EXP)) )
- {
- stmt_protocol ("Make F77 from array = array_exp");
- new = F77Assign (assign);
- tree_protocol ("new loops :\n", new);
- }
-
- }
- }
- return new;
- yyL5:;
-
- }
- }
- # line 568 "AdaptInit.puma"
- {
- # line 569 "AdaptInit.puma"
- if (! ((rankvar != rankexp))) goto yyL6;
- {
- # line 571 "AdaptInit.puma"
- printf ("AdaptInit: Illegal Call of InitAssign\n");
- # line 572 "AdaptInit.puma"
- kill_in_protocol ();
- }
- }
- return assign;
- yyL6:;
-
- yyAbort ("AdaptInitAssign");
- }
-
- static bool TranslateArrayOperation
- # if defined __STDC__ | defined __cplusplus
- (register tTree var, register tTree exp, register int moves)
- # else
- (var, exp, moves)
- register tTree var;
- register tTree exp;
- register int moves;
- # endif
- {
- if (var == NoTree) return false;
- if (exp == NoTree) return false;
- # line 578 "AdaptInit.puma"
- {
- # line 579 "AdaptInit.puma"
- if (! ((moves == 0))) goto yyL1;
- {
- # line 580 "AdaptInit.puma"
- if (! ((target_language == FORTRAN_77))) goto yyL1;
- }
- }
- return true;
- yyL1:;
-
- if (exp->Kind == kVAR_EXP) {
- # line 583 "AdaptInit.puma"
- {
- # line 585 "AdaptInit.puma"
- if (! (TreeDistribution (var) != 1)) goto yyL2;
- {
- # line 586 "AdaptInit.puma"
- if (! (IsContiguousSection (var) == false)) goto yyL2;
- }
- }
- return true;
- yyL2:;
-
- # line 589 "AdaptInit.puma"
- {
- # line 591 "AdaptInit.puma"
- if (! (TreeDistribution (exp->VAR_EXP.V) != 1)) goto yyL3;
- {
- # line 592 "AdaptInit.puma"
- if (! (IsContiguousSection (exp->VAR_EXP.V) == false)) goto yyL3;
- }
- }
- return true;
- yyL3:;
-
- }
- return false;
- }
-
- void BeginAdaptInit ()
- {
- }
-
- void CloseAdaptInit ()
- {
- }