Changes in src/AST/Decl.cpp [c36a419:c7f9f53]
- File:
-
- 1 edited
-
src/AST/Decl.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
rc36a419 rc7f9f53 21 21 22 22 #include "Common/Eval.h" // for eval 23 #include "Common/SemanticError.h" 23 24 24 25 #include "Fwd.hpp" // for UniqueId … … 41 42 42 43 FunctionDecl::FunctionDecl( const CodeLocation & loc, const std::string & name, 43 std::vector<ptr<TypeDecl>>&& forall,44 44 std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns, 45 45 CompoundStmt * stmts, Storage::Classes storage, Linkage::Spec linkage, 46 46 std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, ArgumentFlag isVarArgs ) 47 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), 48 type_params(std::move(forall)), assertions(), 49 params(std::move(params)), returns(std::move(returns)), stmts( stmts ) { 50 FunctionType * ftype = new FunctionType( isVarArgs ); 51 for (auto & param : this->params) { 52 ftype->params.emplace_back(param->get_type()); 53 } 54 for (auto & ret : this->returns) { 55 ftype->returns.emplace_back(ret->get_type()); 56 } 57 for (auto & tp : this->type_params) { 58 ftype->forall.emplace_back(new TypeInstType(tp)); 59 for (auto & ap: tp->assertions) { 60 ftype->assertions.emplace_back(new VariableExpr(loc, ap)); 61 } 62 } 63 this->type = ftype; 47 : FunctionDecl( loc, name, {}, {}, std::move(params), std::move(returns), 48 stmts, storage, linkage, std::move(attrs), fs, isVarArgs ) { 64 49 } 65 50
Note:
See TracChangeset
for help on using the changeset viewer.