Commit ab9bef85 authored by Kai Trojahner's avatar Kai Trojahner
Browse files

we now introduce explicit copy functions whenever type_constraint is applied...

we now introduce explicit copy functions whenever type_constraint is applied to convert between scalar/non-scalar representations
Showing with 13 additions and 3 deletions
+13 -3
......@@ -43,6 +43,7 @@
#include "dbug.h"
#include "traverse.h"
#include "new_types.h"
#include "type_utils.h"
#include "tree_basic.h"
#include "tree_compound.h"
#include "free.h"
......@@ -151,9 +152,18 @@ Substitute (node **ids, node *avis, info *arg_info)
/*
* emit assignment
*/
INFO_POSTASSIGN (arg_info)
= TBmakeAssign (TBmakeLet (TBmakeIds (IDS_AVIS (*ids), NULL), TBmakeId (avis)),
INFO_POSTASSIGN (arg_info));
if ((!TUisScalar (AVIS_TYPE (IDS_AVIS (*ids))))
&& (!TUisScalar (AVIS_TYPE (avis)))) {
INFO_POSTASSIGN (arg_info)
= TBmakeAssign (TBmakeLet (TBmakeIds (IDS_AVIS (*ids), NULL),
TBmakeId (avis)),
INFO_POSTASSIGN (arg_info));
} else {
INFO_POSTASSIGN (arg_info)
= TBmakeAssign (TBmakeLet (TBmakeIds (IDS_AVIS (*ids), NULL),
TCmakePrf1 (F_copy, TBmakeId (avis))),
INFO_POSTASSIGN (arg_info));
}
}
*ids = FREEdoFreeNode (*ids);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment