- File:
-
- 1 edited
-
src/ControlStruct/ExceptDecl.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptDecl.cc
rc715e5f rda602aec 9 9 // Author : Henry Xue 10 10 // Created On : Tue Jul 20 04:10:50 2021 11 // Last Modified By : Andrew Beach12 // Last Modified On : Wed May 25 16:43:00 202213 // Update Count : 511 // Last Modified By : Henry Xue 12 // Last Modified On : Tue Aug 03 10:42:26 2021 13 // Update Count : 4 14 14 // 15 15 … … 39 39 } 40 40 41 StructInstType * makeExceptInstType(42 const std::string & exceptionName, 43 const std::list< Expression *> & parameters 44 ) { 45 StructInstType * exceptInstType = new StructInstType(41 TypeInstType * makeExceptInstType( 42 const std::string & exceptionName, 43 const std::list< Expression *> & parameters 44 ) { 45 TypeInstType * exceptInstType = new TypeInstType( 46 46 noQualifiers, 47 exceptionName 47 exceptionName, 48 false 48 49 ); 49 50 cloneAll( parameters, exceptInstType->parameters ); … … 150 151 nullptr, 151 152 new PointerType( noQualifiers, 152 new StructInstType( Type::Const, "__cfavir_type_info") ),153 new TypeInstType( Type::Const, "__cfavir_type_info", false ) ), 153 154 nullptr 154 155 ) ); … … 256 257 const std::string & exceptionName, 257 258 const std::list< TypeDecl *> & forallClause, 258 const std::list< Expression *> & parameters, 259 const std::list< Expression *> & parameters, 259 260 const std::list< Declaration *> & members 260 261 ) { … … 301 302 ObjectDecl * ehmExternVtable( 302 303 const std::string & exceptionName, 303 const std::list< Expression *> & parameters, 304 const std::list< Expression *> & parameters, 304 305 const std::string & tableName 305 306 ) { … … 456 457 } 457 458 458 class VTableCore : public WithDeclsToAdd {459 public:460 // Remove any remaining vtable type nodes in the tree.461 Type * postmutate( VTableType * vtableType );462 };463 464 Type * VTableCore::postmutate( VTableType * vtableType ) {465 auto inst = strict_dynamic_cast<ReferenceToType *>( vtableType->base );466 467 std::string vtableName = Virtual::vtableTypeName( inst->name );468 StructInstType * newType = new StructInstType( noQualifiers, vtableName );469 cloneAll( inst->parameters, newType->parameters );470 471 delete vtableType;472 return newType;473 }474 475 459 void translateExcept( std::list< Declaration *> & translationUnit ) { 476 460 PassVisitor<ExceptDeclCore> translator; 477 461 mutateAll( translationUnit, translator ); 478 PassVisitor<VTableCore> typeTranslator; 479 mutateAll( translationUnit, typeTranslator ); 480 } 481 482 } 462 } 463 464 }
Note:
See TracChangeset
for help on using the changeset viewer.