- Timestamp:
- Sep 22, 2022, 4:08:06 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 3f7e68b7
- Parents:
- 5d8dae7
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
r5d8dae7 rb859f59 58 58 CompoundStmt * stmts, Storage::Classes storage, Linkage::Spec linkage, 59 59 std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, bool isVarArgs) 60 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), params(std::move(params)), returns(std::move(returns)), 61 type_params(std::move(forall)), stmts( stmts ) { 60 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), 61 type_params(std::move(forall)), assertions(), 62 params(std::move(params)), returns(std::move(returns)), stmts( stmts ) { 62 63 FunctionType * ftype = new FunctionType(static_cast<ArgumentFlag>(isVarArgs)); 63 64 for (auto & param : this->params) { … … 82 83 std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, bool isVarArgs) 83 84 : DeclWithType( location, name, storage, linkage, std::move(attrs), fs ), 85 type_params( std::move( forall) ), assertions( std::move( assertions ) ), 84 86 params( std::move(params) ), returns( std::move(returns) ), 85 type_params( std::move( forall) ), assertions( std::move( assertions ) ),86 87 type( nullptr ), stmts( stmts ) { 87 88 FunctionType * type = new FunctionType( (isVarArgs) ? VariableArgs : FixedArgs ); … … 162 163 163 164 auto it = enumValues.find( enumerator->name ); 164 165 165 166 if ( it != enumValues.end() ) { 166 167 167 168 // Handle typed enum by casting the value in (C++) compiler 168 169 // if ( base ) { // A typed enum … … 179 180 // case BasicType::Kind::LongUnsignedInt: value = (long unsigned int) it->second; break; 180 181 // case BasicType::Kind::LongLongSignedInt: value = (long long signed int) it->second; break; 181 // case BasicType::Kind::LongLongUnsignedInt: value = (long long unsigned int) it->second; break; 182 // case BasicType::Kind::LongLongUnsignedInt: value = (long long unsigned int) it->second; break; 182 183 // // TODO: value should be able to handle long long unsigned int 183 184 -
src/AST/Decl.hpp
r5d8dae7 rb859f59 125 125 class FunctionDecl : public DeclWithType { 126 126 public: 127 std::vector<ptr<TypeDecl>> type_params; 128 std::vector<ptr<DeclWithType>> assertions; 127 129 std::vector<ptr<DeclWithType>> params; 128 130 std::vector<ptr<DeclWithType>> returns; 129 std::vector<ptr<TypeDecl>> type_params;130 std::vector<ptr<DeclWithType>> assertions;131 131 // declared type, derived from parameter declarations 132 132 ptr<FunctionType> type;
Note: See TracChangeset
for help on using the changeset viewer.