Changeset a1b154d
- Timestamp:
- May 21, 2019, 4:53:35 PM (6 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:
- 907c545
- Parents:
- 5b35c21 (diff), 514a791 (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:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r5b35c21 ra1b154d 10 10 // Created On : Thu May 09 15::37::05 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri May 17 16:01:00 201913 // Update Count : 412 // Last Modified On : Tue May 21 15:30:00 2019 13 // Update Count : 5 14 14 // 15 15 16 16 #include "Convert.hpp" 17 18 #include <unordered_map> 17 19 18 20 #include "AST/Attribute.hpp" … … 42 44 class ConverterNewToOld : public ast::Visitor { 43 45 BaseSyntaxNode * node = nullptr; 46 std::unordered_map< ast::Node *, BaseSyntaxNode * > cache; 44 47 45 48 template<typename T> … … 47 50 ConverterNewToOld & visitor; 48 51 49 template<typename U> 50 T * accept1( const ast::ptr<U> & ptr ) { 52 template<typename U, enum ast::Node::ref_type R> 53 T * accept1( const ast::ptr_base<U, R> & ptr ) { 54 if ( ! ptr ) return nullptr; 51 55 ptr->accept( visitor ); 52 56 T * ret = strict_dynamic_cast< T * >( visitor.node ); … … 87 91 } 88 92 93 /// get new qualifiers from old type 94 Type::Qualifiers cv( const ast::Type * ty ) { return { ty->qualifiers.val }; } 95 96 template<typename NewT, typename OldT> 97 NewT * cached( const OldT & old ) { 98 auto it = cache.find( old.get() ); 99 if ( it == cache.end() ) { 100 // doesn't update cache, that should be handled by the accept function 101 return get< NewT >().accept1( old ); 102 } else { 103 return strict_dynamic_cast< NewT * >( it->second ); 104 } 105 } 106 89 107 public: 90 108 Declaration * decl( const ast::Decl * declNode ) { … … 93 111 94 112 private: 113 void declPostamble( Declaration * decl, const ast::Decl * node ) { 114 decl->location = node->location; 115 // name comes from constructor 116 // linkage comes from constructor 117 decl->extension = node->extension; 118 decl->uniqueId = node->uniqueId; 119 // storageClasses comes from constructor 120 this->node = decl; 121 } 122 123 const ast::DeclWithType * declWithTypePostamble ( 124 DeclarationWithType * decl, const ast::DeclWithType * node ) { 125 declPostamble( decl, node ); 126 decl->mangleName = node->mangleName; 127 decl->scopeLevel = node->scopeLevel; 128 decl->asmName = get<Expression>().accept1( node->asmName ); 129 // attributes comes from constructor 130 decl->isDeleted = node->isDeleted; 131 // fs comes from constructor 132 return nullptr; 133 } 134 95 135 const ast::DeclWithType * visit( const ast::ObjectDecl * node ) override final { 96 (void)node; 97 return nullptr; 136 auto decl = new ObjectDecl( 137 node->name, 138 Type::StorageClasses( node->storage.val ), 139 LinkageSpec::Spec( node->linkage.val ), 140 get<Expression>().accept1( node->bitfieldWidth ), 141 get<Type>().accept1( node->type ), 142 get<Initializer>().accept1( node->init ), 143 get<Attribute>().acceptL( node->attributes ), 144 Type::FuncSpecifiers( node->funcSpec.val ) 145 ); 146 return declWithTypePostamble( decl, node ); 98 147 } 99 148 100 149 const ast::DeclWithType * visit( const ast::FunctionDecl * node ) override final { 101 (void)node; 150 auto decl = new FunctionDecl( 151 node->name, 152 Type::StorageClasses( node->storage.val ), 153 LinkageSpec::Spec( node->linkage.val ), 154 get<FunctionType>().accept1( node->type ), 155 get<CompoundStmt>().accept1( node->stmts ), 156 get<Attribute>().acceptL( node->attributes ), 157 Type::FuncSpecifiers( node->funcSpec.val ) 158 ); 159 decl->withExprs = get<Expression>().acceptL( node->withExprs ); 160 return declWithTypePostamble( decl, node ); 161 } 162 163 // NamedTypeDecl 164 const ast::Decl * namedTypePostamble( NamedTypeDecl * decl, const ast::NamedTypeDecl * node ) { 165 declPostamble( decl, node ); 166 // base comes from constructor 167 decl->parameters = get<TypeDecl>().acceptL( node->params ); 168 decl->assertions = get<DeclarationWithType>().acceptL( node->assertions ); 169 return nullptr; 170 } 171 172 const ast::Decl * visit( const ast::TypeDecl * node ) override final { 173 TypeDecl::Kind kind; 174 switch (node->kind) { 175 case ast::TypeVar::Dtype: 176 kind = TypeDecl::Dtype; 177 break; 178 case ast::TypeVar::Ftype: 179 kind = TypeDecl::Ftype; 180 break; 181 case ast::TypeVar::Ttype: 182 kind = TypeDecl::Ttype; 183 break; 184 default: 185 assertf(false, "Invalid ast::TypeVar::Kind: %d\n", node->kind); 186 }; 187 auto decl = new TypeDecl( 188 node->name, 189 Type::StorageClasses( node->storage.val ), 190 get<Type>().accept1( node->base ), 191 kind, 192 node->sized, 193 get<Type>().accept1( node->init ) 194 ); 195 return namedTypePostamble( decl, node ); 196 } 197 198 const ast::Decl * visit( const ast::TypedefDecl * node ) override final { 199 auto decl = new TypedefDecl( 200 node->name, 201 node->location, 202 Type::StorageClasses( node->storage.val ), 203 get<Type>().accept1( node->base ), 204 LinkageSpec::Spec( node->linkage.val ) 205 ); 206 return namedTypePostamble( decl, node ); 207 } 208 209 const ast::Decl * aggregatePostamble( AggregateDecl * decl, const ast::AggregateDecl * node ) { 210 decl->members = get<Declaration>().acceptL( node->members ); 211 decl->parameters = get<TypeDecl>().acceptL( node->params ); 212 decl->body = node->body; 213 // attributes come from constructor 214 // TODO: Need caching for: decl->parent = node->parent; 102 215 return nullptr; 103 216 } 104 217 105 218 const ast::Decl * visit( const ast::StructDecl * node ) override final { 106 (void)node; 107 return nullptr; 219 auto decl = new StructDecl( 220 node->name, 221 node->kind, 222 get<Attribute>().acceptL( node->attributes ), 223 LinkageSpec::Spec( node->linkage.val ) 224 ); 225 return aggregatePostamble( decl, node ); 108 226 } 109 227 110 228 const ast::Decl * visit( const ast::UnionDecl * node ) override final { 111 (void)node; 112 return nullptr; 229 auto decl = new UnionDecl( 230 node->name, 231 get<Attribute>().acceptL( node->attributes ), 232 LinkageSpec::Spec( node->linkage.val ) 233 ); 234 return aggregatePostamble( decl, node ); 113 235 } 114 236 115 237 const ast::Decl * visit( const ast::EnumDecl * node ) override final { 116 (void)node; 117 return nullptr; 238 auto decl = new EnumDecl( 239 node->name, 240 get<Attribute>().acceptL( node->attributes ), 241 LinkageSpec::Spec( node->linkage.val ) 242 ); 243 return aggregatePostamble( decl, node ); 118 244 } 119 245 120 246 const ast::Decl * visit( const ast::TraitDecl * node ) override final { 121 (void)node; 122 return nullptr; 123 } 124 125 const ast::Decl * visit( const ast::TypeDecl * node ) override final { 126 (void)node; 127 return nullptr; 128 } 129 130 const ast::Decl * visit( const ast::TypedefDecl * node ) override final { 131 (void)node; 132 return nullptr; 247 auto decl = new TraitDecl( 248 node->name, 249 {}, 250 LinkageSpec::Spec( node->linkage.val ) 251 ); 252 return aggregatePostamble( decl, node ); 133 253 } 134 254 135 255 const ast::AsmDecl * visit( const ast::AsmDecl * node ) override final { 136 (void)node; 256 auto decl = new AsmDecl( get<AsmStmt>().accept1( node->stmt ) ); 257 declPostamble( decl, node ); 137 258 return nullptr; 138 259 } 139 260 140 261 const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * node ) override final { 141 (void)node; 142 return nullptr; 143 } 144 145 const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) override final { 146 auto stmt = new CompoundStmt( get<Statement>().acceptL( node->kids ) ); 262 auto decl = new StaticAssertDecl( 263 get<Expression>().accept1( node->cond ), 264 get<ConstantExpr>().accept1( node->msg ) 265 ); 266 declPostamble( decl, node ); 267 return nullptr; 268 } 269 270 const ast::Stmt * stmtPostamble( Statement * stmt, const ast::Stmt * node ) { 147 271 stmt->location = node->location; 148 272 stmt->labels = makeLabelL( stmt, node->labels ); … … 151 275 } 152 276 277 const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) override final { 278 auto stmt = new CompoundStmt( get<Statement>().acceptL( node->kids ) ); 279 stmtPostamble( stmt, node ); 280 return nullptr; 281 } 282 153 283 const ast::Stmt * visit( const ast::ExprStmt * node ) override final { 154 284 auto stmt = new ExprStmt( get<Expression>().accept1( node->expr ) ); 155 stmt->location = node->location; 156 stmt->labels = makeLabelL( stmt, node->labels ); 157 this->node = stmt; 158 return nullptr; 285 return stmtPostamble( stmt, node ); 159 286 } 160 287 … … 168 295 makeLabelL( nullptr, node->gotoLabels ) // What are these labelling? 169 296 ); 170 stmt->location = node->location; 171 stmt->labels = makeLabelL( stmt, node->labels ); 172 this->node = stmt; 173 return nullptr; 297 return stmtPostamble( stmt, node ); 174 298 } 175 299 176 300 const ast::Stmt * visit( const ast::DirectiveStmt * node ) override final { 177 301 auto stmt = new DirectiveStmt( node->directive ); 178 stmt->location = node->location; 179 stmt->labels = makeLabelL( stmt, node->labels ); 180 this->node = stmt; 181 return nullptr; 302 return stmtPostamble( stmt, node ); 182 303 } 183 304 … … 189 310 get<Statement>().acceptL( node->inits ) 190 311 ); 191 stmt->location = node->location; 192 stmt->labels = makeLabelL( stmt, node->labels ); 193 this->node = stmt; 194 return nullptr; 312 return stmtPostamble( stmt, node ); 195 313 } 196 314 … … 200 318 get<Statement>().acceptL( node->stmts ) 201 319 ); 202 stmt->location = node->location; 203 stmt->labels = makeLabelL( stmt, node->labels ); 204 this->node = stmt; 205 return nullptr; 320 return stmtPostamble( stmt, node ); 206 321 } 207 322 … … 212 327 node->isDefault() 213 328 ); 214 stmt->location = node->location; 215 stmt->labels = makeLabelL( stmt, node->labels ); 216 this->node = stmt; 217 return nullptr; 329 return stmtPostamble( stmt, node ); 218 330 } 219 331 … … 226 338 node->isDoWhile 227 339 ); 228 stmt->location = node->location; 229 stmt->labels = makeLabelL( stmt, node->labels ); 230 this->node = stmt; 231 return nullptr; 340 return stmtPostamble( stmt, node ); 232 341 } 233 342 … … 239 348 get<Statement>().accept1( node->body ) 240 349 ); 241 stmt->location = node->location; 242 stmt->labels = makeLabelL( stmt, node->labels ); 243 this->node = stmt; 244 return nullptr; 350 return stmtPostamble( stmt, node ); 245 351 } 246 352 … … 271 377 stmt->target = makeLabel( stmt, node->target ); 272 378 } 273 stmt->location = node->location; 274 stmt->labels = makeLabelL( stmt, node->labels ); 275 this->node = stmt; 276 return nullptr; 379 return stmtPostamble( stmt, node ); 277 380 } 278 381 279 382 const ast::Stmt * visit( const ast::ReturnStmt * node ) override final { 280 383 auto stmt = new ReturnStmt( get<Expression>().accept1( node->expr ) ); 281 stmt->location = node->location; 282 stmt->labels = makeLabelL( stmt, node->labels ); 283 this->node = stmt; 284 return nullptr; 384 return stmtPostamble( stmt, node ); 285 385 } 286 386 … … 302 402 get<Expression>().accept1( node->target ) 303 403 ); 304 stmt->location = node->location; 305 stmt->labels = makeLabelL( stmt, node->labels ); 306 this->node = stmt; 307 return nullptr; 404 return stmtPostamble( stmt, node ); 308 405 } 309 406 … … 315 412 get<FinallyStmt>().accept1( node->finally ) 316 413 ); 317 stmt->location = node->location; 318 stmt->labels = makeLabelL( stmt, node->labels ); 319 this->node = stmt; 320 return nullptr; 414 return stmtPostamble( stmt, node ); 321 415 } 322 416 … … 339 433 get<Statement>().accept1( node->body ) 340 434 ); 341 stmt->location = node->location; 342 stmt->labels = makeLabelL( stmt, node->labels ); 343 this->node = stmt; 344 return nullptr; 435 return stmtPostamble( stmt, node ); 345 436 } 346 437 347 438 const ast::Stmt * visit( const ast::FinallyStmt * node ) override final { 348 439 auto stmt = new FinallyStmt( get<CompoundStmt>().accept1( node->body ) ); 349 stmt->location = node->location; 350 stmt->labels = makeLabelL( stmt, node->labels ); 351 this->node = stmt; 352 return nullptr; 440 return stmtPostamble( stmt, node ); 353 441 } 354 442 … … 358 446 for ( auto clause : node->clauses ) { 359 447 stmt->clauses.push_back({{ 360 get<Expression>().accept1( clause.target.func tion),361 get<Expression>().acceptL( clause.target.arg uments ),448 get<Expression>().accept1( clause.target.func ), 449 get<Expression>().acceptL( clause.target.args ), 362 450 }, 363 451 get<Statement>().accept1( clause.stmt ), … … 374 462 get<Expression>().accept1( node->orElse.cond ), 375 463 }; 376 stmt->location = node->location; 377 stmt->labels = makeLabelL( stmt, node->labels ); 378 this->node = stmt; 379 return nullptr; 464 return stmtPostamble( stmt, node ); 380 465 } 381 466 … … 385 470 get<Statement>().accept1( node->stmt ) 386 471 ); 387 stmt->location = node->location; 388 stmt->labels = makeLabelL( stmt, node->labels ); 389 this->node = stmt; 390 return nullptr; 472 return stmtPostamble( stmt, node ); 391 473 } 392 474 393 475 const ast::NullStmt * visit( const ast::NullStmt * node ) override final { 394 476 auto stmt = new NullStmt(); 395 stmt->location = node->location; 396 stmt->labels = makeLabelL( stmt, node->labels ); 397 this->node = stmt; 477 stmtPostamble( stmt, node ); 398 478 return nullptr; 399 479 } … … 401 481 const ast::Stmt * visit( const ast::DeclStmt * node ) override final { 402 482 auto stmt = new DeclStmt( get<Declaration>().accept1( node->decl ) ); 403 stmt->location = node->location; 404 stmt->labels = makeLabelL( stmt, node->labels ); 405 this->node = stmt; 406 return nullptr; 483 return stmtPostamble( stmt, node ); 407 484 } 408 485 … … 670 747 671 748 const ast::Type * visit( const ast::VoidType * node ) override final { 672 (void)node;749 this->node = new VoidType{ cv( node ) }; 673 750 return nullptr; 674 751 } 675 752 676 753 const ast::Type * visit( const ast::BasicType * node ) override final { 677 (void)node;754 this->node = new BasicType{ cv( node ), (BasicType::Kind)(unsigned)node->kind }; 678 755 return nullptr; 679 756 } 680 757 681 758 const ast::Type * visit( const ast::PointerType * node ) override final { 682 (void)node; 759 this->node = new PointerType{ 760 cv( node ), 761 get<Type>().accept1( node->base ), 762 get<Expression>().accept1( node->dimension ), 763 node->isVarLen, 764 node->isStatic 765 }; 683 766 return nullptr; 684 767 } 685 768 686 769 const ast::Type * visit( const ast::ArrayType * node ) override final { 687 (void)node; 770 this->node = new ArrayType{ 771 cv( node ), 772 get<Type>().accept1( node->base ), 773 get<Expression>().accept1( node->dimension ), 774 node->isVarLen, 775 node->isStatic 776 }; 688 777 return nullptr; 689 778 } 690 779 691 780 const ast::Type * visit( const ast::ReferenceType * node ) override final { 692 (void)node; 781 this->node = new ReferenceType{ 782 cv( node ), 783 get<Type>().accept1( node->base ) 784 }; 693 785 return nullptr; 694 786 } 695 787 696 788 const ast::Type * visit( const ast::QualifiedType * node ) override final { 697 (void)node; 789 this->node = new QualifiedType{ 790 cv( node ), 791 get<Type>().accept1( node->parent ), 792 get<Type>().accept1( node->child ) 793 }; 698 794 return nullptr; 699 795 } 700 796 701 797 const ast::Type * visit( const ast::FunctionType * node ) override final { 702 (void)node; 798 auto ty = new FunctionType { cv( node ), node->isVarArgs }; 799 ty->returnVals = get<DeclarationWithType>().acceptL( node->returns ); 800 ty->parameters = get<DeclarationWithType>().acceptL( node->params ); 801 ty->forall = get<TypeDecl>().acceptL( node->forall ); 802 this->node = ty; 703 803 return nullptr; 704 804 } … … 808 908 } 809 909 private: 910 /// conversion output 810 911 ast::Node * node; 912 /// cache of nodes that might be referenced by readonly<> for de-duplication 913 std::unordered_map< BaseSyntaxNode *, ast::Node * > cache; 811 914 812 915 // Local Utilities: … … 814 917 template<typename NewT, typename OldT> 815 918 NewT * getAccept1( OldT old ) { 919 if ( ! old ) return nullptr; 816 920 old->accept(*this); 817 921 return strict_dynamic_cast< NewT * >( node ); … … 854 958 # define GET_LABELS_V(labels) \ 855 959 to<std::vector>::from( make_labels( std::move( labels ) ) ) 960 961 static ast::CV::Qualifiers cv( Type * ty ) { return { ty->get_qualifiers().val }; } 962 963 template<typename NewT, typename OldT> 964 NewT * cached( OldT * old ) { 965 auto it = cache.find( old ); 966 // doesn't update cache, that should be handled by the accept function 967 ast::Node * nw = it == cache.end() ? getAccept1< NewT >( old ) : it->second; 968 return strict_dynamic_cast< NewT * >( nw ); 969 } 856 970 857 971 // Now all the visit functions: … … 1260 1374 } 1261 1375 1262 void convertInferUnion(ast::Expr::InferUnion &newInferred, 1376 void convertInferUnion(ast::Expr::InferUnion &newInferred, 1263 1377 const std::map<UniqueId,ParamEntry> &oldInferParams, 1264 1378 const std::vector<UniqueId> &oldResnSlots) { … … 1467 1581 } 1468 1582 1469 virtual void visit( VoidType * ) override final { 1470 1471 } 1472 1473 virtual void visit( BasicType * ) override final { 1474 1475 } 1476 1477 virtual void visit( PointerType * ) override final { 1478 1479 } 1480 1481 virtual void visit( ArrayType * ) override final { 1482 1483 } 1484 1485 virtual void visit( ReferenceType * ) override final { 1486 1487 } 1488 1489 virtual void visit( QualifiedType * ) override final { 1490 1491 } 1492 1493 virtual void visit( FunctionType * ) override final { 1494 1495 } 1496 1497 virtual void visit( StructInstType * ) override final { 1498 1499 } 1500 1501 virtual void visit( UnionInstType * ) override final { 1502 1503 } 1504 1505 virtual void visit( EnumInstType * ) override final { 1506 1507 } 1508 1509 virtual void visit( TraitInstType * ) override final { 1510 1511 } 1512 1513 virtual void visit( TypeInstType * ) override final { 1514 1583 virtual void visit( VoidType * old ) override final { 1584 this->node = new ast::VoidType{ cv( old ) }; 1585 } 1586 1587 virtual void visit( BasicType * old ) override final { 1588 this->node = new ast::BasicType{ (ast::BasicType::Kind)(unsigned)old->kind, cv( old ) }; 1589 } 1590 1591 virtual void visit( PointerType * old ) override final { 1592 this->node = new ast::PointerType{ 1593 GET_ACCEPT_1( base, Type ), 1594 GET_ACCEPT_1( dimension, Expr ), 1595 (ast::LengthFlag)old->isVarLen, 1596 (ast::DimensionFlag)old->isStatic, 1597 cv( old ) 1598 }; 1599 } 1600 1601 virtual void visit( ArrayType * old ) override final { 1602 this->node = new ast::ArrayType{ 1603 GET_ACCEPT_1( base, Type ), 1604 GET_ACCEPT_1( dimension, Expr ), 1605 (ast::LengthFlag)old->isVarLen, 1606 (ast::DimensionFlag)old->isStatic, 1607 cv( old ) 1608 }; 1609 } 1610 1611 virtual void visit( ReferenceType * old ) override final { 1612 this->node = new ast::ReferenceType{ 1613 GET_ACCEPT_1( base, Type ), 1614 cv( old ) 1615 }; 1616 } 1617 1618 virtual void visit( QualifiedType * old ) override final { 1619 this->node = new ast::QualifiedType{ 1620 GET_ACCEPT_1( parent, Type ), 1621 GET_ACCEPT_1( child, Type ), 1622 cv( old ) 1623 }; 1624 } 1625 1626 virtual void visit( FunctionType * old ) override final { 1627 auto ty = new ast::FunctionType { 1628 (ast::ArgumentFlag)old->isVarArgs, 1629 cv( old ) 1630 }; 1631 ty->returns = GET_ACCEPT_V( returnVals, DeclWithType ); 1632 ty->params = GET_ACCEPT_V( parameters, DeclWithType ); 1633 ty->forall = GET_ACCEPT_V( forall, TypeDecl ); 1634 this->node = ty; 1635 } 1636 1637 void postvisit( ReferenceToType * old, ast::ReferenceToType * ty ) { 1638 ty->forall = GET_ACCEPT_V( forall, TypeDecl ); 1639 ty->params = GET_ACCEPT_V( parameters, Expr ); 1640 ty->hoistType = old->hoistType; 1641 } 1642 1643 virtual void visit( StructInstType * old ) override final { 1644 auto ty = new ast::StructInstType{ 1645 cached< ast::StructDecl >( old->baseStruct ), 1646 cv( old ), 1647 GET_ACCEPT_V( attributes, Attribute ) 1648 }; 1649 postvisit( old, ty ); 1650 this->node = ty; 1651 } 1652 1653 virtual void visit( UnionInstType * old ) override final { 1654 auto ty = new ast::UnionInstType{ 1655 cached< ast::UnionDecl >( old->baseUnion ), 1656 cv( old ), 1657 GET_ACCEPT_V( attributes, Attribute ) 1658 }; 1659 postvisit( old, ty ); 1660 this->node = ty; 1661 } 1662 1663 virtual void visit( EnumInstType * old ) override final { 1664 auto ty = new ast::EnumInstType{ 1665 cached< ast::EnumDecl >( old->baseEnum ), 1666 cv( old ), 1667 GET_ACCEPT_V( attributes, Attribute ) 1668 }; 1669 postvisit( old, ty ); 1670 this->node = ty; 1671 } 1672 1673 virtual void visit( TraitInstType * old ) override final { 1674 auto ty = new ast::TraitInstType{ 1675 cached< ast::TraitDecl >( old->baseTrait ), 1676 cv( old ), 1677 GET_ACCEPT_V( attributes, Attribute ) 1678 }; 1679 postvisit( old, ty ); 1680 this->node = ty; 1681 } 1682 1683 virtual void visit( TypeInstType * old ) override final { 1684 ast::TypeInstType * ty; 1685 if ( old->baseType ) { 1686 ty = new ast::TypeInstType{ 1687 old->name, 1688 cached< ast::TypeDecl >( old->baseType ), 1689 cv( old ), 1690 GET_ACCEPT_V( attributes, Attribute ) 1691 }; 1692 } else { 1693 ty = new ast::TypeInstType{ 1694 old->name, 1695 old->isFtype ? ast::TypeVar::Ftype : ast::TypeVar::Dtype, 1696 cv( old ), 1697 GET_ACCEPT_V( attributes, Attribute ) 1698 }; 1699 } 1700 postvisit( old, ty ); 1701 this->node = ty; 1515 1702 } 1516 1703 -
src/AST/Decl.cpp
r5b35c21 ra1b154d 81 81 auto result = eval( init->value ); 82 82 if ( ! result.second ) { 83 SemanticError( init->location, toString( "Non-constexpr in initialization of "83 SemanticError( init->location, ::toString( "Non-constexpr in initialization of " 84 84 "enumerator: ", field ) ); 85 85 } … … 87 87 } 88 88 if ( enumValues.count( field->name ) != 0 ) { 89 SemanticError( location, toString( "Enum ", name, " has multiple members with the " "name ", field->name ) );89 SemanticError( location, ::toString( "Enum ", name, " has multiple members with the " "name ", field->name ) ); 90 90 } 91 91 enumValues[ field->name ] = crntVal; -
src/AST/Decl.hpp
r5b35c21 ra1b154d 329 329 class StaticAssertDecl : public Decl { 330 330 public: 331 ptr<Expr> cond ition;331 ptr<Expr> cond; 332 332 ptr<ConstantExpr> msg; // string literal 333 333 334 334 StaticAssertDecl( const CodeLocation & loc, const Expr * condition, const ConstantExpr * msg ) 335 : Decl( loc, "", {}, {} ), cond ition( condition ), msg( msg ) {}335 : Decl( loc, "", {}, {} ), cond( condition ), msg( msg ) {} 336 336 337 337 const StaticAssertDecl * accept( Visitor &v ) const override { return v.visit( this ); } -
src/AST/Expr.cpp
r5b35c21 ra1b154d 22 22 #include "Stmt.hpp" 23 23 #include "Type.hpp" 24 #include "Common/utility.h" 24 25 #include "Common/SemanticError.h" 25 26 #include "GenPoly/Lvalue.h" // for referencesPermissable -
src/AST/Expr.hpp
r5b35c21 ra1b154d 521 521 }; 522 522 523 /// The application of a function to a set of parameters, along with a set of copy constructor 523 /// The application of a function to a set of parameters, along with a set of copy constructor 524 524 /// calls, one for each argument 525 525 class ImplicitCopyCtorExpr final : public Expr { … … 621 621 }; 622 622 623 /// A multiple- or mass-assignment operation, or a tuple ctor/dtor expression. 624 /// multiple-assignment: both sides of the assignment have tuple type, 623 /// A multiple- or mass-assignment operation, or a tuple ctor/dtor expression. 624 /// multiple-assignment: both sides of the assignment have tuple type, 625 625 /// e.g. `[a, b, c] = [d, e, f];` 626 626 /// mass-assignment: left-hand side has tuple type and right-hand side does not: … … 630 630 ptr<StmtExpr> stmtExpr; 631 631 632 TupleAssignExpr( 633 const CodeLocation & loc, std::vector<ptr<Expr>> && assigns, 632 TupleAssignExpr( 633 const CodeLocation & loc, std::vector<ptr<Expr>> && assigns, 634 634 std::vector<ptr<ObjectDecl>> && tempDecls ); 635 635 636 636 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 637 637 private: -
src/AST/Fwd.hpp
r5b35c21 ra1b154d 131 131 class TypeSubstitution; 132 132 133 std::string toString( const Node * );134 135 template < typename ... Params >136 std::string toString( const Params & ... params );137 138 133 typedef unsigned int UniqueId; 139 134 -
src/AST/Node.cpp
r5b35c21 ra1b154d 16 16 #include "Node.hpp" 17 17 #include "Fwd.hpp" 18 19 #include <iostream> 18 20 19 21 #include "Attribute.hpp" … … 42 44 assign( r ); 43 45 return r; 46 } 47 48 std::ostream & ast::operator<< ( std::ostream & out, const ast::Node * node ) { 49 (void)node; 50 #warning unimplemented 51 assertf(false, "Unimplemented"); 52 return out; 44 53 } 45 54 -
src/AST/Pass.impl.hpp
r5b35c21 ra1b154d 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Pass.impl.hpp --7 // ast::Pass.impl.hpp -- 8 8 // 9 9 // Author : Thierry Delisle … … 121 121 template< typename pass_t > 122 122 template< typename node_t > 123 auto Pass< pass_t >::call_accept( const node_t * node )123 auto ast::Pass< pass_t >::call_accept( const node_t * node ) 124 124 -> typename std::enable_if< 125 125 !std::is_base_of<ast::Expr, node_t>::value && … … 139 139 140 140 template< typename pass_t > 141 const ast::Expr * Pass< pass_t >::call_accept( const ast::Expr * expr ) {141 const ast::Expr * ast::Pass< pass_t >::call_accept( const ast::Expr * expr ) { 142 142 __pedantic_pass_assert( __visit_children() ); 143 143 __pedantic_pass_assert( expr ); … … 152 152 153 153 template< typename pass_t > 154 const ast::Stmt * Pass< pass_t >::call_accept( const ast::Stmt * stmt ) {154 const ast::Stmt * ast::Pass< pass_t >::call_accept( const ast::Stmt * stmt ) { 155 155 __pedantic_pass_assert( __visit_children() ); 156 156 __pedantic_pass_assert( stmt ); … … 204 204 template< typename pass_t > 205 205 template< template <class...> class container_t > 206 container_t< ptr<Stmt> > Pass< pass_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {206 container_t< ptr<Stmt> > ast::Pass< pass_t >::call_accept( const container_t< ptr<Stmt> > & statements ) { 207 207 __pedantic_pass_assert( __visit_children() ); 208 208 if( statements.empty() ) return {}; … … 270 270 template< typename pass_t > 271 271 template< template <class...> class container_t, typename node_t > 272 container_t< ast::ptr<node_t> > Pass< pass_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {272 container_t< ast::ptr<node_t> > ast::Pass< pass_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) { 273 273 __pedantic_pass_assert( __visit_children() ); 274 274 if( container.empty() ) return {}; … … 301 301 template< typename pass_t > 302 302 template<typename node_t, typename parent_t, typename child_t> 303 void Pass< pass_t >::maybe_accept(303 void ast::Pass< pass_t >::maybe_accept( 304 304 const node_t * & parent, 305 305 child_t parent_t::*child … … 571 571 __pass::indexer::addType( pass, 0, node ); 572 572 573 maybe_accept( node, &TypedefDecl::assertions );573 VISIT( maybe_accept( node, &TypedefDecl::assertions ); ) 574 574 575 575 VISIT_END( Decl, node ); … … 596 596 597 597 VISIT( 598 maybe_accept( node, &StaticAssertDecl::cond ition);599 maybe_accept( node, &StaticAssertDecl::msg 598 maybe_accept( node, &StaticAssertDecl::cond ); 599 maybe_accept( node, &StaticAssertDecl::msg ); 600 600 ) 601 601 … … 626 626 // ExprStmt 627 627 template< typename pass_t > 628 const ast::Stmt * ast::Pass< pass_t >::visit( const ExprStmt * node ) {628 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ExprStmt * node ) { 629 629 VISIT_START( node ); 630 630 … … 666 666 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::IfStmt * node ) { 667 667 VISIT_START( node ); 668 668 669 VISIT({ 669 670 // if statements introduce a level of scope (for the initialization) … … 674 675 maybe_accept( node, &IfStmt::elsePart ); 675 676 }) 677 676 678 VISIT_END( Stmt, node ); 677 679 } … … 680 682 // WhileStmt 681 683 template< typename pass_t > 682 const ast::Stmt * ast::Pass< pass_t >::visit( const WhileStmt * node ) {684 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::WhileStmt * node ) { 683 685 VISIT_START( node ); 684 686 … … 832 834 // maybeAccept_impl( clause.condition, *this ); 833 835 // } 836 837 VISIT({ 838 std::vector<WaitForStmt::Clause> new_clauses; 839 new_clauses.reserve( node->clauses.size() ); 840 bool mutated = false; 841 for( const auto & clause : node->clauses ) { 842 843 Expr * func = clause.target.func ? clause.target.func->accept(*this) : nullptr; 844 if(func != clause.target.func) mutated = true; 845 846 std::vector<ptr<Expr>> new_args; 847 new_args.reserve(clause.target.args.size()); 848 for( const auto & arg : clause.target.args ) { 849 auto a = arg->accept(*this); 850 new_args.push_back( a ); 851 if( a != arg ) mutated = true; 852 } 853 854 Stmt * stmt = clause.stmt ? clause.stmt->accept(*this) : nullptr; 855 if(stmt != clause.stmt) mutated = true; 856 857 Expr * cond = clause.cond ? clause.cond->accept(*this) : nullptr; 858 if(cond != clause.cond) mutated = true; 859 860 new_clauses.push_back( WaitForStmt::Clause{ {func, std::move(new_args) }, stmt, cond } ); 861 } 862 863 if(mutated) { 864 auto n = mutate(node); 865 n->clauses = std::move( new_clauses ); 866 node = n; 867 } 868 }) 834 869 835 870 #define maybe_accept(field) \ … … 910 945 } 911 946 912 913 914 915 947 //-------------------------------------------------------------------------- 948 // ApplicationExpr 949 template< typename pass_t > 950 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ApplicationExpr * node ) { 951 VISIT_START( node ); 952 953 VISIT( 954 { 955 guard_indexer guard { *this }; 956 maybe_accept( node, &ApplicationExpr::result ); 957 } 958 maybe_accept( node, &ApplicationExpr::func ); 959 maybe_accept( node, &ApplicationExpr::args ); 960 ) 961 962 VISIT_END( Expr, node ); 963 } 964 965 //-------------------------------------------------------------------------- 966 // UntypedExpr 967 template< typename pass_t > 968 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedExpr * node ) { 969 VISIT_START( node ); 970 971 VISIT( 972 { 973 guard_indexer guard { *this }; 974 maybe_accept( node, &UntypedExpr::result ); 975 } 976 977 maybe_accept( node, &UntypedExpr::args ); 978 ) 979 980 VISIT_END( Expr, node ); 981 } 982 983 //-------------------------------------------------------------------------- 984 // NameExpr 985 template< typename pass_t > 986 const ast::Expr * ast::Pass< pass_t >::visit( const ast::NameExpr * node ) { 987 VISIT_START( node ); 988 989 VISIT({ 990 guard_indexer guard { *this }; 991 maybe_accept( node, &NameExpr::result ); 992 }) 993 994 VISIT_END( Expr, node ); 995 } 996 997 //-------------------------------------------------------------------------- 998 // CastExpr 999 template< typename pass_t > 1000 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CastExpr * node ) { 1001 VISIT_START( node ); 1002 1003 VISIT({ 1004 guard_indexer guard { *this }; 1005 maybe_accept( node, &CastExpr::result ); 1006 } 1007 maybe_accept( node, &CastExpr::arg ); 1008 ) 1009 1010 VISIT_END( Expr, node ); 1011 } 1012 1013 //-------------------------------------------------------------------------- 1014 // KeywordCastExpr 1015 template< typename pass_t > 1016 const ast::Expr * ast::Pass< pass_t >::visit( const ast::KeywordCastExpr * node ) { 1017 VISIT_START( node ); 1018 1019 VISIT({ 1020 guard_indexer guard { *this }; 1021 maybe_accept( node, &KeywordCastExpr::result ); 1022 } 1023 maybe_accept( node, &KeywordCastExpr::arg ); 1024 ) 1025 1026 VISIT_END( Expr, node ); 1027 } 1028 1029 //-------------------------------------------------------------------------- 1030 // VirtualCastExpr 1031 template< typename pass_t > 1032 const ast::Expr * ast::Pass< pass_t >::visit( const ast::VirtualCastExpr * node ) { 1033 VISIT_START( node ); 1034 1035 VISIT({ 1036 guard_indexer guard { *this }; 1037 maybe_accept( node, &VirtualCastExpr::result ); 1038 } 1039 maybe_accept( node, &VirtualCastExpr::arg ); 1040 ) 1041 1042 VISIT_END( Expr, node ); 1043 } 1044 1045 //-------------------------------------------------------------------------- 1046 // AddressExpr 1047 template< typename pass_t > 1048 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AddressExpr * node ) { 1049 VISIT_START( node ); 1050 1051 VISIT({ 1052 guard_indexer guard { *this }; 1053 maybe_accept( node, &AddressExpr::result ); 1054 } 1055 maybe_accept( node, &AddressExpr::arg ); 1056 ) 1057 1058 VISIT_END( Expr, node ); 1059 } 1060 1061 //-------------------------------------------------------------------------- 1062 // LabelAddressExpr 1063 template< typename pass_t > 1064 const ast::Expr * ast::Pass< pass_t >::visit( const ast::LabelAddressExpr * node ) { 1065 VISIT_START( node ); 1066 1067 VISIT({ 1068 guard_indexer guard { *this }; 1069 maybe_accept( node, &LabelAddressExpr::result ); 1070 }) 1071 1072 VISIT_END( Expr, node ); 1073 } 1074 1075 //-------------------------------------------------------------------------- 1076 // UntypedMemberExpr 1077 template< typename pass_t > 1078 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedMemberExpr * node ) { 1079 VISIT_START( node ); 1080 1081 VISIT({ 1082 guard_indexer guard { *this }; 1083 maybe_accept( node, &UntypedMemberExpr::result ); 1084 } 1085 maybe_accept( node, &UntypedMemberExpr::aggregate ); 1086 maybe_accept( node, &UntypedMemberExpr::member ); 1087 ) 1088 1089 VISIT_END( Expr, node ); 1090 } 1091 1092 //-------------------------------------------------------------------------- 1093 // MemberExpr 1094 template< typename pass_t > 1095 const ast::Expr * ast::Pass< pass_t >::visit( const ast::MemberExpr * node ) { 1096 VISIT_START( node ); 1097 1098 VISIT({ 1099 guard_indexer guard { *this }; 1100 maybe_accept( node, &MemberExpr::result ); 1101 } 1102 maybe_accept( node, &MemberExpr::aggregate ); 1103 ) 1104 1105 VISIT_END( Expr, node ); 1106 } 1107 1108 //-------------------------------------------------------------------------- 1109 // VariableExpr 1110 template< typename pass_t > 1111 const ast::Expr * ast::Pass< pass_t >::visit( const ast::VariableExpr * node ) { 1112 VISIT_START( node ); 1113 1114 VISIT({ 1115 guard_indexer guard { *this }; 1116 maybe_accept( node, &VariableExpr::result ); 1117 }) 1118 1119 VISIT_END( Expr, node ); 1120 } 1121 1122 //-------------------------------------------------------------------------- 1123 // ConstantExpr 1124 template< typename pass_t > 1125 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConstantExpr * node ) { 1126 VISIT_START( node ); 1127 1128 VISIT({ 1129 guard_indexer guard { *this }; 1130 maybe_accept( node, &ConstantExpr::result ); 1131 }) 1132 1133 VISIT_END( Expr, node ); 1134 } 1135 1136 //-------------------------------------------------------------------------- 1137 // SizeofExpr 1138 template< typename pass_t > 1139 const ast::Expr * ast::Pass< pass_t >::visit( const ast::SizeofExpr * node ) { 1140 VISIT_START( node ); 1141 1142 VISIT({ 1143 guard_indexer guard { *this }; 1144 maybe_accept( node, &SizeofExpr::result ); 1145 } 1146 if ( node->type ) { 1147 maybe_accept( node, &SizeofExpr::type ); 1148 } else { 1149 maybe_accept( node, &SizeofExpr::expr ); 1150 } 1151 ) 1152 1153 VISIT_END( Expr, node ); 1154 } 1155 1156 //-------------------------------------------------------------------------- 1157 // AlignofExpr 1158 template< typename pass_t > 1159 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AlignofExpr * node ) { 1160 VISIT_START( node ); 1161 1162 VISIT({ 1163 guard_indexer guard { *this }; 1164 maybe_accept( node, &AlignofExpr::result ); 1165 } 1166 if ( node->type ) { 1167 maybe_accept( node, &AlignofExpr::type ); 1168 } else { 1169 maybe_accept( node, &AlignofExpr::expr ); 1170 } 1171 ) 1172 1173 VISIT_END( Expr, node ); 1174 } 1175 1176 //-------------------------------------------------------------------------- 1177 // UntypedOffsetofExpr 1178 template< typename pass_t > 1179 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedOffsetofExpr * node ) { 1180 VISIT_START( node ); 1181 1182 VISIT({ 1183 guard_indexer guard { *this }; 1184 maybe_accept( node, &UntypedOffsetofExpr::result ); 1185 } 1186 maybe_accept( node, &UntypedOffsetofExpr::type ); 1187 ) 1188 1189 VISIT_END( Expr, node ); 1190 } 1191 1192 //-------------------------------------------------------------------------- 1193 // OffsetofExpr 1194 template< typename pass_t > 1195 const ast::Expr * ast::Pass< pass_t >::visit( const ast::OffsetofExpr * node ) { 1196 VISIT_START( node ); 1197 1198 VISIT({ 1199 guard_indexer guard { *this }; 1200 maybe_accept( node, &OffsetofExpr::result ); 1201 } 1202 maybe_accept( node, &OffsetofExpr::type ); 1203 ) 1204 1205 VISIT_END( Expr, node ); 1206 } 1207 1208 //-------------------------------------------------------------------------- 1209 // OffsetPackExpr 1210 template< typename pass_t > 1211 const ast::Expr * ast::Pass< pass_t >::visit( const ast::OffsetPackExpr * node ) { 1212 VISIT_START( node ); 1213 1214 VISIT({ 1215 guard_indexer guard { *this }; 1216 maybe_accept( node, &OffsetPackExpr::result ); 1217 } 1218 maybe_accept( node, &OffsetPackExpr::type ); 1219 ) 1220 1221 VISIT_END( Expr, node ); 1222 } 1223 1224 //-------------------------------------------------------------------------- 1225 // LogicalExpr 1226 template< typename pass_t > 1227 const ast::Expr * ast::Pass< pass_t >::visit( const ast::LogicalExpr * node ) { 1228 VISIT_START( node ); 1229 1230 VISIT({ 1231 guard_indexer guard { *this }; 1232 maybe_accept( node, &LogicalExpr::result ); 1233 } 1234 maybe_accept( node, &LogicalExpr::arg1 ); 1235 maybe_accept( node, &LogicalExpr::arg2 ); 1236 ) 1237 1238 VISIT_END( Expr, node ); 1239 } 1240 1241 //-------------------------------------------------------------------------- 1242 // ConditionalExpr 1243 template< typename pass_t > 1244 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConditionalExpr * node ) { 1245 VISIT_START( node ); 1246 1247 VISIT({ 1248 guard_indexer guard { *this }; 1249 maybe_accept( node, &ConditionalExpr::result ); 1250 } 1251 maybe_accept( node, &ConditionalExpr::arg1 ); 1252 maybe_accept( node, &ConditionalExpr::arg2 ); 1253 maybe_accept( node, &ConditionalExpr::arg3 ); 1254 ) 1255 1256 VISIT_END( Expr, node ); 1257 } 1258 1259 //-------------------------------------------------------------------------- 1260 // CommaExpr 1261 template< typename pass_t > 1262 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CommaExpr * node ) { 1263 VISIT_START( node ); 1264 1265 VISIT({ 1266 guard_indexer guard { *this }; 1267 maybe_accept( node, &CommaExpr::result ); 1268 } 1269 maybe_accept( node, &CommaExpr::arg1 ); 1270 maybe_accept( node, &CommaExpr::arg2 ); 1271 ) 1272 1273 VISIT_END( Expr, node ); 1274 } 1275 1276 //-------------------------------------------------------------------------- 1277 // TypeExpr 1278 template< typename pass_t > 1279 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TypeExpr * node ) { 1280 VISIT_START( node ); 1281 1282 VISIT({ 1283 guard_indexer guard { *this }; 1284 maybe_accept( node, &TypeExpr::result ); 1285 } 1286 maybe_accept( node, &TypeExpr::type ); 1287 ) 1288 1289 VISIT_END( Expr, node ); 1290 } 1291 1292 //-------------------------------------------------------------------------- 1293 // AsmExpr 1294 template< typename pass_t > 1295 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AsmExpr * node ) { 1296 VISIT_START( node ); 1297 1298 VISIT({ 1299 guard_indexer guard { *this }; 1300 maybe_accept( node, &AsmExpr::result ); 1301 } 1302 maybe_accept( node, &AsmExpr::inout ); 1303 maybe_accept( node, &AsmExpr::constraint ); 1304 maybe_accept( node, &AsmExpr::operand ); 1305 ) 1306 1307 VISIT_END( Expr, node ); 1308 } 1309 1310 //-------------------------------------------------------------------------- 1311 // ImplicitCopyCtorExpr 1312 template< typename pass_t > 1313 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ImplicitCopyCtorExpr * node ) { 1314 VISIT_START( node ); 1315 1316 VISIT({ 1317 guard_indexer guard { *this }; 1318 maybe_accept( node, &ImplicitCopyCtorExpr::result ); 1319 } 1320 maybe_accept( node, &ImplicitCopyCtorExpr::callExpr ); 1321 maybe_accept( node, &ImplicitCopyCtorExpr::tempDecls ); 1322 maybe_accept( node, &ImplicitCopyCtorExpr::returnDecls ); 1323 maybe_accept( node, &ImplicitCopyCtorExpr::dtors ); 1324 ) 1325 1326 VISIT_END( Expr, node ); 1327 } 1328 1329 //-------------------------------------------------------------------------- 1330 // ConstructorExpr 1331 template< typename pass_t > 1332 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConstructorExpr * node ) { 1333 VISIT_START( node ); 1334 1335 VISIT({ 1336 guard_indexer guard { *this }; 1337 maybe_accept( node, &ConstructorExpr::result ); 1338 } 1339 maybe_accept( node, &ConstructorExpr::callExpr ); 1340 ) 1341 1342 VISIT_END( Expr, node ); 1343 } 1344 1345 //-------------------------------------------------------------------------- 1346 // CompoundLiteralExpr 1347 template< typename pass_t > 1348 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CompoundLiteralExpr * node ) { 1349 VISIT_START( node ); 1350 1351 VISIT({ 1352 guard_indexer guard { *this }; 1353 maybe_accept( node, &CompoundLiteralExpr::result ); 1354 } 1355 maybe_accept( node, &CompoundLiteralExpr::init ); 1356 ) 1357 1358 VISIT_END( Expr, node ); 1359 } 1360 1361 //-------------------------------------------------------------------------- 1362 // RangeExpr 1363 template< typename pass_t > 1364 const ast::Expr * ast::Pass< pass_t >::visit( const ast::RangeExpr * node ) { 1365 VISIT_START( node ); 1366 1367 VISIT({ 1368 guard_indexer guard { *this }; 1369 maybe_accept( node, &RangeExpr::result ); 1370 } 1371 maybe_accept( node, &RangeExpr::low ); 1372 maybe_accept( node, &RangeExpr::high ); 1373 ) 1374 1375 VISIT_END( Expr, node ); 1376 } 1377 1378 //-------------------------------------------------------------------------- 1379 // UntypedTupleExpr 1380 template< typename pass_t > 1381 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedTupleExpr * node ) { 1382 VISIT_START( node ); 1383 1384 VISIT({ 1385 guard_indexer guard { *this }; 1386 maybe_accept( node, &UntypedTupleExpr::result ); 1387 } 1388 maybe_accept( node, &UntypedTupleExpr::exprs ); 1389 ) 1390 1391 VISIT_END( Expr, node ); 1392 } 1393 1394 //-------------------------------------------------------------------------- 1395 // TupleExpr 1396 template< typename pass_t > 1397 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleExpr * node ) { 1398 VISIT_START( node ); 1399 1400 VISIT({ 1401 guard_indexer guard { *this }; 1402 maybe_accept( node, &TupleExpr::result ); 1403 } 1404 maybe_accept( node, &TupleExpr::exprs ); 1405 ) 1406 1407 VISIT_END( Expr, node ); 1408 } 1409 1410 //-------------------------------------------------------------------------- 1411 // TupleIndexExpr 1412 template< typename pass_t > 1413 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleIndexExpr * node ) { 1414 VISIT_START( node ); 1415 1416 VISIT({ 1417 guard_indexer guard { *this }; 1418 maybe_accept( node, &TupleIndexExpr::result ); 1419 } 1420 maybe_accept( node, &TupleIndexExpr::tuple ); 1421 ) 1422 1423 VISIT_END( Expr, node ); 1424 } 1425 1426 //-------------------------------------------------------------------------- 1427 // TupleAssignExpr 1428 template< typename pass_t > 1429 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleAssignExpr * node ) { 1430 VISIT_START( node ); 1431 1432 VISIT({ 1433 guard_indexer guard { *this }; 1434 maybe_accept( node, &TupleAssignExpr::result ); 1435 } 1436 maybe_accept( node, &TupleAssignExpr::stmtExpr ); 1437 ) 1438 1439 VISIT_END( Expr, node ); 1440 } 1441 1442 //-------------------------------------------------------------------------- 1443 // StmtExpr 1444 template< typename pass_t > 1445 const ast::Expr * ast::Pass< pass_t >::visit( const ast::StmtExpr * node ) { 1446 VISIT_START( node ); 1447 1448 VISIT(// don't want statements from outer CompoundStmts to be added to this StmtExpr 1449 // get the stmts that will need to be spliced in 1450 auto stmts_before = __pass::stmtsToAddBefore( pass, 0); 1451 auto stmts_after = __pass::stmtsToAddAfter ( pass, 0); 1452 1453 // These may be modified by subnode but most be restored once we exit this statemnet. 1454 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::env( pass, 0) ); 1455 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before ); 1456 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after ); 1457 1458 { 1459 guard_indexer guard { *this }; 1460 maybe_accept( node, &StmtExpr::result ); 1461 } 1462 maybe_accept( node, &StmtExpr::stmts ); 1463 maybe_accept( node, &StmtExpr::returnDecls ); 1464 maybe_accept( node, &StmtExpr::dtors ); 1465 ) 1466 1467 VISIT_END( Expr, node ); 1468 } 1469 1470 //-------------------------------------------------------------------------- 1471 // UniqueExpr 1472 template< typename pass_t > 1473 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UniqueExpr * node ) { 1474 VISIT_START( node ); 1475 1476 VISIT({ 1477 guard_indexer guard { *this }; 1478 maybe_accept( node, &UniqueExpr::result ); 1479 } 1480 maybe_accept( node, &UniqueExpr::expr ); 1481 ) 1482 1483 VISIT_END( Expr, node ); 1484 } 1485 1486 //-------------------------------------------------------------------------- 1487 // UntypedInitExpr 1488 template< typename pass_t > 1489 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedInitExpr * node ) { 1490 VISIT_START( node ); 1491 1492 VISIT({ 1493 guard_indexer guard { *this }; 1494 maybe_accept( node, &UntypedInitExpr::result ); 1495 } 1496 maybe_accept( node, &UntypedInitExpr::expr ); 1497 // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver. 1498 ) 1499 1500 VISIT_END( Expr, node ); 1501 } 1502 1503 //-------------------------------------------------------------------------- 1504 // InitExpr 1505 template< typename pass_t > 1506 const ast::Expr * ast::Pass< pass_t >::visit( const ast::InitExpr * node ) { 1507 VISIT_START( node ); 1508 1509 VISIT({ 1510 guard_indexer guard { *this }; 1511 maybe_accept( node, &InitExpr::result ); 1512 } 1513 maybe_accept( node, &InitExpr::expr ); 1514 maybe_accept( node, &InitExpr::designation ); 1515 ) 1516 1517 VISIT_END( Expr, node ); 1518 } 1519 1520 //-------------------------------------------------------------------------- 1521 // DeletedExpr 1522 template< typename pass_t > 1523 const ast::Expr * ast::Pass< pass_t >::visit( const ast::DeletedExpr * node ) { 1524 VISIT_START( node ); 1525 1526 VISIT({ 1527 guard_indexer guard { *this }; 1528 maybe_accept( node, &DeletedExpr::result ); 1529 } 1530 maybe_accept( node, &DeletedExpr::expr ); 1531 // don't visit deleteStmt, because it is a pointer to somewhere else in the tree. 1532 ) 1533 1534 VISIT_END( Expr, node ); 1535 } 1536 1537 //-------------------------------------------------------------------------- 1538 // DefaultArgExpr 1539 template< typename pass_t > 1540 const ast::Expr * ast::Pass< pass_t >::visit( const ast::DefaultArgExpr * node ) { 1541 VISIT_START( node ); 1542 1543 VISIT({ 1544 guard_indexer guard { *this }; 1545 maybe_accept( node, &DefaultArgExpr::result ); 1546 } 1547 maybe_accept( node, &DefaultArgExpr::expr ); 1548 ) 1549 1550 VISIT_END( Expr, node ); 1551 } 1552 1553 //-------------------------------------------------------------------------- 1554 // GenericExpr 1555 template< typename pass_t > 1556 const ast::Expr * ast::Pass< pass_t >::visit( const ast::GenericExpr * node ) { 1557 VISIT_START( node ); 1558 1559 VISIT({ 1560 guard_indexer guard { *this }; 1561 maybe_accept( node, &GenericExpr::result ); 1562 } 1563 maybe_accept( node, &GenericExpr::control ); 1564 1565 std::vector<GenericExpr::Association> new_kids; 1566 new_kids.reserve(node->associations.size()); 1567 bool mutated = false; 1568 for( const auto & assoc : node->associations ) { 1569 Type * type = nullptr; 1570 if( assoc.type ) { 1571 guard_indexer guard { *this }; 1572 type = assoc.type->accept( *this ); 1573 if( type != assoc.type ) mutated = true; 1574 } 1575 Expr * expr = nullptr; 1576 if( assoc.expr ) { 1577 expr = assoc.expr->accept( *this ); 1578 if( expr != assoc.expr ) mutated = true; 1579 } 1580 new_kids.emplace_back( type, expr ); 1581 } 1582 1583 if(mutated) { 1584 auto n = mutate(node); 1585 n->associations = std::move( new_kids ); 1586 node = n; 1587 } 1588 ) 1589 1590 VISIT_END( Expr, node ); 1591 } 1592 1593 //-------------------------------------------------------------------------- 1594 // VoidType 1595 template< typename pass_t > 1596 const ast::Type * ast::Pass< pass_t >::visit( const ast::VoidType * node ) { 1597 VISIT_START( node ); 1598 1599 VISIT_END( Type, node ); 1600 } 1601 1602 //-------------------------------------------------------------------------- 1603 // BasicType 1604 template< typename pass_t > 1605 const ast::Type * ast::Pass< pass_t >::visit( const ast::BasicType * node ) { 1606 VISIT_START( node ); 1607 1608 VISIT_END( Type, node ); 1609 } 1610 1611 //-------------------------------------------------------------------------- 1612 // PointerType 1613 template< typename pass_t > 1614 const ast::Type * ast::Pass< pass_t >::visit( const ast::PointerType * node ) { 1615 VISIT_START( node ); 1616 1617 VISIT( 1618 // xxx - should PointerType visit/mutate dimension? 1619 maybe_accept( node, &PointerType::base ); 1620 ) 1621 1622 VISIT_END( Type, node ); 1623 } 1624 1625 //-------------------------------------------------------------------------- 1626 // ArrayType 1627 template< typename pass_t > 1628 const ast::Type * ast::Pass< pass_t >::visit( const ast::ArrayType * node ) { 1629 VISIT_START( node ); 1630 1631 VISIT( 1632 maybe_accept( node, &ArrayType::dimension ); 1633 maybe_accept( node, &ArrayType::base ); 1634 ) 1635 1636 VISIT_END( Type, node ); 1637 } 1638 1639 //-------------------------------------------------------------------------- 1640 // ReferenceType 1641 template< typename pass_t > 1642 const ast::Type * ast::Pass< pass_t >::visit( const ast::ReferenceType * node ) { 1643 VISIT_START( node ); 1644 1645 VISIT( 1646 maybe_accept( node, &ReferenceType::base ); 1647 ) 1648 1649 VISIT_END( Type, node ); 1650 } 1651 1652 //-------------------------------------------------------------------------- 1653 // QualifiedType 1654 template< typename pass_t > 1655 const ast::Type * ast::Pass< pass_t >::visit( const ast::QualifiedType * node ) { 1656 VISIT_START( node ); 1657 1658 VISIT( 1659 maybe_accept( node, &QualifiedType::parent ); 1660 maybe_accept( node, &QualifiedType::child ); 1661 ) 1662 1663 VISIT_END( Type, node ); 1664 } 1665 1666 //-------------------------------------------------------------------------- 1667 // FunctionType 1668 template< typename pass_t > 1669 const ast::Type * ast::Pass< pass_t >::visit( const ast::FunctionType * node ) { 1670 VISIT_START( node ); 1671 1672 VISIT( 1673 maybe_accept( node, &FunctionType::forall ); 1674 maybe_accept( node, &FunctionType::returns ); 1675 maybe_accept( node, &FunctionType::params ); 1676 ) 1677 1678 VISIT_END( Type, node ); 1679 } 1680 1681 //-------------------------------------------------------------------------- 1682 // StructInstType 1683 template< typename pass_t > 1684 const ast::Type * ast::Pass< pass_t >::visit( const ast::StructInstType * node ) { 1685 VISIT_START( node ); 1686 1687 __pass::indexer::addStruct( node->name, 0, pass ); 1688 1689 VISIT({ 1690 guard_indexer guard { *this }; 1691 maybe_accept( node, &StructInstType::forall ); 1692 maybe_accept( node, &StructInstType::params ); 1693 }) 1694 1695 VISIT_END( Type, node ); 1696 } 1697 1698 //-------------------------------------------------------------------------- 1699 // UnionInstType 1700 template< typename pass_t > 1701 const ast::Type * ast::Pass< pass_t >::visit( const ast::UnionInstType * node ) { 1702 VISIT_START( node ); 1703 1704 __pass::indexer::addStruct( node->name, 0, pass ); 1705 1706 { 1707 guard_indexer guard { *this }; 1708 maybe_accept( node, &UnionInstType::forall ); 1709 maybe_accept( node, &UnionInstType::params ); 1710 } 1711 1712 VISIT_END( Type, node ); 1713 } 1714 1715 //-------------------------------------------------------------------------- 1716 // EnumInstType 1717 template< typename pass_t > 1718 const ast::Type * ast::Pass< pass_t >::visit( const ast::EnumInstType * node ) { 1719 VISIT_START( node ); 1720 1721 VISIT( 1722 maybe_accept( node, &EnumInstType::forall ); 1723 maybe_accept( node, &EnumInstType::params ); 1724 ) 1725 1726 VISIT_END( Type, node ); 1727 } 1728 1729 //-------------------------------------------------------------------------- 1730 // TraitInstType 1731 template< typename pass_t > 1732 const ast::Type * ast::Pass< pass_t >::visit( const ast::TraitInstType * node ) { 1733 VISIT_START( node ); 1734 1735 VISIT( 1736 maybe_accept( node, &TraitInstType::forall ); 1737 maybe_accept( node, &TraitInstType::params ); 1738 ) 1739 1740 VISIT_END( Type, node ); 1741 } 1742 1743 //-------------------------------------------------------------------------- 1744 // TypeInstType 1745 template< typename pass_t > 1746 const ast::Type * ast::Pass< pass_t >::visit( const ast::TypeInstType * node ) { 1747 VISIT_START( node ); 1748 1749 VISIT( 1750 maybe_accept( node, &TypeInstType::forall ); 1751 maybe_accept( node, &TypeInstType::params ); 1752 ) 1753 1754 VISIT_END( Type, node ); 1755 } 1756 1757 //-------------------------------------------------------------------------- 1758 // TupleType 1759 template< typename pass_t > 1760 const ast::Type * ast::Pass< pass_t >::visit( const ast::TupleType * node ) { 1761 VISIT_START( node ); 1762 1763 VISIT( 1764 maybe_accept( node, &TupleType::types ); 1765 maybe_accept( node, &TupleType::members ); 1766 ) 1767 1768 VISIT_END( Type, node ); 1769 } 1770 1771 //-------------------------------------------------------------------------- 1772 // TypeofType 1773 template< typename pass_t > 1774 const ast::Type * ast::Pass< pass_t >::visit( const ast::TypeofType * node ) { 1775 VISIT_START( node ); 1776 1777 VISIT( 1778 maybe_accept( node, &TypeofType::expr ); 1779 ) 1780 1781 VISIT_END( Type, node ); 1782 } 1783 1784 //-------------------------------------------------------------------------- 1785 // VarArgsType 1786 template< typename pass_t > 1787 const ast::Type * ast::Pass< pass_t >::visit( const ast::VarArgsType * node ) { 1788 VISIT_START( node ); 1789 1790 VISIT_END( Type, node ); 1791 } 1792 1793 //-------------------------------------------------------------------------- 1794 // ZeroType 1795 template< typename pass_t > 1796 const ast::Type * ast::Pass< pass_t >::visit( const ast::ZeroType * node ) { 1797 VISIT_START( node ); 1798 1799 VISIT_END( Type, node ); 1800 } 1801 1802 //-------------------------------------------------------------------------- 1803 // OneType 1804 template< typename pass_t > 1805 const ast::Type * ast::Pass< pass_t >::visit( const ast::OneType * node ) { 1806 VISIT_START( node ); 1807 1808 VISIT_END( Type, node ); 1809 } 1810 1811 //-------------------------------------------------------------------------- 1812 // GlobalScopeType 1813 template< typename pass_t > 1814 const ast::Type * ast::Pass< pass_t >::visit( const ast::GlobalScopeType * node ) { 1815 VISIT_START( node ); 1816 1817 VISIT_END( Type, node ); 1818 } 1819 1820 1821 //-------------------------------------------------------------------------- 1822 // Designation 1823 template< typename pass_t > 1824 const ast::Designation * ast::Pass< pass_t >::visit( const ast::Designation * node ) { 1825 VISIT_START( node ); 1826 1827 VISIT( maybe_accept( node, &Designation::designators ); ) 1828 1829 VISIT_END( Designation, node ); 1830 } 916 1831 917 1832 //-------------------------------------------------------------------------- … … 970 1885 } 971 1886 972 // --------------------------------------------------------------------------973 // TypeSubstitution974 template< typename pass_t >975 const ast::TypeSubstitution * ast::Pass< pass_t >::visit( const ast::TypeSubstitution * node ) {976 VISIT_START( node );977 978 VISIT(979 {980 bool mutated = false;981 std::unordered_map< std::string, ast::ptr< ast::Type > > new_map;982 for ( const auto & p : node->typeEnv ) {983 guard_indexer guard { *this };984 auto new_node = p.second->accept( *this );985 if (new_node != p.second) mutated = false;986 new_map.insert({ p.first, new_node });987 }988 if (mutated) {989 auto new_node = mutate( node );990 new_node->typeEnv.swap( new_map );991 node = new_node;992 }993 }994 995 {996 bool mutated = false;997 std::unordered_map< std::string, ast::ptr< ast::Expr > > new_map;998 for ( const auto & p : node->varEnv ) {999 guard_indexer guard { *this };1000 auto new_node = p.second->accept( *this );1001 if (new_node != p.second) mutated = false;1002 new_map.insert({ p.first, new_node });1003 }1004 if (mutated) {1005 auto new_node = mutate( node );1006 new_node->varEnv.swap( new_map );1007 node = new_node;1008 }1009 }1010 )1011 1012 VISIT_END( TypeSubstitution, node );1013 }1887 // //-------------------------------------------------------------------------- 1888 // // TypeSubstitution 1889 // template< typename pass_t > 1890 // const ast::TypeSubstitution * ast::Pass< pass_t >::visit( const ast::TypeSubstitution * node ) { 1891 // VISIT_START( node ); 1892 1893 // VISIT( 1894 // { 1895 // bool mutated = false; 1896 // std::unordered_map< std::string, ast::ptr< ast::Type > > new_map; 1897 // for ( const auto & p : node->typeEnv ) { 1898 // guard_indexer guard { *this }; 1899 // auto new_node = p.second->accept( *this ); 1900 // if (new_node != p.second) mutated = false; 1901 // new_map.insert({ p.first, new_node }); 1902 // } 1903 // if (mutated) { 1904 // auto new_node = mutate( node ); 1905 // new_node->typeEnv.swap( new_map ); 1906 // node = new_node; 1907 // } 1908 // } 1909 1910 // { 1911 // bool mutated = false; 1912 // std::unordered_map< std::string, ast::ptr< ast::Expr > > new_map; 1913 // for ( const auto & p : node->varEnv ) { 1914 // guard_indexer guard { *this }; 1915 // auto new_node = p.second->accept( *this ); 1916 // if (new_node != p.second) mutated = false; 1917 // new_map.insert({ p.first, new_node }); 1918 // } 1919 // if (mutated) { 1920 // auto new_node = mutate( node ); 1921 // new_node->varEnv.swap( new_map ); 1922 // node = new_node; 1923 // } 1924 // } 1925 // ) 1926 1927 // VISIT_END( TypeSubstitution, node ); 1928 // } 1014 1929 1015 1930 #undef VISIT_START -
src/AST/Stmt.hpp
r5b35c21 ra1b154d 330 330 public: 331 331 struct Target { 332 ptr<Expr> func tion;333 std::vector<ptr<Expr>> arg uments;332 ptr<Expr> func; 333 std::vector<ptr<Expr>> args; 334 334 }; 335 335 -
src/AST/Type.cpp
r5b35c21 ra1b154d 141 141 bool EnumInstType::isComplete() const { return base ? base->body : false; } 142 142 143 // --- TraitInstType 144 145 TraitInstType::TraitInstType( const TraitDecl * b, CV::Qualifiers q, 146 std::vector<ptr<Attribute>>&& as ) 147 : ReferenceToType( b->name, q, std::move(as) ), base( b ) {} 148 143 149 // --- TypeInstType 144 150 -
src/AST/module.mk
r5b35c21 ra1b154d 1 ######################### -*- Mode: Makefile-Gmake -*- 2 ######################## 1 ######################### -*- Mode: Makefile-Gmake -*- ######################## 3 2 ## 4 3 ## Cforall Version 1.0.0 Copyright (C) 2019 University of Waterloo … … 17 16 18 17 SRC_AST = \ 19 AST/Convert.cpp \ 20 AST/Node.cpp \ 21 AST/TypeSubstitution.cpp 18 AST/Attribute.cpp \ 19 AST/Convert.cpp \ 20 AST/Decl.cpp \ 21 AST/DeclReplacer.cpp \ 22 AST/Expr.cpp \ 23 AST/Init.cpp \ 24 AST/LinkageSpec.cpp \ 25 AST/Node.cpp \ 26 AST/Stmt.cpp \ 27 AST/Type.cpp \ 28 AST/TypeSubstitution.cpp 22 29 23 30 … … 25 32 SRC += $(SRC_AST) 26 33 SRCDEMANGLE += $(SRC_AST) 27 -
src/Common/Eval.cc
r5b35c21 ra1b154d 90 90 } 91 91 92 std::pair<long long int, bool> eval(const ast::Expr * expr) { 93 #warning not implemented 94 return { 0, false }; 95 } 96 92 97 // Local Variables: // 93 98 // tab-width: 4 // -
src/Makefile.am
r5b35c21 ra1b154d 37 37 endif 38 38 39 include AST/module.mk 39 40 include CodeGen/module.mk 40 41 include CodeTools/module.mk -
src/Makefile.in
r5b35c21 ra1b154d 16 16 17 17 ######################## -*- Mode: Makefile-Automake -*- ###################### 18 ############################################################################### 19 20 ######################### -*- Mode: Makefile-Gmake -*- ######################## 18 21 ############################################################################### 19 22 … … 162 165 libdemangle_a_LIBADD = 163 166 am__dirstamp = $(am__leading_dot)dirstamp 164 am__objects_1 = CodeGen/CodeGenerator.$(OBJEXT) \ 167 am__objects_1 = AST/Attribute.$(OBJEXT) AST/Convert.$(OBJEXT) \ 168 AST/Decl.$(OBJEXT) AST/DeclReplacer.$(OBJEXT) \ 169 AST/Expr.$(OBJEXT) AST/Init.$(OBJEXT) \ 170 AST/LinkageSpec.$(OBJEXT) AST/Node.$(OBJEXT) \ 171 AST/Stmt.$(OBJEXT) AST/Type.$(OBJEXT) \ 172 AST/TypeSubstitution.$(OBJEXT) 173 am__objects_2 = CodeGen/CodeGenerator.$(OBJEXT) \ 165 174 CodeGen/FixMain.$(OBJEXT) CodeGen/GenType.$(OBJEXT) \ 166 175 CodeGen/OperatorTable.$(OBJEXT) 167 am__objects_ 2= Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \176 am__objects_3 = Common/Assert.$(OBJEXT) Common/Eval.$(OBJEXT) \ 168 177 Common/PassVisitor.$(OBJEXT) Common/SemanticError.$(OBJEXT) \ 169 178 Common/Stats/Counter.$(OBJEXT) Common/Stats/Heap.$(OBJEXT) \ 170 179 Common/Stats/Stats.$(OBJEXT) Common/Stats/Time.$(OBJEXT) \ 171 180 Common/UniqueName.$(OBJEXT) 172 am__objects_ 3= ControlStruct/ForExprMutator.$(OBJEXT) \181 am__objects_4 = ControlStruct/ForExprMutator.$(OBJEXT) \ 173 182 ControlStruct/LabelFixer.$(OBJEXT) \ 174 183 ControlStruct/LabelGenerator.$(OBJEXT) \ 175 184 ControlStruct/MLEMutator.$(OBJEXT) \ 176 185 ControlStruct/Mutate.$(OBJEXT) 177 am__objects_ 4= ResolvExpr/AdjustExprType.$(OBJEXT) \186 am__objects_5 = ResolvExpr/AdjustExprType.$(OBJEXT) \ 178 187 ResolvExpr/Alternative.$(OBJEXT) \ 179 188 ResolvExpr/AlternativeFinder.$(OBJEXT) \ … … 193 202 ResolvExpr/TypeEnvironment.$(OBJEXT) \ 194 203 ResolvExpr/Unify.$(OBJEXT) 195 am__objects_ 5= SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \204 am__objects_6 = SymTab/Autogen.$(OBJEXT) SymTab/FixFunction.$(OBJEXT) \ 196 205 SymTab/Indexer.$(OBJEXT) SymTab/Mangler.$(OBJEXT) \ 197 206 SymTab/ManglerCommon.$(OBJEXT) SymTab/Validate.$(OBJEXT) 198 am__objects_ 6= SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \207 am__objects_7 = SynTree/Type.$(OBJEXT) SynTree/VoidType.$(OBJEXT) \ 199 208 SynTree/BasicType.$(OBJEXT) SynTree/PointerType.$(OBJEXT) \ 200 209 SynTree/ArrayType.$(OBJEXT) SynTree/ReferenceType.$(OBJEXT) \ … … 216 225 SynTree/TypeSubstitution.$(OBJEXT) SynTree/Attribute.$(OBJEXT) \ 217 226 SynTree/DeclReplacer.$(OBJEXT) 218 am__objects_ 7= CompilationState.$(OBJEXT) $(am__objects_1) \219 Concurrency/Keywords.$(OBJEXT) $(am__objects_2) \220 $(am__objects_3) GenPoly/GenPoly.$(OBJEXT) \227 am__objects_8 = CompilationState.$(OBJEXT) $(am__objects_1) \ 228 $(am__objects_2) Concurrency/Keywords.$(OBJEXT) \ 229 $(am__objects_3) $(am__objects_4) GenPoly/GenPoly.$(OBJEXT) \ 221 230 GenPoly/Lvalue.$(OBJEXT) InitTweak/GenInit.$(OBJEXT) \ 222 231 InitTweak/InitTweak.$(OBJEXT) Parser/LinkageSpec.$(OBJEXT) \ 223 $(am__objects_ 4) $(am__objects_5) SymTab/Demangle.$(OBJEXT) \224 $(am__objects_ 6) Tuples/TupleAssignment.$(OBJEXT) \232 $(am__objects_5) $(am__objects_6) SymTab/Demangle.$(OBJEXT) \ 233 $(am__objects_7) Tuples/TupleAssignment.$(OBJEXT) \ 225 234 Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \ 226 235 Validate/HandleAttributes.$(OBJEXT) 227 am_libdemangle_a_OBJECTS = $(am__objects_ 7)236 am_libdemangle_a_OBJECTS = $(am__objects_8) 228 237 libdemangle_a_OBJECTS = $(am_libdemangle_a_OBJECTS) 229 238 am__installdirs = "$(DESTDIR)$(cfa_cpplibdir)" 230 239 PROGRAMS = $(cfa_cpplib_PROGRAMS) 231 am__objects_ 8= main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \232 CompilationState.$(OBJEXT) $(am__objects_1) \240 am__objects_9 = main.$(OBJEXT) MakeLibCfa.$(OBJEXT) \ 241 CompilationState.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ 233 242 CodeGen/Generate.$(OBJEXT) CodeGen/FixNames.$(OBJEXT) \ 234 243 CodeTools/DeclStats.$(OBJEXT) \ 235 244 CodeTools/ResolvProtoDump.$(OBJEXT) \ 236 245 CodeTools/TrackLoc.$(OBJEXT) Concurrency/Keywords.$(OBJEXT) \ 237 Concurrency/Waitfor.$(OBJEXT) $(am__objects_ 2) \238 Common/DebugMalloc.$(OBJEXT) $(am__objects_ 3) \246 Concurrency/Waitfor.$(OBJEXT) $(am__objects_3) \ 247 Common/DebugMalloc.$(OBJEXT) $(am__objects_4) \ 239 248 ControlStruct/ExceptTranslate.$(OBJEXT) GenPoly/Box.$(OBJEXT) \ 240 249 GenPoly/GenPoly.$(OBJEXT) GenPoly/ScrubTyVars.$(OBJEXT) \ … … 250 259 Parser/InitializerNode.$(OBJEXT) Parser/TypeData.$(OBJEXT) \ 251 260 Parser/LinkageSpec.$(OBJEXT) Parser/parserutility.$(OBJEXT) \ 252 $(am__objects_ 4) ResolvExpr/AlternativePrinter.$(OBJEXT) \253 $(am__objects_ 5) $(am__objects_6) \261 $(am__objects_5) ResolvExpr/AlternativePrinter.$(OBJEXT) \ 262 $(am__objects_6) $(am__objects_7) \ 254 263 Tuples/TupleAssignment.$(OBJEXT) \ 255 264 Tuples/TupleExpansion.$(OBJEXT) Tuples/Explode.$(OBJEXT) \ 256 265 Validate/HandleAttributes.$(OBJEXT) \ 257 266 Virtual/ExpandCasts.$(OBJEXT) 258 am____driver_cfa_cpp_OBJECTS = $(am__objects_ 8)267 am____driver_cfa_cpp_OBJECTS = $(am__objects_9) 259 268 ___driver_cfa_cpp_OBJECTS = $(am____driver_cfa_cpp_OBJECTS) 260 269 am__DEPENDENCIES_1 = … … 366 375 ETAGS = etags 367 376 CTAGS = ctags 368 am__DIST_COMMON = $(srcdir)/ CodeGen/module.mk \377 am__DIST_COMMON = $(srcdir)/AST/module.mk $(srcdir)/CodeGen/module.mk \ 369 378 $(srcdir)/CodeTools/module.mk $(srcdir)/Common/module.mk \ 370 379 $(srcdir)/Concurrency/module.mk \ … … 526 535 AUTOMAKE_OPTIONS = foreign subdir-objects 527 536 ACLOCAL_AMFLAGS = -I automake 528 SRC = main.cc MakeLibCfa.cc CompilationState.cc $(SRC_ CODEGEN) \529 CodeGen/Generate.cc CodeGen/FixNames.cc CodeTools/DeclStats.cc \530 CodeTools/ ResolvProtoDump.cc CodeTools/TrackLoc.cc \531 Co ncurrency/Keywords.cc Concurrency/Waitfor.cc $(SRC_COMMON)\532 Co mmon/DebugMalloc.cc $(SRC_CONTROLSTRUCT)\533 ControlStruct/ExceptTranslate.cc GenPoly/Box.cc \534 GenPoly/ GenPoly.cc GenPoly/ScrubTyVars.cc GenPoly/Lvalue.cc \535 GenPoly/ Specialize.cc GenPoly/FindFunction.cc \536 GenPoly/ InstantiateGeneric.cc InitTweak/GenInit.cc \537 InitTweak/ FixInit.cc InitTweak/FixGlobalInit.cc \538 InitTweak/ InitTweak.cc Parser/parser.yy Parser/lex.ll\539 Parser/ TypedefTable.cc Parser/ParseNode.cc \540 Parser/ DeclarationNode.cc Parser/ExpressionNode.cc \541 Parser/ StatementNode.cc Parser/InitializerNode.cc \542 Parser/ TypeData.cc Parser/LinkageSpec.cc \543 Parser/ parserutility.cc $(SRC_RESOLVEXPR)\544 ResolvExpr/AlternativePrinter.cc $(SRC_SYMTAB) $(SRC_SYNTREE)\545 Tuples/TupleAssignment.cc Tuples/TupleExpansion.cc \546 Tuples/ Explode.cc Validate/HandleAttributes.cc \547 V irtual/ExpandCasts.cc548 SRCDEMANGLE = CompilationState.cc $(SRC_ CODEGEN) \537 SRC = main.cc MakeLibCfa.cc CompilationState.cc $(SRC_AST) \ 538 $(SRC_CODEGEN) CodeGen/Generate.cc CodeGen/FixNames.cc \ 539 CodeTools/DeclStats.cc CodeTools/ResolvProtoDump.cc \ 540 CodeTools/TrackLoc.cc Concurrency/Keywords.cc \ 541 Concurrency/Waitfor.cc $(SRC_COMMON) Common/DebugMalloc.cc \ 542 $(SRC_CONTROLSTRUCT) ControlStruct/ExceptTranslate.cc \ 543 GenPoly/Box.cc GenPoly/GenPoly.cc GenPoly/ScrubTyVars.cc \ 544 GenPoly/Lvalue.cc GenPoly/Specialize.cc \ 545 GenPoly/FindFunction.cc GenPoly/InstantiateGeneric.cc \ 546 InitTweak/GenInit.cc InitTweak/FixInit.cc \ 547 InitTweak/FixGlobalInit.cc InitTweak/InitTweak.cc \ 548 Parser/parser.yy Parser/lex.ll Parser/TypedefTable.cc \ 549 Parser/ParseNode.cc Parser/DeclarationNode.cc \ 550 Parser/ExpressionNode.cc Parser/StatementNode.cc \ 551 Parser/InitializerNode.cc Parser/TypeData.cc \ 552 Parser/LinkageSpec.cc Parser/parserutility.cc \ 553 $(SRC_RESOLVEXPR) ResolvExpr/AlternativePrinter.cc \ 554 $(SRC_SYMTAB) $(SRC_SYNTREE) Tuples/TupleAssignment.cc \ 555 Tuples/TupleExpansion.cc Tuples/Explode.cc \ 556 Validate/HandleAttributes.cc Virtual/ExpandCasts.cc 557 SRCDEMANGLE = CompilationState.cc $(SRC_AST) $(SRC_CODEGEN) \ 549 558 Concurrency/Keywords.cc $(SRC_COMMON) $(SRC_CONTROLSTRUCT) \ 550 559 GenPoly/GenPoly.cc GenPoly/Lvalue.cc InitTweak/GenInit.cc \ … … 559 568 @WITH_LIBTCMALLOC_TRUE@LIBTCMALLOC = -ltcmalloc 560 569 @WITH_LIBTCMALLOC_TRUE@TCMALLOCFLAG = -DTCMALLOC 570 SRC_AST = \ 571 AST/Attribute.cpp \ 572 AST/Convert.cpp \ 573 AST/Decl.cpp \ 574 AST/DeclReplacer.cpp \ 575 AST/Expr.cpp \ 576 AST/Init.cpp \ 577 AST/LinkageSpec.cpp \ 578 AST/Node.cpp \ 579 AST/Stmt.cpp \ 580 AST/Type.cpp \ 581 AST/TypeSubstitution.cpp 582 561 583 SRC_CODEGEN = \ 562 584 CodeGen/CodeGenerator.cc \ … … 667 689 668 690 .SUFFIXES: 669 .SUFFIXES: .cc . ll .lo .o .obj .yy670 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/ CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps)691 .SUFFIXES: .cc .cpp .ll .lo .o .obj .yy 692 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/AST/module.mk $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__configure_deps) 671 693 @for dep in $?; do \ 672 694 case '$(am__configure_deps)' in \ … … 688 710 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ 689 711 esac; 690 $(srcdir)/ CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__empty):712 $(srcdir)/AST/module.mk $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Concurrency/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(srcdir)/Validate/module.mk $(srcdir)/Virtual/module.mk $(am__empty): 691 713 692 714 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) … … 701 723 clean-noinstLIBRARIES: 702 724 -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) 725 AST/$(am__dirstamp): 726 @$(MKDIR_P) AST 727 @: > AST/$(am__dirstamp) 728 AST/$(DEPDIR)/$(am__dirstamp): 729 @$(MKDIR_P) AST/$(DEPDIR) 730 @: > AST/$(DEPDIR)/$(am__dirstamp) 731 AST/Attribute.$(OBJEXT): AST/$(am__dirstamp) \ 732 AST/$(DEPDIR)/$(am__dirstamp) 733 AST/Convert.$(OBJEXT): AST/$(am__dirstamp) \ 734 AST/$(DEPDIR)/$(am__dirstamp) 735 AST/Decl.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp) 736 AST/DeclReplacer.$(OBJEXT): AST/$(am__dirstamp) \ 737 AST/$(DEPDIR)/$(am__dirstamp) 738 AST/Expr.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp) 739 AST/Init.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp) 740 AST/LinkageSpec.$(OBJEXT): AST/$(am__dirstamp) \ 741 AST/$(DEPDIR)/$(am__dirstamp) 742 AST/Node.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp) 743 AST/Stmt.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp) 744 AST/Type.$(OBJEXT): AST/$(am__dirstamp) AST/$(DEPDIR)/$(am__dirstamp) 745 AST/TypeSubstitution.$(OBJEXT): AST/$(am__dirstamp) \ 746 AST/$(DEPDIR)/$(am__dirstamp) 703 747 CodeGen/$(am__dirstamp): 704 748 @$(MKDIR_P) CodeGen … … 1097 1141 mostlyclean-compile: 1098 1142 -rm -f *.$(OBJEXT) 1143 -rm -f AST/*.$(OBJEXT) 1099 1144 -rm -f CodeGen/*.$(OBJEXT) 1100 1145 -rm -f CodeTools/*.$(OBJEXT) … … 1119 1164 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MakeLibCfa.Po@am__quote@ 1120 1165 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ 1166 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Attribute.Po@am__quote@ 1167 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Convert.Po@am__quote@ 1168 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Decl.Po@am__quote@ 1169 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/DeclReplacer.Po@am__quote@ 1170 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Expr.Po@am__quote@ 1171 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Init.Po@am__quote@ 1172 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/LinkageSpec.Po@am__quote@ 1173 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Node.Po@am__quote@ 1174 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Stmt.Po@am__quote@ 1175 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/Type.Po@am__quote@ 1176 @AMDEP_TRUE@@am__include@ @am__quote@AST/$(DEPDIR)/TypeSubstitution.Po@am__quote@ 1121 1177 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/CodeGenerator.Po@am__quote@ 1122 1178 @AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/FixMain.Po@am__quote@ … … 1261 1317 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< 1262 1318 1319 .cpp.o: 1320 @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ 1321 @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 1322 @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po 1323 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 1324 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1325 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< 1326 1327 .cpp.obj: 1328 @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ 1329 @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ 1330 @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po 1331 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ 1332 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1333 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 1334 1335 .cpp.lo: 1336 @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ 1337 @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ 1338 @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo 1339 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ 1340 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1341 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< 1342 1263 1343 .ll.cc: 1264 1344 $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) … … 1393 1473 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) 1394 1474 -rm -f ../driver/$(am__dirstamp) 1475 -rm -f AST/$(DEPDIR)/$(am__dirstamp) 1476 -rm -f AST/$(am__dirstamp) 1395 1477 -rm -f CodeGen/$(DEPDIR)/$(am__dirstamp) 1396 1478 -rm -f CodeGen/$(am__dirstamp) … … 1438 1520 1439 1521 distclean: distclean-am 1440 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)1522 -rm -rf ./$(DEPDIR) AST/$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 1441 1523 -rm -f Makefile 1442 1524 distclean-am: clean-am distclean-compile distclean-generic \ … … 1484 1566 1485 1567 maintainer-clean: maintainer-clean-am 1486 -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR)1568 -rm -rf ./$(DEPDIR) AST/$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) Common/Stats/$(DEPDIR) Concurrency/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR) Validate/$(DEPDIR) Virtual/$(DEPDIR) 1487 1569 -rm -f Makefile 1488 1570 maintainer-clean-am: distclean-am maintainer-clean-generic -
src/Tuples/TupleExpansion.cc
r5b35c21 ra1b154d 353 353 } 354 354 355 const ast::TypeInstType * isTtype( const ast::Type * type ) { 356 #warning unimplemented 357 return nullptr; 358 } 359 355 360 namespace { 356 361 /// determines if impurity (read: side-effects) may exist in a piece of code. Currently gives a very crude approximation, wherein any function call expression means the code may be impure -
src/include/cassert
r5b35c21 ra1b154d 19 19 20 20 #include_next <cassert> 21 22 #include <string> 23 24 template < typename ... Params > 25 std::string toString( const Params & ... params ); 21 26 22 27 #ifdef NDEBUG -
src/main.cc
r5b35c21 ra1b154d 40 40 #include "Common/Stats.h" 41 41 #include "Common/PassVisitor.h" 42 // #include "AST/Pass.hpp"43 42 #include "Common/SemanticError.h" // for SemanticError 44 43 #include "Common/UnimplementedError.h" // for UnimplementedError
Note: See TracChangeset
for help on using the changeset viewer.