Changeset 20737104
- Timestamp:
- Sep 21, 2022, 9:38:34 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 0bd46fd
- Parents:
- e9e9f56
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Create.cpp
re9e9f56 r20737104 10 10 // Created On : Tue Sep 20 13:28:00 2022 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Sep 2 0 14:55:00 202213 // Update Count : 012 // Last Modified On : Tue Sep 21 9:29:00 2022 13 // Update Count : 1 14 14 // 15 15 … … 19 19 #include "AST/Copy.hpp" 20 20 #include "AST/Decl.hpp" 21 #include "AST/Type.hpp" 21 22 22 23 namespace ast { … … 35 36 36 37 } // namespace 38 39 FunctionDecl * asForward( FunctionDecl const * decl ) { 40 if ( nullptr == decl->stmts ) { 41 return nullptr; 42 } 43 return new ast::FunctionDecl( decl->location, 44 decl->name, 45 vectorCopy( decl->type_params ), 46 vectorCopy( decl->assertions ), 47 vectorCopy( decl->params ), 48 vectorCopy( decl->returns ), 49 nullptr, 50 decl->storage, 51 decl->linkage, 52 vectorCopy( decl->attributes ), 53 decl->funcSpec, 54 decl->type->isVarArgs 55 ); 56 } 37 57 38 58 StructDecl * asForward( StructDecl const * decl ) { -
src/AST/Create.hpp
re9e9f56 r20737104 10 10 // Created On : Tue Sep 20 13:25:00 2022 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Sep 20 1 4:38:00 202213 // Update Count : 012 // Last Modified On : Tue Sep 20 15:34:00 2022 13 // Update Count : 1 14 14 // 15 15 … … 21 21 /// If the argument is already a forward declaration, return nullptr instead. 22 22 /// More efficient than the deepCopy and clear pattern. 23 FunctionDecl * asForward( FunctionDecl const * ); 23 24 StructDecl * asForward( StructDecl const * ); 24 25 UnionDecl * asForward( UnionDecl const * ); -
src/Validate/Autogen.cpp
re9e9f56 r20737104 10 10 // Created On : Thu Dec 2 13:44:00 2021 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : T hr Jan 27 9:29:00 202213 // Update Count : 112 // Last Modified On : Tue Sep 20 16:00:00 2022 13 // Update Count : 2 14 14 // 15 15 … … 25 25 26 26 #include "AST/Attribute.hpp" 27 #include "AST/Create.hpp" 27 28 #include "AST/Decl.hpp" 28 29 #include "AST/DeclReplacer.hpp" … … 328 329 void FuncGenerator::produceForwardDecl( const ast::FunctionDecl * decl ) { 329 330 if (0 != functionNesting) return; 330 ast::FunctionDecl * fwd = ast::deepCopy( decl );331 fwd->stmts = nullptr;331 ast::FunctionDecl * fwd = 332 ( decl->stmts ) ? ast::asForward( decl ) : ast::deepCopy( decl ) ; 332 333 fwd->fixUniqueId(); 333 334 forwards.push_back( fwd );
Note: See TracChangeset
for help on using the changeset viewer.