Changes in src/AST/Decl.cpp [07de76b:490fb92e]
- File:
-
- 1 edited
-
src/AST/Decl.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.cpp
r07de76b r490fb92e 49 49 // --- FunctionDecl 50 50 51 FunctionDecl::FunctionDecl( const CodeLocation & loc, const std::string & name, 52 std::vector<ptr<TypeDecl>>&& forall, 53 std::vector<ptr<DeclWithType>>&& params, std::vector<ptr<DeclWithType>>&& returns, 54 CompoundStmt * stmts, Storage::Classes storage, Linkage::Spec linkage, 55 std::vector<ptr<Attribute>>&& attrs, Function::Specs fs, bool isVarArgs) 56 : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), params(std::move(params)), returns(std::move(returns)), 57 stmts( stmts ) { 58 FunctionType * ftype = new FunctionType(static_cast<ArgumentFlag>(isVarArgs)); 59 for (auto & param : this->params) { 60 ftype->params.emplace_back(param->get_type()); 61 } 62 for (auto & ret : this->returns) { 63 ftype->returns.emplace_back(ret->get_type()); 64 } 65 ftype->forall = std::move(forall); 66 this->type = ftype; 67 } 68 69 51 70 const Type * FunctionDecl::get_type() const { return type.get(); } 52 void FunctionDecl::set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); } 71 void FunctionDecl::set_type( const Type * t ) { 72 type = strict_dynamic_cast< const FunctionType * >( t ); 73 } 53 74 54 75 // --- TypeDecl
Note:
See TracChangeset
for help on using the changeset viewer.