@@ -450,7 +450,7 @@ def make_visitor(self, name, fields):
450
450
symtab_field_name = field .name
451
451
if is_stmt_present and is_symtab_present :
452
452
break
453
- if is_stmt_present and name not in ("Assignment" , "ForAllSingle" ):
453
+ if is_stmt_present and name not in ("Assignment" , "ForAllSingle" , "FileRead" , "FileWrite" ):
454
454
self .emit (" %s_t& xx = const_cast<%s_t&>(x);" % (name , name ), 1 )
455
455
self .used = False
456
456
@@ -562,7 +562,7 @@ def make_visitor(self, name, fields):
562
562
symtab_field_name = field .name
563
563
if is_stmt_present and is_symtab_present :
564
564
break
565
- if is_stmt_present and name not in ("Assignment" , "ForAllSingle" ):
565
+ if is_stmt_present and name not in ("Assignment" , "ForAllSingle" , "FileRead" , "FileWrite" ):
566
566
self .emit (" %s_t& xx = const_cast<%s_t&>(x);" % (name , name ), 1 )
567
567
self .used = False
568
568
@@ -1029,17 +1029,13 @@ def visitConstructor(self, cons, _):
1029
1029
def make_visitor (self , name , fields ):
1030
1030
self .emit ("" )
1031
1031
self .emit ("ASR::asr_t* duplicate_%s(%s_t* x) {" % (name , name ), 1 )
1032
- self .used = False
1033
- arguments = []
1032
+ arguments = ["al" , "x->base.base.loc" ]
1034
1033
for field in fields :
1035
1034
ret_value = self .visitField (field )
1036
1035
for node_arg in ret_value :
1037
1036
arguments .append (node_arg )
1038
- if not self .used :
1039
- self .emit ("return (asr_t*)x;" , 2 )
1040
- else :
1041
- node_arg_str = ', ' .join (arguments )
1042
- self .emit ("return make_%s_t(al, x->base.base.loc, %s);" % (name , node_arg_str ), 2 )
1037
+ node_arg_str = ', ' .join (arguments )
1038
+ self .emit ("return make_%s_t(%s);" % (name , node_arg_str ), 2 )
1043
1039
if self .is_stmt :
1044
1040
self .duplicate_stmt .append ((" case ASR::stmtType::%s: {" % name , 2 ))
1045
1041
if name == "SubroutineCall" :
@@ -1088,7 +1084,6 @@ def visitField(self, field):
1088
1084
field .type == "dimension" ):
1089
1085
level = 2
1090
1086
if field .seq :
1091
- self .used = True
1092
1087
pointer_char = ''
1093
1088
if (field .type != "call_arg" and
1094
1089
field .type != "array_index" and
@@ -1141,7 +1136,6 @@ def visitField(self, field):
1141
1136
self .emit ("}" , level )
1142
1137
arguments = ("m_" + field .name + ".p" , "x->n_" + field .name )
1143
1138
else :
1144
- self .used = True
1145
1139
if field .type == "symbol" :
1146
1140
self .emit ("%s_t* m_%s = x->m_%s;" % (field .type , field .name , field .name ), level )
1147
1141
elif field .type == "do_loop_head" :
@@ -1461,12 +1455,6 @@ def visitConstructor(self, cons, _):
1461
1455
def make_visitor (self , name , fields , cons ):
1462
1456
self .emit ("void visit_%s(const %s_t &x) {" % (name , name ), 1 )
1463
1457
self .emit ( 's.append("(");' , 2 )
1464
- subs = {
1465
- "Assignment" : "=" ,
1466
- "Associate" : "=>" ,
1467
- }
1468
- if name in subs :
1469
- name = subs [name ]
1470
1458
1471
1459
# For ASR
1472
1460
symbol = [
@@ -1680,7 +1668,7 @@ def visitField(self, field, cons):
1680
1668
self .emit ( 's.append("()");' , 3 )
1681
1669
self .emit ("}" , 2 )
1682
1670
else :
1683
- if field .name == "intrinsic_id" :
1671
+ if field .name == "intrinsic_id" or field . name == "inquiry_id" :
1684
1672
self .emit ('s.append(self().convert_intrinsic_id(x.m_%s));' % field .name , 2 )
1685
1673
elif field .name == "impure_intrinsic_id" :
1686
1674
self .emit ('s.append(self().convert_impure_intrinsic_id(x.m_%s));' % field .name , 2 )
@@ -2593,7 +2581,8 @@ def make_visitor(self, name, fields):
2593
2581
LCOMPILERS_ASSERT(!ASR::is_a<ASR::ExternalSymbol_t>(*e->m_external));
2594
2582
s = e->m_external;
2595
2583
}
2596
- if( ASR::down_cast<ASR::Variable_t>(s)->m_storage !=
2584
+ if( ASR::is_a<ASR::Function_t>(*s) ||
2585
+ ASR::down_cast<ASR::Variable_t>(s)->m_storage !=
2597
2586
ASR::storage_typeType::Parameter ) {
2598
2587
return nullptr;
2599
2588
}
0 commit comments