Changes in src/SymTab/FixFunction.cc [b0845f9:0bd3faf]
- File:
-
- 1 edited
-
src/SymTab/FixFunction.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/FixFunction.cc
rb0845f9 r0bd3faf 26 26 27 27 namespace { 28 struct FixFunction final : public ast::WithShortCircuiting { 29 bool isVoid = false; 28 30 29 struct FixFunction final : public ast::WithShortCircuiting { 30 bool isVoid = false; 31 void previsit( const ast::FunctionDecl * ) { visit_children = false; } 31 32 32 void previsit( const ast::FunctionDecl * ) { visit_children = false; } 33 const ast::DeclWithType * postvisit( const ast::FunctionDecl * func ) { 34 // Cannot handle cases with asserions. 35 assert( func->assertions.empty() ); 36 return new ast::ObjectDecl{ 37 func->location, func->name, new ast::PointerType( func->type ), nullptr, 38 func->storage, func->linkage, nullptr, copy( func->attributes ) }; 39 } 33 40 34 const ast::DeclWithType * postvisit( const ast::FunctionDecl * func ) { 35 // Cannot handle cases with asserions. 36 assert( func->assertions.empty() ); 37 return new ast::ObjectDecl{ 38 func->location, func->name, new ast::PointerType( func->type ), nullptr, 39 func->storage, func->linkage, nullptr, copy( func->attributes ) }; 40 } 41 void previsit( const ast::ArrayType * ) { visit_children = false; } 41 42 42 void previsit( const ast::ArrayType * ) { visit_children = false; } 43 const ast::Type * postvisit( const ast::ArrayType * array ) { 44 return new ast::PointerType{ 45 array->base, array->dimension, array->isVarLen, array->isStatic, 46 array->qualifiers }; 47 } 43 48 44 const ast::Type * postvisit( const ast::ArrayType * array ) { 45 return new ast::PointerType{ 46 array->base, array->dimension, array->isVarLen, array->isStatic, 47 array->qualifiers }; 48 } 49 void previsit( const ast::FunctionType * ) { visit_children = false; } 49 50 50 void previsit( const ast::FunctionType * ) { visit_children = false; } 51 const ast::Type * postvisit( const ast::FunctionType * type ) { 52 return new ast::PointerType( type ); 53 } 51 54 52 const ast::Type * postvisit( const ast::FunctionType * type ) { 53 return new ast::PointerType( type ); 54 } 55 void previsit( const ast::VoidType * ) { isVoid = true; } 55 56 56 void previsit( const ast::VoidType * ) { isVoid = true; } 57 58 void previsit( const ast::BasicType * ) { visit_children = false; } 59 void previsit( const ast::PointerType * ) { visit_children = false; } 60 void previsit( const ast::StructInstType * ) { visit_children = false; } 61 void previsit( const ast::UnionInstType * ) { visit_children = false; } 62 void previsit( const ast::EnumInstType * ) { visit_children = false; } 63 void previsit( const ast::TraitInstType * ) { visit_children = false; } 64 void previsit( const ast::TypeInstType * ) { visit_children = false; } 65 void previsit( const ast::TupleType * ) { visit_children = false; } 66 void previsit( const ast::VarArgsType * ) { visit_children = false; } 67 void previsit( const ast::ZeroType * ) { visit_children = false; } 68 void previsit( const ast::OneType * ) { visit_children = false; } 69 }; 70 57 void previsit( const ast::BasicType * ) { visit_children = false; } 58 void previsit( const ast::PointerType * ) { visit_children = false; } 59 void previsit( const ast::StructInstType * ) { visit_children = false; } 60 void previsit( const ast::UnionInstType * ) { visit_children = false; } 61 void previsit( const ast::EnumInstType * ) { visit_children = false; } 62 void previsit( const ast::TraitInstType * ) { visit_children = false; } 63 void previsit( const ast::TypeInstType * ) { visit_children = false; } 64 void previsit( const ast::TupleType * ) { visit_children = false; } 65 void previsit( const ast::VarArgsType * ) { visit_children = false; } 66 void previsit( const ast::ZeroType * ) { visit_children = false; } 67 void previsit( const ast::OneType * ) { visit_children = false; } 68 }; 71 69 } // anonymous namespace 72 70
Note:
See TracChangeset
for help on using the changeset viewer.