- Timestamp:
- Jun 23, 2022, 1:41:39 PM (4 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 3322180, a6cfb4d, fd365da
- Parents:
- 4e83bb7 (diff), 9dad5b3 (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:
-
- 10 edited
-
AST/Pass.impl.hpp (modified) (1 diff)
-
Common/ResolvProtoDump.cpp (modified) (1 diff)
-
GenPoly/GenPoly.cc (modified) (1 diff)
-
InitTweak/GenInit.cc (modified) (1 diff)
-
Parser/lex.ll (modified) (1 diff)
-
Parser/parser.yy (modified) (6 diffs)
-
ResolvExpr/CurrentObject.cc (modified) (1 diff)
-
SymTab/Mangler.cc (modified) (1 diff)
-
SymTab/ValidateType.cc (modified) (1 diff)
-
SynTree/Type.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.impl.hpp
r4e83bb7 rd28524a 648 648 if ( __visit_children() ) { 649 649 // unlike structs, traits, and unions, enums inject their members into the global scope 650 maybe_accept( node, &EnumDecl::base ); 650 651 maybe_accept( node, &EnumDecl::params ); 651 652 maybe_accept( node, &EnumDecl::members ); -
src/Common/ResolvProtoDump.cpp
r4e83bb7 rd28524a 227 227 } 228 228 229 void previsit( const ast::EnumInstType * enumInst) {229 void previsit( const ast::EnumInstType * ) { 230 230 // TODO: Add the meaningful text representation of typed enum 231 231 ss << (int)ast::BasicType::SignedInt; -
src/GenPoly/GenPoly.cc
r4e83bb7 rd28524a 64 64 } 65 65 66 __attribute__((unu nsed))66 __attribute__((unused)) 67 67 bool hasPolyParams( const std::vector<ast::ptr<ast::Expr>> & params, const TyVarMap & tyVars, const ast::TypeSubstitution * env) { 68 68 for (auto ¶m : params) { -
src/InitTweak/GenInit.cc
r4e83bb7 rd28524a 642 642 643 643 ast::ConstructorInit * genCtorInit( const CodeLocation & loc, const ast::ObjectDecl * objDecl ) { 644 // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor for each 644 // call into genImplicitCall from Autogen.h to generate calls to ctor/dtor for each 645 645 // constructable object 646 646 InitExpander_new srcParam{ objDecl->init }, nullParam{ (const ast::Init *)nullptr }; 647 647 ast::ptr< ast::Expr > dstParam = new ast::VariableExpr(loc, objDecl); 648 649 ast::ptr< ast::Stmt > ctor = SymTab::genImplicitCall( 648 649 ast::ptr< ast::Stmt > ctor = SymTab::genImplicitCall( 650 650 srcParam, dstParam, loc, "?{}", objDecl ); 651 ast::ptr< ast::Stmt > dtor = SymTab::genImplicitCall( 652 nullParam, dstParam, loc, "^?{}", objDecl, 651 ast::ptr< ast::Stmt > dtor = SymTab::genImplicitCall( 652 nullParam, dstParam, loc, "^?{}", objDecl, 653 653 SymTab::LoopBackward ); 654 654 655 655 // check that either both ctor and dtor are present, or neither 656 656 assert( (bool)ctor == (bool)dtor ); 657 657 658 658 if ( ctor ) { 659 // need to remember init expression, in case no ctors exist. If ctor does exist, want to 659 // need to remember init expression, in case no ctors exist. If ctor does exist, want to 660 660 // use ctor expression instead of init. 661 ctor.strict_as< ast::ImplicitCtorDtorStmt >(); 661 ctor.strict_as< ast::ImplicitCtorDtorStmt >(); 662 662 dtor.strict_as< ast::ImplicitCtorDtorStmt >(); 663 663 -
src/Parser/lex.ll
r4e83bb7 rd28524a 82 82 // Stop warning due to incorrectly generated flex code. 83 83 #pragma GCC diagnostic ignored "-Wsign-compare" 84 85 // lex uses __null in a boolean context, it's fine. 86 #pragma GCC diagnostic ignored "-Wnull-conversion" 84 87 %} 85 88 -
src/Parser/parser.yy
r4e83bb7 rd28524a 56 56 57 57 #include "SynTree/Attribute.h" // for Attribute 58 59 // lex uses __null in a boolean context, it's fine. 60 #pragma GCC diagnostic ignored "-Wparentheses-equality" 58 61 59 62 extern DeclarationNode * parseTree; … … 1240 1243 { 1241 1244 $$ = new StatementNode( build_while( new CondCtl( nullptr, new ExpressionNode( build_constantInteger( *new string( "1" ) ) ) ), maybe_build_compound( $4 ) ) ); 1242 SemanticWarning( yylloc, Warning::SuperfluousElse );1245 SemanticWarning( yylloc, Warning::SuperfluousElse, "" ); 1243 1246 } 1244 1247 | WHILE '(' conditional_declaration ')' statement %prec THEN … … 1251 1254 { 1252 1255 $$ = new StatementNode( build_do_while( new ExpressionNode( build_constantInteger( *new string( "1" ) ) ), maybe_build_compound( $2 ) ) ); 1253 SemanticWarning( yylloc, Warning::SuperfluousElse );1256 SemanticWarning( yylloc, Warning::SuperfluousElse, "" ); 1254 1257 } 1255 1258 | DO statement WHILE '(' comma_expression ')' ';' … … 1262 1265 { 1263 1266 $$ = new StatementNode( build_for( new ForCtrl( (ExpressionNode * )nullptr, (ExpressionNode * )nullptr, (ExpressionNode * )nullptr ), maybe_build_compound( $4 ) ) ); 1264 SemanticWarning( yylloc, Warning::SuperfluousElse );1267 SemanticWarning( yylloc, Warning::SuperfluousElse, "" ); 1265 1268 } 1266 1269 | FOR '(' for_control_expression_list ')' statement %prec THEN … … 2394 2397 | ENUM '(' cfa_abstract_parameter_declaration ')' attribute_list_opt '{' enumerator_list comma_opt '}' 2395 2398 { 2396 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) 2399 if ( $3->storageClasses.val != 0 || $3->type->qualifiers.val != 0 ) 2397 2400 { SemanticError( yylloc, "storage-class and CV qualifiers are not meaningful for enumeration constants, which are const." ); } 2398 2401 … … 2841 2844 linkage = LinkageSpec::update( yylloc, linkage, $2 ); 2842 2845 } 2843 up external_definition down 2846 up external_definition down 2844 2847 { 2845 2848 linkage = linkageStack.top(); -
src/ResolvExpr/CurrentObject.cc
r4e83bb7 rd28524a 73 73 virtual void setPosition( std::list< Expression * > & designators ) = 0; 74 74 75 /// retrieve the list of possible Type/Designat on pairs for the current position in the currect object75 /// retrieve the list of possible Type/Designation pairs for the current position in the currect object 76 76 virtual std::list<InitAlternative> operator*() const = 0; 77 77 -
src/SymTab/Mangler.cc
r4e83bb7 rd28524a 537 537 } 538 538 539 __attribute__((unused)) 539 540 inline std::vector< ast::ptr< ast::Type > > getTypes( const std::vector< ast::ptr< ast::DeclWithType > > & decls ) { 540 541 std::vector< ast::ptr< ast::Type > > ret; -
src/SymTab/ValidateType.cc
r4e83bb7 rd28524a 222 222 // visit enum members first so that the types of self-referencing members are updated properly 223 223 // Replace the enum base; right now it works only for StructEnum 224 if ( enumDecl->base && dynamic_cast<TypeInstType*>(enumDecl->base) ) { 225 std::string baseName = static_cast<TypeInstType*>(enumDecl->base)->name; 226 const StructDecl * st = local_indexer->lookupStruct( baseName ); 227 if ( st ) { 228 enumDecl->base = new StructInstType(Type::Qualifiers(),const_cast<StructDecl *>(st)); // Just linking in the node 224 if ( enumDecl->base ) { 225 if ( const TypeInstType * base = dynamic_cast< TypeInstType * >(enumDecl->base) ) { 226 if ( const StructDecl * decl = local_indexer->lookupStruct( base->name ) ) { 227 enumDecl->base = new StructInstType( Type::Qualifiers(), const_cast< StructDecl * >( decl ) ); // Just linking in the node 228 } 229 } else if ( const PointerType * ptr = dynamic_cast< PointerType * >(enumDecl->base) ) { 230 if ( const TypeInstType * ptrBase = dynamic_cast< TypeInstType * >( ptr->base ) ) { 231 if ( const StructDecl * decl = local_indexer->lookupStruct( ptrBase->name ) ) { 232 enumDecl->base = new PointerType( Type::Qualifiers(), 233 new StructInstType( Type::Qualifiers(), const_cast< StructDecl * >( decl ) ) ); 234 } 235 } 229 236 } 230 237 } 238 231 239 if ( enumDecl->body ) { 232 240 ForwardEnumsType::iterator fwds = forwardEnums.find( enumDecl->name ); -
src/SynTree/Type.h
r4e83bb7 rd28524a 274 274 class PointerType : public Type { 275 275 public: 276 Type * base;276 Type * base; 277 277 278 278 // In C99, pointer types can be qualified in many ways e.g., int f( int a[ static 3 ] ) … … 516 516 typedef ReferenceToType Parent; 517 517 public: 518 // this decl is not "owned" by the unioninst; it is merely a pointer to elsewhere in the tree,519 // where the unionused in this type is actually defined518 // this decl is not "owned" by the enum inst; it is merely a pointer to elsewhere in the tree, 519 // where the enum used in this type is actually defined 520 520 EnumDecl *baseEnum = nullptr; 521 521
Note:
See TracChangeset
for help on using the changeset viewer.