- Timestamp:
- Nov 10, 2020, 12:44:44 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 080b0a1, 883c4d9, f33eab7
- Parents:
- 82a2fed (diff), cdacb73 (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/AST
- Files:
-
- 6 edited
-
Convert.cpp (modified) (2 diffs)
-
Decl.hpp (modified) (1 diff)
-
Init.hpp (modified) (4 diffs)
-
Pass.impl.hpp (modified) (2 diffs)
-
Pass.proto.hpp (modified) (1 diff)
-
Type.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r82a2fed rb82d140 2764 2764 old->location, 2765 2765 GET_ACCEPT_1(value, Expr), 2766 (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast:: DoConstruct2766 (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::NoConstruct 2767 2767 ); 2768 2768 } … … 2773 2773 GET_ACCEPT_V(initializers, Init), 2774 2774 GET_ACCEPT_V(designations, Designation), 2775 (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast:: DoConstruct2775 (old->get_maybeConstructed()) ? ast::MaybeConstruct : ast::NoConstruct 2776 2776 ); 2777 2777 } -
src/AST/Decl.hpp
r82a2fed rb82d140 79 79 ptr<Expr> asmName; 80 80 bool isDeleted = false; 81 bool isTypeFixed = false; 81 82 82 83 DeclWithType( const CodeLocation& loc, const std::string& name, Storage::Classes storage, -
src/AST/Init.hpp
r82a2fed rb82d140 50 50 51 51 /// Flag for whether to construct from initialzier 52 enum ConstructFlag { DoConstruct, MaybeConstruct };52 enum ConstructFlag { NoConstruct, MaybeConstruct }; 53 53 54 54 /// Object initializer base class … … 71 71 ptr<Expr> value; 72 72 73 SingleInit( const CodeLocation & loc, const Expr * val, ConstructFlag mc = DoConstruct )73 SingleInit( const CodeLocation & loc, const Expr * val, ConstructFlag mc = NoConstruct ) 74 74 : Init( loc, mc ), value( val ) {} 75 75 … … 90 90 91 91 ListInit( const CodeLocation & loc, std::vector<ptr<Init>> && is, 92 std::vector<ptr<Designation>> && ds = {}, ConstructFlag mc = DoConstruct );92 std::vector<ptr<Designation>> && ds = {}, ConstructFlag mc = NoConstruct ); 93 93 94 94 using iterator = std::vector<ptr<Init>>::iterator; … … 118 118 ConstructorInit( 119 119 const CodeLocation & loc, const Stmt * ctor, const Stmt * dtor, const Init * init ) 120 : Init( loc, DoConstruct ), ctor( ctor ), dtor( dtor ), init( init ) {}120 : Init( loc, MaybeConstruct ), ctor( ctor ), dtor( dtor ), init( init ) {} 121 121 122 122 const Init * accept( Visitor & v ) const override { return v.visit( this ); } -
src/AST/Pass.impl.hpp
r82a2fed rb82d140 423 423 } 424 424 catch( SemanticErrorException &e ) { 425 errors.append( e ); 425 if (__pass::onError (visitor.core, *i, 0)) 426 errors.append( e ); 426 427 } 427 428 … … 683 684 // Do not enter (or leave) a new scope if atFunctionTop. Remember to save the result. 684 685 auto guard1 = makeFuncGuard( [this, enterScope = !this->atFunctionTop]() { 685 if ( enterScope ) __pass::symtab::enter(core, 0); 686 if ( enterScope ) { 687 __pass::symtab::enter(core, 0); 688 __pass::scope::enter(core, 0); 689 } 686 690 }, [this, leaveScope = !this->atFunctionTop]() { 687 if ( leaveScope ) __pass::symtab::leave(core, 0); 691 if ( leaveScope ) { 692 __pass::symtab::leave(core, 0); 693 __pass::scope::leave(core, 0); 694 } 688 695 }); 689 696 ValueGuard< bool > guard2( atFunctionTop ); -
src/AST/Pass.proto.hpp
r82a2fed rb82d140 266 266 static void endTrace(core_t &, long) {} 267 267 268 // Allows visitor to handle an error on top-level declarations, and possibly suppress the error. 269 // If onError() returns false, the error will be ignored. By default, it returns true. 270 271 template< typename core_t > 272 static bool onError (core_t &, ptr<Decl> &, long) { return true; } 273 274 template< typename core_t > 275 static auto onError (core_t & core, ptr<Decl> & decl, int) -> decltype(core.onError(decl)) { 276 return core.onError(decl); 277 } 278 268 279 // Another feature of the templated visitor is that it calls beginScope()/endScope() for compound statement. 269 280 // All passes which have such functions are assumed desire this behaviour -
src/AST/Type.cpp
r82a2fed rb82d140 211 211 for ( const Type * ty : types ) { 212 212 members.emplace_back( new ObjectDecl{ 213 CodeLocation{}, "", ty, new ListInit( CodeLocation{}, {}, {}, MaybeConstruct ),213 CodeLocation{}, "", ty, new ListInit( CodeLocation{}, {}, {}, NoConstruct ), 214 214 Storage::Classes{}, Linkage::Cforall } ); 215 215 }
Note:
See TracChangeset
for help on using the changeset viewer.