Skip to content

Commit

Permalink
Remove array_element_addr functions (#6965)
Browse files Browse the repository at this point in the history
@mahge
Update bootstrapping sources.
c19c379

  - This is done because the old bootstrapping sources used to generate
    functions that we will remove in the next commits.

    That is it does not use those functions but it generates code that
    needs those functions.

    The code generator has been fixed already but the bootstrap sources
    were not removed. So we update them now.

@mahge
Remove forgotten obsolete function generation.
f88c3c3

  - This slipped the changes last time.

@mahge
Remove boolean_array_element_addr functions.
46fcc5f

  - They are replaced by boolean_array_get() macros.

@mahge
Remove string_array_element_addr functions.
39f60c4

  - They are replaced by string_array_get() macros.

@mahge
Remove integer_array_element_addr functions.
c40f5af

  - They are replaced by integer_array_get() macros.

@mahge
Remove real_array_element_addr functions.
79c4c51

  - They are replaced by real_array_get() macros.

@mahge
Remove generic_array_element_addr functions.
4e1b44f

  - They are replaced by <%typename%>_array_get() macros.

  This macros basically expand to

   `generic_array_get(&src, sizeof(<%typename%>), ...)`
  • Loading branch information
mahge committed Nov 19, 2020
1 parent 5defbb3 commit fbff63f
Show file tree
Hide file tree
Showing 41 changed files with 13,374 additions and 13,578 deletions.
4 changes: 2 additions & 2 deletions OMCompiler/Compiler/Template/CodegenCppCommon.tpl
Expand Up @@ -1069,7 +1069,7 @@ template daeExpReduction(Exp exp, Context context, Text &preExp,
match typeof(r.expr)
case T_COMPLEX(complexClassType = record_state) then
let rec_name = '<%underscorePath(ClassInf.getStateName(record_state))%>'
'*((<%rec_name%>*)generic_array_element_addr(&<%res%>, sizeof(<%rec_name%>), 1, <%arrIndex%>++)) = <%reductionBodyExpr%>;'
'<%rec_name%>_array_get(<%res%>, 1, <%arrIndex%>++) = <%reductionBodyExpr%>;'
case T_ARRAY(__) then
let tmp_shape = tempDecl("vector<size_t>", &varDecls /*BUFD*/)
let tmp_indeces = tempDecl("idx_type", &varDecls /*BUFD*/)
Expand Down Expand Up @@ -1142,7 +1142,7 @@ template daeExpReduction(Exp exp, Context context, Text &preExp,
let addr = match iter.ty
case T_ARRAY(ty=T_COMPLEX(complexClassType = record_state)) then
let rec_name = '<%underscorePath(ClassInf.getStateName(record_state))%>'
'*((<%rec_name%>*)generic_array_element_addr(&<%loopVar%>, sizeof(<%rec_name%>), 1, <%firstIndex%>++))'
'<%rec_name%>_array_get(<%loopVar%>, 1, <%firstIndex%>++)'
else
'<%loopVar%>( <%firstIndex%>++)'
<<
Expand Down
4 changes: 2 additions & 2 deletions OMCompiler/Compiler/Template/CodegenCppCommonOld.tpl
Expand Up @@ -1062,7 +1062,7 @@ template daeExpReduction(Exp exp, Context context, Text &preExp,
match typeof(r.expr)
case T_COMPLEX(complexClassType = record_state) then
let rec_name = '<%underscorePath(ClassInf.getStateName(record_state))%>'
'*((<%rec_name%>*)generic_array_element_addr(&<%res%>, sizeof(<%rec_name%>), 1, <%arrIndex%>++)) = <%reductionBodyExpr%>;'
'<%rec_name%>_array_get(<%res%>, 1, <%arrIndex%>++) = <%reductionBodyExpr%>;'
case T_ARRAY(__) then
let tmp_shape = tempDecl("vector<size_t>", &varDecls /*BUFD*/)
let tmp_indeces = tempDecl("idx_type", &varDecls /*BUFD*/)
Expand Down Expand Up @@ -1135,7 +1135,7 @@ template daeExpReduction(Exp exp, Context context, Text &preExp,
let addr = match iter.ty
case T_ARRAY(ty=T_COMPLEX(complexClassType = record_state)) then
let rec_name = '<%underscorePath(ClassInf.getStateName(record_state))%>'
'*((<%rec_name%>*)generic_array_element_addr(&<%loopVar%>, sizeof(<%rec_name%>), 1, <%firstIndex%>++))'
'<%rec_name%>_array_get(<%loopVar%>, 1, <%firstIndex%>++)'
else
'<%loopVar%>( <%firstIndex%>++)'
<<
Expand Down
Expand Up @@ -205,7 +205,7 @@ static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT86,100,_OMC_LIT86_data);
#define _OMC_LIT86 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT86)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT87,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT86}};
#define _OMC_LIT87 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT87)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT88,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(155)),_OMC_LIT85,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT87}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT88,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(154)),_OMC_LIT85,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),_OMC_LIT87}};
#define _OMC_LIT88 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT88)
#define _OMC_LIT89_data "AbsynToSCode.translateElementspec failed"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT89,40,_OMC_LIT89_data);
Expand Down
Expand Up @@ -170,7 +170,7 @@ static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT57,32,_OMC_LIT57_data);
#define _OMC_LIT58_data "/home/mahge/dev/OpenModelica/OMCompiler/Compiler/FrontEnd/AbsynUtil.mo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT58,70,_OMC_LIT58_data);
#define _OMC_LIT58 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT58)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT59_6,1604657436.0);
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT59_6,1605529654.0);
#define _OMC_LIT59_6 MMC_REFREALLIT(_OMC_LIT_STRUCT59_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT59,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT58,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2582)),MMC_IMMEDIATE(MMC_TAGFIXNUM(9)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2582)),MMC_IMMEDIATE(MMC_TAGFIXNUM(103)),_OMC_LIT59_6}};
#define _OMC_LIT59 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT59)
Expand Down
Expand Up @@ -151,7 +151,7 @@ static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT57,50,_OMC_LIT57_data);
#define _OMC_LIT57 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT57)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT58,2,3) {&Gettext_TranslatableContent_gettext__desc,_OMC_LIT57}};
#define _OMC_LIT58 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT58)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT59,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(165)),_OMC_LIT56,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT58}};
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT59,5,3) {&Flags_DebugFlag_DEBUG__FLAG__desc,MMC_IMMEDIATE(MMC_TAGFIXNUM(164)),_OMC_LIT56,MMC_IMMEDIATE(MMC_TAGFIXNUM(1)),_OMC_LIT58}};
#define _OMC_LIT59 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT59)
#define _OMC_LIT60_data "__OpenModelica_DisableListAppendWarning"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT60,39,_OMC_LIT60_data);
Expand Down
Expand Up @@ -507,7 +507,7 @@ static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT189,4,_OMC_LIT189_data);
#define _OMC_LIT190_data "/home/mahge/dev/OpenModelica/OMCompiler/Compiler/Script/CevalScript.mo"
static const MMC_DEFSTRINGLIT(_OMC_LIT_STRUCT190,70,_OMC_LIT190_data);
#define _OMC_LIT190 MMC_REFSTRINGLIT(_OMC_LIT_STRUCT190)
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT191_6,1604662581.0);
static const MMC_DEFREALLIT(_OMC_LIT_STRUCT191_6,1605529654.0);
#define _OMC_LIT191_6 MMC_REFREALLIT(_OMC_LIT_STRUCT191_6)
static const MMC_DEFSTRUCTLIT(_OMC_LIT_STRUCT191,8,3) {&SourceInfo_SOURCEINFO__desc,_OMC_LIT190,MMC_IMMEDIATE(MMC_TAGFIXNUM(0)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2091)),MMC_IMMEDIATE(MMC_TAGFIXNUM(257)),MMC_IMMEDIATE(MMC_TAGFIXNUM(2091)),MMC_IMMEDIATE(MMC_TAGFIXNUM(276)),_OMC_LIT191_6}};
#define _OMC_LIT191 MMC_REFSTRUCTLIT(_OMC_LIT_STRUCT191)
Expand Down

0 comments on commit fbff63f

Please sign in to comment.