File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1247,7 +1247,27 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor<ASRToLLVMVisitor>
1247
1247
int64_t ptr_loads_copy = ptr_loads;
1248
1248
for ( size_t i = 0 ; i < x.n_args ; i++ ) {
1249
1249
if (ASR::is_a<ASR::CPtr_t>(*ASRUtils::expr_type (x.m_args [i]))) {
1250
- ptr_loads = 0 ;
1250
+ bool is_argument = false ;
1251
+ ASR::expr_t *var = x.m_args [i];
1252
+ if (is_a<ASR::Var_t>(*var)) {
1253
+ ASR::symbol_t *var_sym = ASR::down_cast<ASR::Var_t>(var)
1254
+ ->m_v ;
1255
+ if (is_a<ASR::Variable_t>(*var_sym)) {
1256
+ ASR::Variable_t *v = down_cast<ASR::Variable_t>(var_sym);
1257
+ if (v->m_intent == intent_local ||
1258
+ v->m_intent == intent_return_var ||
1259
+ !v->m_intent ) {
1260
+ is_argument = false ;
1261
+ } else {
1262
+ is_argument = true ;
1263
+ }
1264
+ }
1265
+ }
1266
+ if (is_argument) {
1267
+ ptr_loads = 0 ;
1268
+ } else {
1269
+ ptr_loads = 1 ;
1270
+ }
1251
1271
} else {
1252
1272
ptr_loads = 1 ;
1253
1273
}
You can’t perform that action at this time.
0 commit comments