- Timestamp:
- Mar 18, 2019, 2:32:26 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 78e109f
- Parents:
- 76d3ca6 (diff), a927662 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/BasicTypes-gen.cc
r76d3ca6 r466b1c9 70 70 } graph[NUMBER_OF_BASIC_TYPES] = { 71 71 { Bool, "Bool", "B", "_Bool", "b", Signed, Char, SignedChar, -1, 0 }, // root 72 72 73 { Char, "Char", "C", "char", "c", Signed, SignedChar, UnsignedChar, ShortSignedInt, 1 }, 73 74 { SignedChar, "SignedChar", "SC", "signed char", "a", Signed, UnsignedChar, ShortSignedInt, -1, 1 }, 74 75 { UnsignedChar, "UnsignedChar", "UC", "unsigned char", "h", Unsigned, ShortUnsignedInt, ShortSignedInt, -1, 1 }, 76 75 77 { ShortSignedInt, "ShortSignedInt", "SI", "signed short int", "s", Signed, ShortUnsignedInt, SignedInt, -1, 2 }, 76 78 { ShortUnsignedInt, "ShortUnsignedInt", "SUI", "unsigned short int", "t", Unsigned, UnsignedInt, SignedInt, -1, 2 }, 79 77 80 { SignedInt, "SignedInt", "I", "signed int", "i", Signed, UnsignedInt, LongSignedInt, -1, 3 }, 78 81 { UnsignedInt, "UnsignedInt", "UI", "unsigned int", "j", Unsigned, LongUnsignedInt, LongSignedInt, -1, 3 }, 82 79 83 { LongSignedInt, "LongSignedInt", "LI", "signed long int", "l", Signed, LongUnsignedInt, LongLongSignedInt, -1, 4 }, 80 84 { LongUnsignedInt, "LongUnsignedInt", "LUI", "unsigned long int", "m", Unsigned, LongLongSignedInt, LongLongUnsignedInt, -1, 4 }, 85 81 86 { LongLongSignedInt, "LongLongSignedInt", "LLI", "signed long long int", "x", Signed, LongLongUnsignedInt, SignedInt128, -1, 5 }, 82 87 { LongLongUnsignedInt, "LongLongUnsignedInt", "LLUI", "unsigned long long int", "y", Unsigned, SignedInt128, UnsignedInt128, -1, 5 }, 88 83 89 { SignedInt128, "SignedInt128", "IB", "__int128", "n", Signed, UnsignedInt128, uFloat16, -1, 6 }, 84 90 { UnsignedInt128, "UnsignedInt128", "UIB", "unsigned __int128", "o", Unsigned, uFloat16, -1, -1, 6 }, 91 85 92 { uFloat16, "uFloat16", "_FH", "_Float16", "DF16_", Floating, uFloat32, uFloat16Complex, -1, 7 }, 86 93 { uFloat16Complex, "uFloat16Complex", "_FH", "_Float16 _Complex", "CDF16_", Floating, uFloat32Complex, -1, -1, 7 }, … … 90 97 { FloatComplex, "FloatComplex", "FC", "float _Complex", "Cf", Floating, uFloat32xComplex, -1, -1, 9 }, 91 98 // { FloatImaginary, "FloatImaginary", "FI", "float _Imaginary", "If", false, DoubleImaginary, FloatComplex, -1, 9 }, 99 92 100 { uFloat32x, "uFloat32x", "_FX", "_Float32x", "DF32x_", Floating, uFloat64, uFloat32xComplex, -1, 10 }, 93 101 { uFloat32xComplex, "uFloat32xComplex", "_FXC", "_Float32x _Complex", "CDF32x_", Floating, uFloat64Complex, -1, -1, 10 }, … … 97 105 { DoubleComplex, "DoubleComplex", "DC", "double _Complex", "Cd", Floating, uFloat64xComplex, -1, -1, 12 }, 98 106 // { DoubleImaginary, "DoubleImaginary", "DI", "double _Imaginary", "Id", false, LongDoubleImaginary, DoubleComplex, -1, 12 }, 107 99 108 { uFloat64x, "uFloat64x", "F80X", "_Float64x", "DF64x_", Floating, uuFloat80, uFloat64xComplex, -1, 13 }, 100 109 { uFloat64xComplex, "uFloat64xComplex", "_FDXC", "_Float64x _Complex", "CDF64x_", Floating, uFloat128Complex, -1, -1, 13 }, … … 106 115 { LongDoubleComplex, "LongDoubleComplex", "LDC", "long double _Complex", "Ce", Floating, uFloat128xComplex, -1, -1, 17 }, 107 116 // { LongDoubleImaginary, "LongDoubleImaginary", "LDI", "long double _Imaginary", "Ie", false, LongDoubleComplex, -1, -1, 17 }, 117 108 118 { uFloat128x, "uFloat128x", "_FBX", "_Float128x", "DF128x_", Floating, uFloat128xComplex, -1, -1, 18 }, 109 119 { uFloat128xComplex, "uFloat128xComplex", "_FLDXC", "_Float128x _Complex", "CDF128x_", Floating, -1, -1, -1, 18 } … … 250 260 251 261 #define STARTMK "// GENERATED START, DO NOT EDIT" 252 #define BYMK "// GENERATED BY " __FILE__253 262 #define ENDMK "// GENERATED END" 263 string BYMK( __FILE__ ); 264 string::size_type posn = BYMK.find_last_of( "/" ); 265 if ( posn != string::npos ) BYMK.erase( 0, posn - 1); // remove directories 266 BYMK = "// GENERATED BY " + BYMK; 267 254 268 fstream file; 255 269 stringstream buffer, code; -
src/ControlStruct/ForExprMutator.cc
r76d3ca6 r466b1c9 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Aug 18 10:22:00 201713 // Update Count : 1 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 11 22:26:52 2019 13 // Update Count : 14 14 14 // 15 15 … … 21 21 22 22 namespace ControlStruct { 23 Statement * hoist( Statement *originalStmt, std::list<Statement *> &init ) {23 Statement * hoist( Statement * originalStmt, std::list<Statement *> & init ) { 24 24 // If no hoisting is needed, skip: 25 25 if ( 0 == init.size() ) { … … 29 29 // Create compound statement, move initializers outside, 30 30 // the resut of the original stays as is. 31 CompoundStmt * block = new CompoundStmt();32 std::list<Statement *> & stmts = block->get_kids();31 CompoundStmt * block = new CompoundStmt(); 32 std::list<Statement *> & stmts = block->get_kids(); 33 33 stmts.splice( stmts.end(), init ); 34 34 … … 38 38 } 39 39 40 Statement * ForExprMutator::postmutate( IfStmt *ifStmt ) {40 Statement * ForExprMutator::postmutate( IfStmt * ifStmt ) { 41 41 return hoist( ifStmt, ifStmt->initialization ); 42 42 } 43 Statement * ForExprMutator::postmutate( ForStmt *forStmt ) {43 Statement * ForExprMutator::postmutate( ForStmt * forStmt ) { 44 44 // hoist any initializer declarations to make them C89 (rather than C99) 45 45 return hoist( forStmt, forStmt->initialization ); 46 46 } 47 Statement * ForExprMutator::postmutate( WhileStmt *whileStmt ) {47 Statement * ForExprMutator::postmutate( WhileStmt * whileStmt ) { 48 48 return hoist( whileStmt, whileStmt->initialization ); 49 49 } -
src/ControlStruct/LabelFixer.cc
r76d3ca6 r466b1c9 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Tue Jul 28 13:32:43 201513 // Update Count : 15 611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 11 22:26:02 2019 13 // Update Count : 159 14 14 // 15 15 … … 32 32 } 33 33 34 LabelFixer::LabelFixer( LabelGenerator * gen ) : generator ( gen ) {34 LabelFixer::LabelFixer( LabelGenerator * gen ) : generator ( gen ) { 35 35 if ( generator == 0 ) 36 36 generator = LabelGenerator::getGenerator(); … … 49 49 50 50 // prune to at most one label definition for each statement 51 void LabelFixer::previsit( Statement * stmt ) {51 void LabelFixer::previsit( Statement * stmt ) { 52 52 std::list< Label > &labels = stmt->get_labels(); 53 53 … … 58 58 } 59 59 60 void LabelFixer::previsit( BranchStmt * branchStmt ) {60 void LabelFixer::previsit( BranchStmt * branchStmt ) { 61 61 previsit( ( Statement *)branchStmt ); 62 62 … … 75 75 76 76 77 // sets the definition of the labelTable entry to be the provided 78 // statement for every label in the listparameter. Happens for every kind of statement79 Label LabelFixer::setLabelsDef( std::list< Label > & llabel, Statement *definition ) {77 // sets the definition of the labelTable entry to be the provided statement for every label in the list 78 // parameter. Happens for every kind of statement 79 Label LabelFixer::setLabelsDef( std::list< Label > & llabel, Statement * definition ) { 80 80 assert( definition != 0 ); 81 81 assert( llabel.size() > 0 ); … … 100 100 } // for 101 101 102 // produce one of the labels attached to this statement to be 103 // temporarily used as the canonical label 102 // produce one of the labels attached to this statement to be temporarily used as the canonical label 104 103 return labelTable[ llabel.front() ]->get_label(); 105 104 } … … 117 116 118 117 // Builds a table that maps a label to its defining statement. 119 std::map<Label, Statement * > * LabelFixer::resolveJumps() throw ( SemanticErrorException ) {118 std::map<Label, Statement * > * LabelFixer::resolveJumps() throw ( SemanticErrorException ) { 120 119 std::map< Label, Statement * > *ret = new std::map< Label, Statement * >(); 121 120 for ( std::map< Label, Entry * >::iterator i = labelTable.begin(); i != labelTable.end(); ++i ) { -
src/ControlStruct/LabelGenerator.cc
r76d3ca6 r466b1c9 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Aug 14 14:14:00 201513 // Update Count : 1 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Mar 11 22:23:20 2019 13 // Update Count : 15 14 14 // 15 15 … … 24 24 25 25 namespace ControlStruct { 26 LabelGenerator * LabelGenerator::labelGenerator = 0;26 LabelGenerator * LabelGenerator::labelGenerator = 0; 27 27 28 LabelGenerator * LabelGenerator::getGenerator() {28 LabelGenerator * LabelGenerator::getGenerator() { 29 29 if ( LabelGenerator::labelGenerator == 0 ) 30 30 LabelGenerator::labelGenerator = new LabelGenerator(); 31 32 31 return labelGenerator; 33 32 } … … 38 37 if ( stmt && ! stmt->get_labels().empty() ) { 39 38 os << "_" << stmt->get_labels().front() << "__"; 40 } 39 } // if 41 40 std::string ret = os.str(); 42 41 Label l( ret ); -
src/Parser/ExpressionNode.cc
r76d3ca6 r466b1c9 10 10 // Created On : Sat May 16 13:17:07 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 28 21:36:38201913 // Update Count : 9 3312 // Last Modified On : Sun Mar 10 16:10:32 2019 13 // Update Count : 976 14 14 // 15 15 … … 66 66 void lnthSuffix( string & str, int & type, int & ltype ) { 67 67 string::size_type posn = str.find_last_of( "lL" ); 68 if ( posn != string::npos ) { 69 type = 3; // default 70 posn += 1; // advance to size 71 if ( str[posn] == '3' ) { // 32 72 type = ltype = 2; str.erase( posn, 2 ); 73 } else if ( str[posn] == '6' ) { // 64 74 type = ltype = 3; str.erase( posn, 2 ); 75 } else if ( str[posn] == '8' ) { // 8 76 type = ltype = 1; str.erase( posn, 1 ); 77 } else if ( str[posn] == '1' ) { 78 if ( str[posn + 1] == '6' ) { // 16 79 type = ltype = 0; str.erase( posn, 2 ); 80 } else { // 128 81 type = ltype = 5; str.erase( posn, 3 ); 82 } // if 83 } // if 84 } // if 68 69 if ( posn == string::npos ) return; // no suffix 70 if ( posn == str.length() - 1 ) { type = 3; return; } // no length => long 71 72 string::size_type next = posn + 1; // advance to length 73 if ( str[next] == '3' ) { // 32 74 type = ltype = 2; 75 } else if ( str[next] == '6' ) { // 64 76 type = ltype = 3; 77 } else if ( str[next] == '8' ) { // 8 78 type = ltype = 1; 79 } else if ( str[next] == '1' ) { 80 if ( str[next + 1] == '6' ) { // 16 81 type = ltype = 0; 82 } else { // 128 83 type = 5; ltype = 6; 84 } // if 85 } // if 86 // remove "lL" for these cases because it may not imply long 87 str.erase( posn ); // remove length 85 88 } // lnthSuffix 86 89 90 void valueToType( unsigned long long int & v, bool dec, int & type, bool & Unsigned ) { 91 // use value to determine type 92 if ( v <= INT_MAX ) { // signed int 93 type = 2; 94 } else if ( v <= UINT_MAX && ! dec ) { // unsigned int 95 type = 2; 96 Unsigned = true; // unsigned 97 } else if ( v <= LONG_MAX ) { // signed long int 98 type = 3; 99 } else if ( v <= ULONG_MAX && ( ! dec || LONG_MAX == LLONG_MAX ) ) { // signed long int 100 type = 3; 101 Unsigned = true; // unsigned long int 102 } else if ( v <= LLONG_MAX ) { // signed long long int 103 type = 4; 104 } else { // unsigned long long int 105 type = 4; 106 Unsigned = true; // unsigned long long int 107 } // if 108 } // valueToType 109 87 110 Expression * build_constantInteger( string & str ) { 88 static const BasicType::Kind kind[2][ 6] = {111 static const BasicType::Kind kind[2][7] = { 89 112 // short (h) must be before char (hh) because shorter type has the longer suffix 90 113 { BasicType::ShortSignedInt, BasicType::SignedChar, BasicType::SignedInt, BasicType::LongSignedInt, BasicType::LongLongSignedInt, BasicType::SignedInt128, }, … … 92 115 }; 93 116 94 static const char * lnthsInt[2][ 5] = {95 { "int16_t", "int8_t", "int32_t", "int64_t", "size_t", },96 { "uint16_t", "uint8_t", "uint32_t", "uint64_t", "size_t", },117 static const char * lnthsInt[2][6] = { 118 { "int16_t", "int8_t", "int32_t", "int64_t", "size_t", "uintptr_t", }, 119 { "uint16_t", "uint8_t", "uint32_t", "uint64_t", "size_t", "uintptr_t", }, 97 120 }; // lnthsInt 98 99 bool dec = true, Unsigned = false; // decimal, unsigned constant100 int type = -1; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => int128101 int ltype = -1; // literal length102 121 103 122 unsigned long long int v; // converted integral value 104 123 size_t last = str.length() - 1; // last subscript of constant 105 124 Expression * ret; 106 string fred( str ); 125 //string fred( str ); 126 127 int type = -1; // 0 => short, 1 => char, 2 => int, 3 => long int, 4 => long long int, 5 => int128 128 int ltype = -1; // 0 => 16 bits, 1 => 8 bits, 2 => 32 bits, 3 => 64 bits, 4 => size_t, 5 => intptr, 6 => pointer 129 bool dec = true, Unsigned = false; // decimal, unsigned constant 107 130 108 131 // special constants … … 116 139 } // if 117 140 118 // Cannot be just "0"/"1"; sscanf stops at the suffix, if any; value goes over the wall soalways generate141 // Cannot be just "0"/"1"; sscanf stops at the suffix, if any; value goes over the wall => always generate 119 142 120 143 if ( str[0] == '0' ) { // radix character ? … … 125 148 } else if ( checkB( str[1] ) ) { // binary constant ? 126 149 v = 0; // compute value 127 for ( unsigned int i = 2;; ) { 150 for ( unsigned int i = 2;; ) { // ignore prefix 128 151 if ( str[i] == '1' ) v |= 1; 129 152 i += 1; … … 145 168 if ( isdigit( str[last] ) ) { // no suffix ? 146 169 lnthSuffix( str, type, ltype ); // could have length suffix 147 if ( type == -1 ) { 148 // no suffix type, use value to determine type 149 if ( v <= INT_MAX ) { // signed int 150 type = 2; 151 } else if ( v <= UINT_MAX && ! dec ) { // unsigned int 152 type = 2; 153 Unsigned = true; // unsigned 154 } else if ( v <= LONG_MAX ) { // signed long int 155 type = 3; 156 } else if ( v <= ULONG_MAX && ( ! dec || LONG_MAX == LLONG_MAX ) ) { // signed long int 157 type = 3; 158 Unsigned = true; // unsigned long int 159 } else if ( v <= LLONG_MAX ) { // signed long long int 160 type = 4; 161 } else { // unsigned long long int 162 type = 4; 163 Unsigned = true; // unsigned long long int 164 } // if 170 if ( type == -1 ) { // no suffix 171 valueToType( v, dec, type, Unsigned ); 165 172 } // if 166 173 } else { 167 174 // At least one digit in integer constant, so safe to backup while looking for suffix. 168 175 176 posn = str.find_last_of( "pP" ); 177 if ( posn != string::npos ) { valueToType( v, dec, type, Unsigned ); ltype = 5; str.erase( posn, 1 ); goto FINI; } 178 179 posn = str.find_last_of( "zZ" ); 180 if ( posn != string::npos ) { Unsigned = true; type = 2; ltype = 4; str.erase( posn, 1 ); goto FINI; } 181 182 // 'u' can appear before or after length suffix 169 183 if ( str.find_last_of( "uU" ) != string::npos ) Unsigned = true; 170 184 … … 181 195 if ( posn != string::npos ) { type = 2; str.erase( posn, 1 ); goto FINI; } 182 196 183 posn = str.find_last_of( "zZ" );184 if ( posn != string::npos ) { Unsigned = true; type = 2; ltype = 4; str.erase( posn, 1 ); goto FINI; }185 186 197 if ( str.rfind( "ll" ) != string::npos || str.rfind( "LL" ) != string::npos ) { type = 4; goto FINI; } 187 198 188 199 lnthSuffix( str, type, ltype ); // must be after check for "ll" 189 if ( type == -1 ) { type = 3; goto FINI; } 200 if ( type == -1 ) { // only 'u' suffix ? 201 valueToType( v, dec, type, Unsigned ); 202 } // if 190 203 FINI: ; 191 204 } // if 192 205 193 //if ( !( 0 <= type && type < 6 ) ) { printf( "%s %lu %d %s\n", fred.c_str(), fred.length(), type, str.c_str() ); }194 assert( 0 <= type && type < 6 );206 //if ( !( 0 <= type && type <= 6 ) ) { printf( "%s %lu %d %s\n", fred.c_str(), fred.length(), type, str.c_str() ); } 207 assert( 0 <= type && type <= 6 ); 195 208 196 209 // Constant type is correct for overload resolving. … … 200 213 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][type] ), false ); 201 214 } else if ( ltype != -1 ) { // explicit length ? 202 if ( ltype == 5 ) { // int128 ? 203 type = 5; 215 if ( ltype == 6 ) { // int128, (int128)constant 204 216 ret = new CastExpr( ret, new BasicType( Type::Qualifiers(), kind[Unsigned][type] ), false ); 205 } else { 217 } else { // explicit length, (length_type)constant 206 218 ret = new CastExpr( ret, new TypeInstType( Type::Qualifiers(), lnthsInt[Unsigned][ltype], false ), false ); 219 if ( ltype == 5 ) { // pointer, intptr( (uintptr_t)constant ) 220 ret = build_func( new ExpressionNode( build_varref( new string( "intptr" ) ) ), new ExpressionNode( ret ) ); 221 } // if 207 222 } // if 208 223 } // if -
src/Parser/lex.ll
r76d3ca6 r466b1c9 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Feb 27 22:44:03201913 * Update Count : 70 412 * Last Modified On : Sun Mar 10 09:13:09 2019 13 * Update Count : 706 14 14 */ 15 15 … … 99 99 hex_quad {hex}("_"?{hex}){3} 100 100 size_opt (8|16|32|64|128)? 101 // CFA: explicit l8/l16/l32/l64/l128, char 'hh', short 'h', int 'n' 101 102 length ("ll"|"LL"|[lL]{size_opt})|("hh"|"HH"|[hHnN]) 102 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]))? 103 // CFA: size_t 'z', pointer 'p', which define a sign and length 104 integer_suffix_opt ("_"?(([uU]({length}?[iI]?)|([iI]{length}))|([iI]({length}?[uU]?)|([uU]{length}))|({length}([iI]?[uU]?)|([uU][iI]))|[zZ]|[pP]))? 103 105 104 106 octal_digits ({octal})|({octal}({octal}|"_")*{octal}) -
src/ResolvExpr/CommonType.cc
r76d3ca6 r466b1c9 177 177 178 178 // GENERATED START, DO NOT EDIT 179 // GENERATED BY ../../main/src/BasicTypes-gen.cc179 // GENERATED BY BasicTypes-gen.cc 180 180 #define BT BasicType:: 181 181 static const BasicType::Kind commonTypes[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // nearest common ancestor -
src/ResolvExpr/ConversionCost.cc
r76d3ca6 r466b1c9 182 182 183 183 // GENERATED START, DO NOT EDIT 184 // GENERATED BY ../../main/src/BasicTypes-gen.cc184 // GENERATED BY BasicTypes-gen.cc 185 185 /* EXTENDED INTEGRAL RANK HIERARCHY (root to leaves) 186 186 _Bool … … 207 207 208 208 // GENERATED START, DO NOT EDIT 209 // GENERATED BY ../../main/src/BasicTypes-gen.cc209 // GENERATED BY BasicTypes-gen.cc 210 210 static const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node 211 211 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */ … … 254 254 255 255 // GENERATED START, DO NOT EDIT 256 // GENERATED BY ../../main/src/BasicTypes-gen.cc256 // GENERATED BY BasicTypes-gen.cc 257 257 static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion 258 258 /* B C SC UC SI SUI I UI LI LUI LLI LLUI IB UIB _FH _FH _F _FC F FC _FX _FXC FD _FDC D DC F80X_FDXC F80 _FB_FLDC FB LD LDC _FBX_FLDXC */ -
src/SymTab/ManglerCommon.cc
r76d3ca6 r466b1c9 24 24 25 25 // GENERATED START, DO NOT EDIT 26 // GENERATED BY ../../main/src/BasicTypes-gen.cc26 // GENERATED BY BasicTypes-gen.cc 27 27 // NOTES ON MANGLING: 28 28 // * Itanium spec says that Float80 encodes to "e" (like LongDouble), but the distinct lengths cause resolution problems. -
src/SynTree/Statement.h
r76d3ca6 r466b1c9 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Mar 8 14:53:02 201813 // Update Count : 7812 // Last Modified On : Tue Mar 12 09:01:53 2019 13 // Update Count : 83 14 14 // 15 15 … … 19 19 #include <list> // for list 20 20 #include <memory> // for allocator 21 #include <vector> 21 #include <vector> // for vector 22 22 23 23 #include "BaseSyntaxNode.h" // for BaseSyntaxNode … … 43 43 const std::list<Label> & get_labels() const { return labels; } 44 44 45 virtual Statement * clone() const override = 0;46 virtual void accept( Visitor & v ) override = 0;47 virtual Statement * acceptMutator( Mutator &m ) override = 0;48 virtual void print( std::ostream & os, Indenter indent = {} ) const override;45 virtual Statement * clone() const override = 0; 46 virtual void accept( Visitor & v ) override = 0; 47 virtual Statement * acceptMutator( Mutator & m ) override = 0; 48 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 49 49 }; 50 50 … … 55 55 CompoundStmt(); 56 56 CompoundStmt( std::list<Statement *> stmts ); 57 CompoundStmt( const CompoundStmt & other );57 CompoundStmt( const CompoundStmt & other ); 58 58 virtual ~CompoundStmt(); 59 59 … … 62 62 void push_front( Statement * stmt ) { kids.push_front( stmt ); } 63 63 64 virtual CompoundStmt * clone() const override { return new CompoundStmt( *this ); }65 virtual void accept( Visitor & v ) override { v.visit( this ); }66 virtual CompoundStmt * acceptMutator( Mutator &m ) override { return m.mutate( this ); }67 virtual void print( std::ostream & os, Indenter indent = {} ) const override;64 virtual CompoundStmt * clone() const override { return new CompoundStmt( *this ); } 65 virtual void accept( Visitor & v ) override { v.visit( this ); } 66 virtual CompoundStmt * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 67 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 68 68 }; 69 69 … … 72 72 NullStmt( const std::list<Label> & labels = {} ); 73 73 74 virtual NullStmt * clone() const override { return new NullStmt( *this ); }75 virtual void accept( Visitor & v ) override { v.visit( this ); }76 virtual NullStmt * acceptMutator( Mutator &m ) override { return m.mutate( this ); }77 virtual void print( std::ostream & os, Indenter indent = {} ) const override;74 virtual NullStmt * clone() const override { return new NullStmt( *this ); } 75 virtual void accept( Visitor & v ) override { v.visit( this ); } 76 virtual NullStmt * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 77 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 78 78 }; 79 79 80 80 class ExprStmt : public Statement { 81 81 public: 82 Expression * expr;83 84 ExprStmt( Expression * expr );85 ExprStmt( const ExprStmt & other );82 Expression * expr; 83 84 ExprStmt( Expression * expr ); 85 ExprStmt( const ExprStmt & other ); 86 86 virtual ~ExprStmt(); 87 87 88 Expression * get_expr() { return expr; }89 void set_expr( Expression * newValue ) { expr = newValue; }90 91 virtual ExprStmt * clone() const override { return new ExprStmt( *this ); }92 virtual void accept( Visitor & v ) override { v.visit( this ); }93 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }94 virtual void print( std::ostream & os, Indenter indent = {} ) const override;88 Expression * get_expr() { return expr; } 89 void set_expr( Expression * newValue ) { expr = newValue; } 90 91 virtual ExprStmt * clone() const override { return new ExprStmt( *this ); } 92 virtual void accept( Visitor & v ) override { v.visit( this ); } 93 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 94 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 95 95 }; 96 96 … … 98 98 public: 99 99 bool voltile; 100 Expression * instruction;100 Expression * instruction; 101 101 std::list<Expression *> output, input; 102 102 std::list<ConstantExpr *> clobber; 103 103 std::list<Label> gotolabels; 104 104 105 AsmStmt( bool voltile, Expression * instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels );106 AsmStmt( const AsmStmt & other );105 AsmStmt( bool voltile, Expression * instruction, std::list<Expression *> output, std::list<Expression *> input, std::list<ConstantExpr *> clobber, std::list<Label> gotolabels ); 106 AsmStmt( const AsmStmt & other ); 107 107 virtual ~AsmStmt(); 108 108 … … 114 114 void set_output( const std::list<Expression *> & newValue ) { output = newValue; } 115 115 std::list<Expression *> & get_input() { return input; } 116 void set_input( const std::list<Expression *> & newValue ) { input = newValue; }116 void set_input( const std::list<Expression *> & newValue ) { input = newValue; } 117 117 std::list<ConstantExpr *> & get_clobber() { return clobber; } 118 void set_clobber( const std::list<ConstantExpr *> & newValue ) { clobber = newValue; }118 void set_clobber( const std::list<ConstantExpr *> & newValue ) { clobber = newValue; } 119 119 std::list<Label> & get_gotolabels() { return gotolabels; } 120 void set_gotolabels( const std::list<Label> & newValue ) { gotolabels = newValue; }120 void set_gotolabels( const std::list<Label> & newValue ) { gotolabels = newValue; } 121 121 122 122 virtual AsmStmt * clone() const { return new AsmStmt( *this ); } … … 141 141 class IfStmt : public Statement { 142 142 public: 143 Expression * condition;144 Statement * thenPart;145 Statement * elsePart;143 Expression * condition; 144 Statement * thenPart; 145 Statement * elsePart; 146 146 std::list<Statement *> initialization; 147 147 148 IfStmt( Expression * condition, Statement *thenPart, Statement *elsePart,148 IfStmt( Expression * condition, Statement * thenPart, Statement * elsePart, 149 149 std::list<Statement *> initialization = std::list<Statement *>() ); 150 IfStmt( const IfStmt & other );150 IfStmt( const IfStmt & other ); 151 151 virtual ~IfStmt(); 152 152 153 std::list<Statement *> & get_initialization() { return initialization; }154 Expression * get_condition() { return condition; }155 void set_condition( Expression * newValue ) { condition = newValue; }156 Statement * get_thenPart() { return thenPart; }157 void set_thenPart( Statement * newValue ) { thenPart = newValue; }158 Statement * get_elsePart() { return elsePart; }159 void set_elsePart( Statement * newValue ) { elsePart = newValue; }160 161 virtual IfStmt * clone() const override { return new IfStmt( *this ); }162 virtual void accept( Visitor & v ) override { v.visit( this ); }163 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }164 virtual void print( std::ostream & os, Indenter indent = {} ) const override;153 std::list<Statement *> & get_initialization() { return initialization; } 154 Expression * get_condition() { return condition; } 155 void set_condition( Expression * newValue ) { condition = newValue; } 156 Statement * get_thenPart() { return thenPart; } 157 void set_thenPart( Statement * newValue ) { thenPart = newValue; } 158 Statement * get_elsePart() { return elsePart; } 159 void set_elsePart( Statement * newValue ) { elsePart = newValue; } 160 161 virtual IfStmt * clone() const override { return new IfStmt( *this ); } 162 virtual void accept( Visitor & v ) override { v.visit( this ); } 163 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 164 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 165 165 }; 166 166 … … 170 170 std::list<Statement *> statements; 171 171 172 SwitchStmt( Expression * condition, const std::list<Statement *> &statements );173 SwitchStmt( const SwitchStmt & other );172 SwitchStmt( Expression * condition, const std::list<Statement *> & statements ); 173 SwitchStmt( const SwitchStmt & other ); 174 174 virtual ~SwitchStmt(); 175 175 176 Expression * get_condition() { return condition; }177 void set_condition( Expression * newValue ) { condition = newValue; }176 Expression * get_condition() { return condition; } 177 void set_condition( Expression * newValue ) { condition = newValue; } 178 178 179 179 std::list<Statement *> & get_statements() { return statements; } 180 180 181 virtual void accept( Visitor & v ) override { v.visit( this ); }182 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }183 184 virtual SwitchStmt * clone() const override { return new SwitchStmt( *this ); }185 virtual void print( std::ostream & os, Indenter indent = {} ) const override;181 virtual void accept( Visitor & v ) override { v.visit( this ); } 182 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 183 184 virtual SwitchStmt * clone() const override { return new SwitchStmt( *this ); } 185 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 186 186 187 187 }; … … 192 192 std::list<Statement *> stmts; 193 193 194 CaseStmt( Expression * conditions, const std::list<Statement *> &stmts, bool isdef = false ) throw (SemanticErrorException);195 CaseStmt( const CaseStmt & other );194 CaseStmt( Expression * conditions, const std::list<Statement *> & stmts, bool isdef = false ) throw (SemanticErrorException); 195 CaseStmt( const CaseStmt & other ); 196 196 virtual ~CaseStmt(); 197 197 … … 201 201 void set_default(bool b) { _isDefault = b; } 202 202 203 Expression * & get_condition() { return condition; }204 void set_condition( Expression * newValue ) { condition = newValue; }205 206 std::list<Statement *> & get_statements() { return stmts; }207 void set_statements( std::list<Statement *> & newValue ) { stmts = newValue; }208 209 virtual void accept( Visitor & v ) override { v.visit( this ); }210 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }211 212 virtual CaseStmt * clone() const override { return new CaseStmt( *this ); }213 virtual void print( std::ostream & os, Indenter indent = {} ) const override;203 Expression * & get_condition() { return condition; } 204 void set_condition( Expression * newValue ) { condition = newValue; } 205 206 std::list<Statement *> & get_statements() { return stmts; } 207 void set_statements( std::list<Statement *> & newValue ) { stmts = newValue; } 208 209 virtual void accept( Visitor & v ) override { v.visit( this ); } 210 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 211 212 virtual CaseStmt * clone() const override { return new CaseStmt( *this ); } 213 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 214 214 private: 215 215 bool _isDefault; … … 218 218 class WhileStmt : public Statement { 219 219 public: 220 Expression * condition;221 Statement * body;220 Expression * condition; 221 Statement * body; 222 222 std::list<Statement *> initialization; 223 223 bool isDoWhile; 224 224 225 WhileStmt( Expression *condition, 226 Statement *body, std::list<Statement *> & initialization, bool isDoWhile = false ); 227 WhileStmt( const WhileStmt &other ); 225 WhileStmt( Expression * condition, Statement * body, std::list<Statement *> & initialization, bool isDoWhile = false ); 226 WhileStmt( const WhileStmt & other ); 228 227 virtual ~WhileStmt(); 229 228 230 Expression * get_condition() { return condition; }231 void set_condition( Expression * newValue ) { condition = newValue; }232 Statement * get_body() { return body; }233 void set_body( Statement * newValue ) { body = newValue; }229 Expression * get_condition() { return condition; } 230 void set_condition( Expression * newValue ) { condition = newValue; } 231 Statement * get_body() { return body; } 232 void set_body( Statement * newValue ) { body = newValue; } 234 233 bool get_isDoWhile() { return isDoWhile; } 235 234 void set_isDoWhile( bool newValue ) { isDoWhile = newValue; } 236 235 237 virtual WhileStmt * clone() const override { return new WhileStmt( *this ); }238 virtual void accept( Visitor & v ) override { v.visit( this ); }239 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }240 virtual void print( std::ostream & os, Indenter indent = {} ) const override;236 virtual WhileStmt * clone() const override { return new WhileStmt( *this ); } 237 virtual void accept( Visitor & v ) override { v.visit( this ); } 238 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 239 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 241 240 }; 242 241 … … 244 243 public: 245 244 std::list<Statement *> initialization; 246 Expression *condition; 247 Expression *increment; 248 Statement *body; 249 250 ForStmt( std::list<Statement *> initialization, 251 Expression *condition = 0, Expression *increment = 0, Statement *body = 0 ); 252 ForStmt( const ForStmt &other ); 245 Expression * condition; 246 Expression * increment; 247 Statement * body; 248 249 ForStmt( std::list<Statement *> initialization, Expression * condition = 0, Expression * increment = 0, Statement * body = 0 ); 250 ForStmt( const ForStmt & other ); 253 251 virtual ~ForStmt(); 254 252 255 std::list<Statement *> & get_initialization() { return initialization; }256 Expression * get_condition() { return condition; }257 void set_condition( Expression * newValue ) { condition = newValue; }258 Expression * get_increment() { return increment; }259 void set_increment( Expression * newValue ) { increment = newValue; }260 Statement * get_body() { return body; }261 void set_body( Statement * newValue ) { body = newValue; }262 263 virtual ForStmt * clone() const override { return new ForStmt( *this ); }264 virtual void accept( Visitor & v ) override { v.visit( this ); }265 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }266 virtual void print( std::ostream & os, Indenter indent = {} ) const override;253 std::list<Statement *> & get_initialization() { return initialization; } 254 Expression * get_condition() { return condition; } 255 void set_condition( Expression * newValue ) { condition = newValue; } 256 Expression * get_increment() { return increment; } 257 void set_increment( Expression * newValue ) { increment = newValue; } 258 Statement * get_body() { return body; } 259 void set_body( Statement * newValue ) { body = newValue; } 260 261 virtual ForStmt * clone() const override { return new ForStmt( *this ); } 262 virtual void accept( Visitor & v ) override { v.visit( this ); } 263 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 264 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 267 265 }; 268 266 … … 274 272 const Label originalTarget; 275 273 Label target; 276 Expression * computedTarget;274 Expression * computedTarget; 277 275 Type type; 278 276 279 277 BranchStmt( Label target, Type ) throw (SemanticErrorException); 280 BranchStmt( Expression * computedTarget, Type ) throw (SemanticErrorException);278 BranchStmt( Expression * computedTarget, Type ) throw (SemanticErrorException); 281 279 282 280 Label get_originalTarget() { return originalTarget; } … … 284 282 void set_target( Label newValue ) { target = newValue; } 285 283 286 Expression * get_computedTarget() { return computedTarget; }284 Expression * get_computedTarget() { return computedTarget; } 287 285 void set_target( Expression * newValue ) { computedTarget = newValue; } 288 286 289 287 Type get_type() { return type; } 290 const char * get_typename() { return brType[ type ]; }291 292 virtual BranchStmt * clone() const override { return new BranchStmt( *this ); }293 virtual void accept( Visitor & v ) override { v.visit( this ); }294 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }295 virtual void print( std::ostream & os, Indenter indent = {} ) const override;288 const char * get_typename() { return brType[ type ]; } 289 290 virtual BranchStmt * clone() const override { return new BranchStmt( *this ); } 291 virtual void accept( Visitor & v ) override { v.visit( this ); } 292 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 293 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 296 294 private: 297 static const char * brType[];295 static const char * brType[]; 298 296 }; 299 297 300 298 class ReturnStmt : public Statement { 301 299 public: 302 Expression * expr;303 304 ReturnStmt( Expression * expr );305 ReturnStmt( const ReturnStmt & other );300 Expression * expr; 301 302 ReturnStmt( Expression * expr ); 303 ReturnStmt( const ReturnStmt & other ); 306 304 virtual ~ReturnStmt(); 307 305 308 Expression * get_expr() { return expr; }309 void set_expr( Expression * newValue ) { expr = newValue; }310 311 virtual ReturnStmt * clone() const override { return new ReturnStmt( *this ); }312 virtual void accept( Visitor & v ) override { v.visit( this ); }313 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }314 virtual void print( std::ostream & os, Indenter indent = {} ) const override;306 Expression * get_expr() { return expr; } 307 void set_expr( Expression * newValue ) { expr = newValue; } 308 309 virtual ReturnStmt * clone() const override { return new ReturnStmt( *this ); } 310 virtual void accept( Visitor & v ) override { v.visit( this ); } 311 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 312 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 315 313 }; 316 314 … … 324 322 325 323 ThrowStmt( Kind kind, Expression * expr, Expression * target = nullptr ); 326 ThrowStmt( const ThrowStmt & other );324 ThrowStmt( const ThrowStmt & other ); 327 325 virtual ~ThrowStmt(); 328 326 … … 333 331 void set_target( Expression * newTarget ) { target = newTarget; } 334 332 335 virtual ThrowStmt * clone() const override { return new ThrowStmt( *this ); }336 virtual void accept( Visitor & v ) override { v.visit( this ); }337 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }338 virtual void print( std::ostream & os, Indenter indent = {} ) const override;333 virtual ThrowStmt * clone() const override { return new ThrowStmt( *this ); } 334 virtual void accept( Visitor & v ) override { v.visit( this ); } 335 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 336 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 339 337 }; 340 338 … … 345 343 FinallyStmt * finallyBlock; 346 344 347 TryStmt( CompoundStmt * tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 );348 TryStmt( const TryStmt & other );345 TryStmt( CompoundStmt * tryBlock, std::list<CatchStmt *> & handlers, FinallyStmt * finallyBlock = 0 ); 346 TryStmt( const TryStmt & other ); 349 347 virtual ~TryStmt(); 350 348 351 CompoundStmt * get_block() const { return block; }352 void set_block( CompoundStmt * newValue ) { block = newValue; }349 CompoundStmt * get_block() const { return block; } 350 void set_block( CompoundStmt * newValue ) { block = newValue; } 353 351 std::list<CatchStmt *>& get_catchers() { return handlers; } 354 352 355 FinallyStmt * get_finally() const { return finallyBlock; }356 void set_finally( FinallyStmt * newValue ) { finallyBlock = newValue; }357 358 virtual TryStmt * clone() const override { return new TryStmt( *this ); }359 virtual void accept( Visitor & v ) override { v.visit( this ); }360 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }361 virtual void print( std::ostream & os, Indenter indent = {} ) const override;353 FinallyStmt * get_finally() const { return finallyBlock; } 354 void set_finally( FinallyStmt * newValue ) { finallyBlock = newValue; } 355 356 virtual TryStmt * clone() const override { return new TryStmt( *this ); } 357 virtual void accept( Visitor & v ) override { v.visit( this ); } 358 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 359 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 362 360 }; 363 361 … … 367 365 368 366 const Kind kind; 369 Declaration * decl;370 Expression * cond;371 Statement * body;372 373 CatchStmt( Kind kind, Declaration * decl,374 Expression * cond, Statement *body );375 CatchStmt( const CatchStmt & other );367 Declaration * decl; 368 Expression * cond; 369 Statement * body; 370 371 CatchStmt( Kind kind, Declaration * decl, 372 Expression * cond, Statement * body ); 373 CatchStmt( const CatchStmt & other ); 376 374 virtual ~CatchStmt(); 377 375 378 376 Kind get_kind() { return kind; } 379 Declaration * get_decl() { return decl; }380 void set_decl( Declaration * newValue ) { decl = newValue; }381 Expression * get_cond() { return cond; }382 void set_cond( Expression * newCond ) { cond = newCond; }383 Statement * get_body() { return body; }384 void set_body( Statement * newValue ) { body = newValue; }385 386 virtual CatchStmt * clone() const override { return new CatchStmt( *this ); }387 virtual void accept( Visitor & v ) override { v.visit( this ); }388 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }389 virtual void print( std::ostream & os, Indenter indent = {} ) const override;377 Declaration * get_decl() { return decl; } 378 void set_decl( Declaration * newValue ) { decl = newValue; } 379 Expression * get_cond() { return cond; } 380 void set_cond( Expression * newCond ) { cond = newCond; } 381 Statement * get_body() { return body; } 382 void set_body( Statement * newValue ) { body = newValue; } 383 384 virtual CatchStmt * clone() const override { return new CatchStmt( *this ); } 385 virtual void accept( Visitor & v ) override { v.visit( this ); } 386 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 387 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 390 388 }; 391 389 392 390 class FinallyStmt : public Statement { 393 391 public: 394 CompoundStmt * block;395 396 FinallyStmt( CompoundStmt * block );397 FinallyStmt( const FinallyStmt & other );392 CompoundStmt * block; 393 394 FinallyStmt( CompoundStmt * block ); 395 FinallyStmt( const FinallyStmt & other ); 398 396 virtual ~FinallyStmt(); 399 397 400 CompoundStmt * get_block() const { return block; }401 void set_block( CompoundStmt * newValue ) { block = newValue; }402 403 virtual FinallyStmt * clone() const override { return new FinallyStmt( *this ); }404 virtual void accept( Visitor & v ) override { v.visit( this ); }405 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }406 virtual void print( std::ostream & os, Indenter indent = {} ) const override;398 CompoundStmt * get_block() const { return block; } 399 void set_block( CompoundStmt * newValue ) { block = newValue; } 400 401 virtual FinallyStmt * clone() const override { return new FinallyStmt( *this ); } 402 virtual void accept( Visitor & v ) override { v.visit( this ); } 403 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 404 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 407 405 }; 408 406 … … 438 436 } orelse; 439 437 440 virtual WaitForStmt * clone() const override { return new WaitForStmt( *this ); }441 virtual void accept( Visitor & v ) override { v.visit( this ); }442 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }443 virtual void print( std::ostream & os, Indenter indent = {} ) const override;438 virtual WaitForStmt * clone() const override { return new WaitForStmt( *this ); } 439 virtual void accept( Visitor & v ) override { v.visit( this ); } 440 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 441 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 444 442 445 443 }; … … 464 462 class DeclStmt : public Statement { 465 463 public: 466 Declaration * decl;467 468 DeclStmt( Declaration * decl );469 DeclStmt( const DeclStmt & other );464 Declaration * decl; 465 466 DeclStmt( Declaration * decl ); 467 DeclStmt( const DeclStmt & other ); 470 468 virtual ~DeclStmt(); 471 469 472 Declaration *get_decl() const { return decl; } 473 void set_decl( Declaration *newValue ) { decl = newValue; } 474 475 virtual DeclStmt *clone() const override { return new DeclStmt( *this ); } 476 virtual void accept( Visitor &v ) override { v.visit( this ); } 477 virtual Statement *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 478 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 479 }; 480 481 482 /// represents an implicit application of a constructor or destructor. Qualifiers are replaced 483 /// immediately before and after the call so that qualified objects can be constructed 484 /// with the same functions as unqualified objects. 470 Declaration * get_decl() const { return decl; } 471 void set_decl( Declaration * newValue ) { decl = newValue; } 472 473 virtual DeclStmt * clone() const override { return new DeclStmt( *this ); } 474 virtual void accept( Visitor & v ) override { v.visit( this ); } 475 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 476 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 477 }; 478 479 480 /// represents an implicit application of a constructor or destructor. Qualifiers are replaced immediately before and 481 /// after the call so that qualified objects can be constructed with the same functions as unqualified objects. 485 482 class ImplicitCtorDtorStmt : public Statement { 486 483 public: … … 492 489 virtual ~ImplicitCtorDtorStmt(); 493 490 494 Statement * get_callStmt() const { return callStmt; }491 Statement * get_callStmt() const { return callStmt; } 495 492 void set_callStmt( Statement * newValue ) { callStmt = newValue; } 496 493 497 virtual ImplicitCtorDtorStmt * clone() const override { return new ImplicitCtorDtorStmt( *this ); }498 virtual void accept( Visitor & v ) override { v.visit( this ); }499 virtual Statement * acceptMutator( Mutator &m ) override { return m.mutate( this ); }500 virtual void print( std::ostream & os, Indenter indent = {} ) const override;494 virtual ImplicitCtorDtorStmt * clone() const override { return new ImplicitCtorDtorStmt( *this ); } 495 virtual void accept( Visitor & v ) override { v.visit( this ); } 496 virtual Statement * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 497 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 501 498 }; 502 499 -
src/SynTree/Type.h
r76d3ca6 r466b1c9 208 208 public: 209 209 // GENERATED START, DO NOT EDIT 210 // GENERATED BY ../../main/src/BasicTypes-gen.cc210 // GENERATED BY BasicTypes-gen.cc 211 211 enum Kind { 212 212 Bool,
Note:
See TracChangeset
for help on using the changeset viewer.