Changeset 2fd0de0 for src/CodeGen/FixNames.cc
- Timestamp:
- Jul 20, 2022, 12:40:32 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 6726a3a
- Parents:
- b585593
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/FixNames.cc
rb585593 r2fd0de0 103 103 104 104 const ast::FunctionDecl *postvisit( const ast::FunctionDecl *functionDecl ) { 105 // This store is used to ensure a maximum of one call to mutate.106 ast::FunctionDecl * mutDecl = nullptr;105 if ( FixMain::isMain( functionDecl ) ) { 106 auto mutDecl = ast::mutate( functionDecl ); 107 107 108 if ( shouldSetScopeLevel( functionDecl ) ) { 109 mutDecl = ast::mutate( functionDecl ); 110 mutDecl->scopeLevel = scopeLevel; 111 } 112 113 if ( FixMain::isMain( functionDecl ) ) { 114 if ( !mutDecl ) { mutDecl = ast::mutate( functionDecl ); } 108 if ( shouldSetScopeLevel( mutDecl ) ) { 109 mutDecl->scopeLevel = scopeLevel; 110 } 115 111 116 112 int nargs = mutDecl->params.size(); … … 124 120 ) 125 121 ); 122 123 return mutDecl; 124 } else if ( shouldSetScopeLevel( functionDecl ) ) { 125 return ast::mutate_field( functionDecl, &ast::FunctionDecl::scopeLevel, scopeLevel ); 126 } else { 127 return functionDecl; 126 128 } 127 return mutDecl ? mutDecl : functionDecl;128 129 } 129 130
Note: See TracChangeset
for help on using the changeset viewer.