@@ -103,18 +103,18 @@ static inline ASR::ttype_t* expr_type(const ASR::expr_t *f)
103103 case ASR ::exprType::IfExp: { return ((ASR ::IfExp_t*)f)->m_type ; }
104104 case ASR ::exprType::FunctionCall: { return ((ASR ::FunctionCall_t*)f)->m_type ; }
105105 case ASR ::exprType::DerivedTypeConstructor: { return ((ASR ::DerivedTypeConstructor_t*)f)->m_type ; }
106- case ASR ::exprType::ConstantArray : { return ((ASR ::ConstantArray_t *)f)->m_type ; }
106+ case ASR ::exprType::ArrayConstant : { return ((ASR ::ArrayConstant_t *)f)->m_type ; }
107107 case ASR ::exprType::ImpliedDoLoop: { return ((ASR ::ImpliedDoLoop_t*)f)->m_type ; }
108- case ASR ::exprType::ConstantInteger : { return ((ASR ::ConstantInteger_t *)f)->m_type ; }
109- case ASR ::exprType::ConstantReal : { return ((ASR ::ConstantReal_t *)f)->m_type ; }
110- case ASR ::exprType::ConstantComplex : { return ((ASR ::ConstantComplex_t *)f)->m_type ; }
111- case ASR ::exprType::ConstantSet : { return ((ASR ::ConstantSet_t *)f)->m_type ; }
112- case ASR ::exprType::ConstantList : { return ((ASR ::ConstantList_t *)f)->m_type ; }
113- case ASR ::exprType::ConstantTuple : { return ((ASR ::ConstantTuple_t *)f)->m_type ; }
114- case ASR ::exprType::ConstantLogical : { return ((ASR ::ConstantLogical_t *)f)->m_type ; }
115- case ASR ::exprType::ConstantString : { return ((ASR ::ConstantString_t *)f)->m_type ; }
116- case ASR ::exprType::ConstantDictionary : { return ((ASR ::ConstantDictionary_t *)f)->m_type ; }
117- case ASR ::exprType::BOZ : { return ((ASR ::BOZ_t *)f)->m_type ; }
108+ case ASR ::exprType::IntegerConstant : { return ((ASR ::IntegerConstant_t *)f)->m_type ; }
109+ case ASR ::exprType::RealConstant : { return ((ASR ::RealConstant_t *)f)->m_type ; }
110+ case ASR ::exprType::ComplexConstant : { return ((ASR ::ComplexConstant_t *)f)->m_type ; }
111+ case ASR ::exprType::SetConstant : { return ((ASR ::SetConstant_t *)f)->m_type ; }
112+ case ASR ::exprType::ListConstant : { return ((ASR ::ListConstant_t *)f)->m_type ; }
113+ case ASR ::exprType::TupleConstant : { return ((ASR ::TupleConstant_t *)f)->m_type ; }
114+ case ASR ::exprType::LogicalConstant : { return ((ASR ::LogicalConstant_t *)f)->m_type ; }
115+ case ASR ::exprType::StringConstant : { return ((ASR ::StringConstant_t *)f)->m_type ; }
116+ case ASR ::exprType::DictConstant : { return ((ASR ::DictConstant_t *)f)->m_type ; }
117+ case ASR ::exprType::IntegerBOZ : { return ((ASR ::IntegerBOZ_t *)f)->m_type ; }
118118 case ASR ::exprType::Var: { return EXPR2VAR (f)->m_type ; }
119119 case ASR ::exprType::ArrayRef: { return ((ASR ::ArrayRef_t*)f)->m_type ; }
120120 case ASR ::exprType::DerivedRef: { return ((ASR ::DerivedRef_t*)f)->m_type ; }
@@ -214,15 +214,15 @@ static inline ASR::expr_t* expr_value(ASR::expr_t *f)
214214 case ASR ::exprType::Var: { return EXPR2VAR (f)->m_value ; }
215215 case ASR ::exprType::StrOp: { return ASR ::down_cast<ASR ::StrOp_t>(f)->m_value ; }
216216 case ASR ::exprType::ImpliedDoLoop: { return ASR ::down_cast<ASR ::ImpliedDoLoop_t>(f)->m_value ; }
217- case ASR ::exprType::ConstantArray : // Drop through
218- case ASR ::exprType::ConstantInteger : // Drop through
219- case ASR ::exprType::ConstantReal : // Drop through
220- case ASR ::exprType::ConstantComplex : // Drop through
221- case ASR ::exprType::ConstantLogical : // Drop through
222- case ASR ::exprType::ConstantTuple : // Drop through
223- case ASR ::exprType::ConstantDictionary : // Drop through
224- case ASR ::exprType::ConstantSet : // Drop through
225- case ASR ::exprType::ConstantString :{ // For all Constants
217+ case ASR ::exprType::ArrayConstant : // Drop through
218+ case ASR ::exprType::IntegerConstant : // Drop through
219+ case ASR ::exprType::RealConstant : // Drop through
220+ case ASR ::exprType::ComplexConstant : // Drop through
221+ case ASR ::exprType::LogicalConstant : // Drop through
222+ case ASR ::exprType::TupleConstant : // Drop through
223+ case ASR ::exprType::DictConstant : // Drop through
224+ case ASR ::exprType::SetConstant : // Drop through
225+ case ASR ::exprType::StringConstant :{ // For all Constants
226226 return f;
227227 }
228228 default : throw LFortranException (" Not implemented" );
@@ -424,15 +424,15 @@ static inline bool is_value_constant(ASR::expr_t *a_value) {
424424 if ( a_value == nullptr ) {
425425 return false ;
426426 }
427- if (ASR ::is_a<ASR ::ConstantInteger_t >(*a_value)) {
427+ if (ASR ::is_a<ASR ::IntegerConstant_t >(*a_value)) {
428428 // OK
429- } else if (ASR ::is_a<ASR ::ConstantReal_t >(*a_value)) {
429+ } else if (ASR ::is_a<ASR ::RealConstant_t >(*a_value)) {
430430 // OK
431- } else if (ASR ::is_a<ASR ::ConstantComplex_t >(*a_value)) {
431+ } else if (ASR ::is_a<ASR ::ComplexConstant_t >(*a_value)) {
432432 // OK
433- } else if (ASR ::is_a<ASR ::ConstantLogical_t >(*a_value)) {
433+ } else if (ASR ::is_a<ASR ::LogicalConstant_t >(*a_value)) {
434434 // OK
435- } else if (ASR ::is_a<ASR ::ConstantString_t >(*a_value)) {
435+ } else if (ASR ::is_a<ASR ::StringConstant_t >(*a_value)) {
436436 // OK
437437 } else {
438438 return false ;
@@ -444,8 +444,8 @@ static inline bool is_value_constant(ASR::expr_t *a_value, int64_t& const_value)
444444 if ( a_value == nullptr ) {
445445 return false ;
446446 }
447- if (ASR ::is_a<ASR ::ConstantInteger_t >(*a_value)) {
448- ASR ::ConstantInteger_t * const_int = ASR ::down_cast<ASR ::ConstantInteger_t >(a_value);
447+ if (ASR ::is_a<ASR ::IntegerConstant_t >(*a_value)) {
448+ ASR ::IntegerConstant_t * const_int = ASR ::down_cast<ASR ::IntegerConstant_t >(a_value);
449449 const_value = const_int->m_n ;
450450 } else {
451451 return false ;
@@ -457,8 +457,8 @@ static inline bool is_value_constant(ASR::expr_t *a_value, bool& const_value) {
457457 if ( a_value == nullptr ) {
458458 return false ;
459459 }
460- if (ASR ::is_a<ASR ::ConstantLogical_t >(*a_value)) {
461- ASR ::ConstantLogical_t * const_logical = ASR ::down_cast<ASR ::ConstantLogical_t >(a_value);
460+ if (ASR ::is_a<ASR ::LogicalConstant_t >(*a_value)) {
461+ ASR ::LogicalConstant_t * const_logical = ASR ::down_cast<ASR ::LogicalConstant_t >(a_value);
462462 const_value = const_logical->m_value ;
463463 } else {
464464 return false ;
@@ -470,11 +470,11 @@ static inline bool is_value_constant(ASR::expr_t *a_value, double& const_value)
470470 if ( a_value == nullptr ) {
471471 return false ;
472472 }
473- if (ASR ::is_a<ASR ::ConstantInteger_t >(*a_value)) {
474- ASR ::ConstantInteger_t * const_int = ASR ::down_cast<ASR ::ConstantInteger_t >(a_value);
473+ if (ASR ::is_a<ASR ::IntegerConstant_t >(*a_value)) {
474+ ASR ::IntegerConstant_t * const_int = ASR ::down_cast<ASR ::IntegerConstant_t >(a_value);
475475 const_value = const_int->m_n ;
476- } else if (ASR ::is_a<ASR ::ConstantReal_t >(*a_value)) {
477- ASR ::ConstantReal_t * const_real = ASR ::down_cast<ASR ::ConstantReal_t >(a_value);
476+ } else if (ASR ::is_a<ASR ::RealConstant_t >(*a_value)) {
477+ ASR ::RealConstant_t * const_real = ASR ::down_cast<ASR ::RealConstant_t >(a_value);
478478 const_value = const_real->m_r ;
479479 } else {
480480 return false ;
@@ -486,8 +486,8 @@ static inline bool is_value_constant(ASR::expr_t *a_value, std::string& const_va
486486 if ( a_value == nullptr ) {
487487 return false ;
488488 }
489- if (ASR ::is_a<ASR ::ConstantString_t >(*a_value)) {
490- ASR ::ConstantString_t * const_string = ASR ::down_cast<ASR ::ConstantString_t >(a_value);
489+ if (ASR ::is_a<ASR ::StringConstant_t >(*a_value)) {
490+ ASR ::StringConstant_t * const_string = ASR ::down_cast<ASR ::StringConstant_t >(a_value);
491491 const_value = std::string (const_string->m_s );
492492 } else {
493493 return false ;
@@ -505,14 +505,14 @@ static inline bool is_value_equal(ASR::expr_t* test_expr, ASR::expr_t* desired_e
505505 }
506506
507507 switch ( desired_value->type ) {
508- case ASR ::exprType::ConstantInteger : {
509- ASR ::ConstantInteger_t * test_int = ASR ::down_cast<ASR ::ConstantInteger_t >(test_value);
510- ASR ::ConstantInteger_t * desired_int = ASR ::down_cast<ASR ::ConstantInteger_t >(desired_value);
508+ case ASR ::exprType::IntegerConstant : {
509+ ASR ::IntegerConstant_t * test_int = ASR ::down_cast<ASR ::IntegerConstant_t >(test_value);
510+ ASR ::IntegerConstant_t * desired_int = ASR ::down_cast<ASR ::IntegerConstant_t >(desired_value);
511511 return test_int->m_n == desired_int->m_n ;
512512 }
513- case ASR ::exprType::ConstantString : {
514- ASR ::ConstantString_t * test_str = ASR ::down_cast<ASR ::ConstantString_t >(test_value);
515- ASR ::ConstantString_t * desired_str = ASR ::down_cast<ASR ::ConstantString_t >(desired_value);
513+ case ASR ::exprType::StringConstant : {
514+ ASR ::StringConstant_t * test_str = ASR ::down_cast<ASR ::StringConstant_t >(test_value);
515+ ASR ::StringConstant_t * desired_str = ASR ::down_cast<ASR ::StringConstant_t >(desired_value);
516516 return std::string (test_str->m_s ) == std::string (desired_str->m_s );
517517 }
518518 default : {
@@ -593,8 +593,8 @@ static inline bool extract_value(ASR::expr_t* value_expr, T& value) {
593593 }
594594
595595 switch ( value_expr->type ) {
596- case ASR ::exprType::ConstantReal : {
597- ASR ::ConstantReal_t * const_real = ASR ::down_cast<ASR ::ConstantReal_t >(value_expr);
596+ case ASR ::exprType::RealConstant : {
597+ ASR ::RealConstant_t * const_real = ASR ::down_cast<ASR ::RealConstant_t >(value_expr);
598598 value = (T) const_real->m_r ;
599599 break ;
600600 }
@@ -863,8 +863,8 @@ inline bool is_same_type_pointer(ASR::ttype_t* source, ASR::ttype_t* dest) {
863863 inline int extract_kind (ASR ::expr_t * kind_expr, const Location& loc) {
864864 int a_kind = 4 ;
865865 switch ( kind_expr->type ) {
866- case ASR ::exprType::ConstantInteger : {
867- a_kind = ASR ::down_cast<ASR ::ConstantInteger_t >
866+ case ASR ::exprType::IntegerConstant : {
867+ a_kind = ASR ::down_cast<ASR ::IntegerConstant_t >
868868 (kind_expr)->m_n ;
869869 break ;
870870 }
@@ -877,7 +877,7 @@ inline bool is_same_type_pointer(ASR::ttype_t* source, ASR::ttype_t* dest) {
877877 if ( kind_variable->m_storage == ASR ::storage_typeType::Parameter ) {
878878 if ( kind_variable->m_type ->type == ASR ::ttypeType::Integer ) {
879879 LFORTRAN_ASSERT ( kind_variable->m_value != nullptr );
880- a_kind = ASR ::down_cast<ASR ::ConstantInteger_t >(kind_variable->m_value )->m_n ;
880+ a_kind = ASR ::down_cast<ASR ::IntegerConstant_t >(kind_variable->m_value )->m_n ;
881881 } else {
882882 std::string msg = " Integer variable required. " + std::string (kind_variable->m_name ) +
883883 " is not an Integer variable." ;
@@ -902,8 +902,8 @@ inline bool is_same_type_pointer(ASR::ttype_t* source, ASR::ttype_t* dest) {
902902 inline int extract_len (ASR ::expr_t * len_expr, const Location& loc) {
903903 int a_len = -10 ;
904904 switch ( len_expr->type ) {
905- case ASR ::exprType::ConstantInteger : {
906- a_len = ASR ::down_cast<ASR ::ConstantInteger_t >
905+ case ASR ::exprType::IntegerConstant : {
906+ a_len = ASR ::down_cast<ASR ::IntegerConstant_t >
907907 (len_expr)->m_n ;
908908 break ;
909909 }
@@ -916,7 +916,7 @@ inline bool is_same_type_pointer(ASR::ttype_t* source, ASR::ttype_t* dest) {
916916 if ( len_variable->m_storage == ASR ::storage_typeType::Parameter ) {
917917 if ( len_variable->m_type ->type == ASR ::ttypeType::Integer ) {
918918 LFORTRAN_ASSERT ( len_variable->m_value != nullptr );
919- a_len = ASR ::down_cast<ASR ::ConstantInteger_t >(len_variable->m_value )->m_n ;
919+ a_len = ASR ::down_cast<ASR ::IntegerConstant_t >(len_variable->m_value )->m_n ;
920920 } else {
921921 std::string msg = " Integer variable required. " + std::string (len_variable->m_name ) +
922922 " is not an Integer variable." ;
0 commit comments