- Timestamp:
- Mar 12, 2021, 11:14:29 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:
- 41ca6fa, e867b44d
- Parents:
- 6083392
- Location:
- src/AST
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r6083392 r2d019af 9 9 // Author : Thierry Delisle 10 10 // Created On : Thu May 09 15::37::05 2019 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Nov 12 10:07:00 202013 // Update Count : 3 411 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 12 18:43:51 2021 13 // Update Count : 36 14 14 // 15 15 … … 327 327 const ast::AsmDecl * visit( const ast::AsmDecl * node ) override final { 328 328 auto decl = new AsmDecl( get<AsmStmt>().accept1( node->stmt ) ); 329 declPostamble( decl, node ); 330 return nullptr; 331 } 332 333 const ast::DirectiveDecl * visit( const ast::DirectiveDecl * node ) override final { 334 auto decl = new DirectiveDecl( get<DirectiveStmt>().accept1( node->stmt ) ); 329 335 declPostamble( decl, node ); 330 336 return nullptr; … … 1769 1775 } 1770 1776 1777 virtual void visit( const DirectiveDecl * old ) override final { 1778 auto decl = new ast::DirectiveDecl{ 1779 old->location, 1780 GET_ACCEPT_1(stmt, DirectiveStmt) 1781 }; 1782 decl->extension = old->extension; 1783 decl->uniqueId = old->uniqueId; 1784 decl->storage = { old->storageClasses.val }; 1785 1786 this->node = decl; 1787 } 1788 1771 1789 virtual void visit( const StaticAssertDecl * old ) override final { 1772 1790 auto decl = new ast::StaticAssertDecl{ -
src/AST/Decl.hpp
r6083392 r2d019af 10 10 // Created On : Thu May 9 10:00:00 2019 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 11 20:48:38202113 // Update Count : 3 012 // Last Modified On : Fri Mar 12 18:25:05 2021 13 // Update Count : 32 14 14 // 15 15 … … 365 365 }; 366 366 367 /// C-preprocessor directive `#...` 368 class DirectiveDecl : public Decl { 369 public: 370 ptr<DirectiveStmt> stmt; 371 372 DirectiveDecl( const CodeLocation & loc, DirectiveStmt * stmt ) 373 : Decl( loc, "", {}, {} ), stmt(stmt) {} 374 375 const DirectiveDecl * accept( Visitor & v ) const override { return v.visit( this ); } 376 private: 377 DirectiveDecl * clone() const override { return new DirectiveDecl( *this ); } 378 MUTATE_FRIEND 379 }; 380 367 381 class StaticAssertDecl : public Decl { 368 382 public: -
src/AST/Fwd.hpp
r6083392 r2d019af 9 9 // Author : Andrew Beach 10 10 // Created On : Wed May 8 16:05:00 2019 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Jul 23 14:15:00 202013 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 12 18:37:39 2021 13 // Update Count : 4 14 14 // 15 15 … … 35 35 class TypedefDecl; 36 36 class AsmDecl; 37 class DirectiveDecl; 37 38 class StaticAssertDecl; 38 39 -
src/AST/Node.cpp
r6083392 r2d019af 9 9 // Author : Thierry Delisle 10 10 // Created On : Thu May 16 14:16:00 2019 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Jun 5 10:21:00 202013 // Update Count : 111 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 12 18:25:06 2021 13 // Update Count : 2 14 14 // 15 15 … … 130 130 template class ast::ptr_base< ast::AsmDecl, ast::Node::ref_type::weak >; 131 131 template class ast::ptr_base< ast::AsmDecl, ast::Node::ref_type::strong >; 132 template class ast::ptr_base< ast::DirectiveDecl, ast::Node::ref_type::weak >; 133 template class ast::ptr_base< ast::DirectiveDecl, ast::Node::ref_type::strong >; 132 134 template class ast::ptr_base< ast::StaticAssertDecl, ast::Node::ref_type::weak >; 133 135 template class ast::ptr_base< ast::StaticAssertDecl, ast::Node::ref_type::strong >; -
src/AST/Pass.hpp
r6083392 r2d019af 139 139 const ast::Decl * visit( const ast::TypedefDecl * ) override final; 140 140 const ast::AsmDecl * visit( const ast::AsmDecl * ) override final; 141 const ast::DirectiveDecl * visit( const ast::DirectiveDecl * ) override final; 141 142 const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * ) override final; 142 143 const ast::CompoundStmt * visit( const ast::CompoundStmt * ) override final; -
src/AST/Pass.impl.hpp
r6083392 r2d019af 646 646 647 647 //-------------------------------------------------------------------------- 648 // DirectiveDecl 649 template< typename core_t > 650 const ast::DirectiveDecl * ast::Pass< core_t >::visit( const ast::DirectiveDecl * node ) { 651 VISIT_START( node ); 652 653 VISIT( 654 maybe_accept( node, &DirectiveDecl::stmt ); 655 ) 656 657 VISIT_END( DirectiveDecl, node ); 658 } 659 660 //-------------------------------------------------------------------------- 648 661 // StaticAssertDecl 649 662 template< typename core_t > -
src/AST/Print.cpp
r6083392 r2d019af 387 387 388 388 virtual const ast::AsmDecl * visit( const ast::AsmDecl * node ) override final { 389 safe_print( node->stmt ); 390 return node; 391 } 392 393 virtual const ast::DirectiveDecl * visit( const ast::DirectiveDecl * node ) override final { 389 394 safe_print( node->stmt ); 390 395 return node; -
src/AST/Visitor.hpp
r6083392 r2d019af 9 9 // Author : Andrew Beach 10 10 // Created On : Thr May 9 15:28:00 2019 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr May 9 15:33:00 201913 // Update Count : 011 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 12 18:25:07 2021 13 // Update Count : 1 14 14 // 15 15 … … 31 31 virtual const ast::Decl * visit( const ast::TypedefDecl * ) = 0; 32 32 virtual const ast::AsmDecl * visit( const ast::AsmDecl * ) = 0; 33 virtual const ast::DirectiveDecl * visit( const ast::DirectiveDecl * ) = 0; 33 34 virtual const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * ) = 0; 34 35 virtual const ast::CompoundStmt * visit( const ast::CompoundStmt * ) = 0;
Note:
See TracChangeset
for help on using the changeset viewer.