Changeset a16764a6 for src/InitTweak
- Timestamp:
- Feb 28, 2018, 4:48:22 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 446ffa3
- Parents:
- 6a8df56
- Location:
- src/InitTweak
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixGlobalInit.cc
r6a8df56 ra16764a6 21 21 22 22 #include "Common/PassVisitor.h" 23 #include "Common/SemanticError.h" // for SemanticError24 23 #include "Common/UniqueName.h" // for UniqueName 25 24 #include "InitTweak.h" // for isIntrinsicSingleArgCallStmt -
src/InitTweak/FixInit.cc
r6a8df56 ra16764a6 213 213 Expression * postmutate( UntypedExpr * expr ); 214 214 215 SemanticError errors;215 SemanticErrorException errors; 216 216 private: 217 217 template< typename... Params > … … 276 276 // can't use mutateAll, because need to insert declarations at top-level 277 277 // can't use DeclMutator, because sometimes need to insert IfStmt, etc. 278 SemanticError errors;278 SemanticErrorException errors; 279 279 for ( std::list< Declaration * >::iterator i = translationUnit.begin(); i != translationUnit.end(); ++i ) { 280 280 try { 281 281 maybeMutate( *i, fixer ); 282 282 translationUnit.splice( i, fixer.pass.staticDtorDecls ); 283 } catch( SemanticError &e ) {283 } catch( SemanticErrorException &e ) { 284 284 errors.append( e ); 285 285 } // try … … 894 894 ) 895 895 if ( ! diff.empty() ) { 896 throwSemanticError( stmt, std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " " );896 SemanticError( stmt, std::string("jump to label '") + stmt->get_target().get_name() + "' crosses initialization of " + (*diff.begin())->get_name() + " " ); 897 897 } // if 898 898 // S_G-S_L results in set of objects that must be destructed … … 945 945 GuardValue( isCtor ); 946 946 GuardValue( structDecl ); 947 errors = SemanticError (); // clear previous errors947 errors = SemanticErrorException(); // clear previous errors 948 948 949 949 // need to start with fresh sets … … 1034 1034 function->get_statements()->push_back( callStmt ); 1035 1035 } 1036 } catch ( SemanticError & error ) {1036 } catch ( SemanticErrorException & error ) { 1037 1037 emit( funcDecl->location, "in ", CodeGen::genPrettyType( function->get_functionType(), function->get_name() ), ", field ", field->get_name(), " not explicitly ", isCtor ? "constructed" : "destructed", " and no ", isCtor ? "default constructor" : "destructor", " found" ); 1038 1038 } … … 1110 1110 template< typename Visitor, typename... Params > 1111 1111 void error( Visitor & v, CodeLocation loc, const Params &... params ) { 1112 SemanticError err( loc, toString( params... ) );1112 SemanticErrorException err( loc, toString( params... ) ); 1113 1113 v.errors.append( err ); 1114 1114 } -
src/InitTweak/GenInit.cc
r6a8df56 ra16764a6 317 317 if ( tryConstruct( objDecl ) && ( managedTypes.isManaged( objDecl ) || ((! inFunction || objDecl->get_storageClasses().is_static ) && ! isConstExpr( objDecl->get_init() ) ) ) ) { 318 318 // constructed objects cannot be designated 319 if ( isDesignated( objDecl->get_init() ) ) throwSemanticError( objDecl, "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n" );319 if ( isDesignated( objDecl->get_init() ) ) SemanticError( objDecl, "Cannot include designations in the initializer for a managed Object. If this is really what you want, then initialize with @=.\n" ); 320 320 // constructed objects should not have initializers nested too deeply 321 if ( ! checkInitDepth( objDecl ) ) throwSemanticError( objDecl, "Managed object's initializer is too deep " );321 if ( ! checkInitDepth( objDecl ) ) SemanticError( objDecl, "Managed object's initializer is too deep " ); 322 322 323 323 objDecl->set_init( genCtorInit( objDecl ) ); -
src/InitTweak/InitTweak.cc
r6a8df56 ra16764a6 225 225 // xxx - this shouldn't be an error, but need a way to 226 226 // terminate without creating output, so should catch this error 227 throwSemanticError( init->location, "unbalanced list initializers" );227 SemanticError( init->location, "unbalanced list initializers" ); 228 228 } 229 229
Note: See TracChangeset
for help on using the changeset viewer.