|
Yume
|
A struct declaration in the compiler. More...
#include <vals.hpp>

Public Member Functions | |
| Struct (ast::StructDecl &ast_decl, ast::Program *member, optional< ty::Type > type, Substitutions subs) noexcept | |
| Struct (ast::StructDecl &ast_decl, ast::Program *member, optional< ty::Type > type, nullable< Substitutions * > parent_subs, vector< GenericKey > generic={}, vector< unique_ptr< ty::Generic > > primary_generics={}) noexcept | |
| auto | ast () const noexcept -> const auto & |
| auto | ast () noexcept -> auto & |
| auto | body () const noexcept -> const auto & |
| auto | body () noexcept -> auto & |
| auto | get_self_ty () const noexcept -> optional< ty::Type > |
| auto | get_subs () const -> const Substitutions & |
| auto | get_subs () -> Substitutions & |
| auto | has_annotation (const string &name) const -> bool |
| auto | name () const noexcept -> string |
| auto | get_or_create_instantiation (Substitutions &subs) noexcept -> std::pair< bool, Struct & > |
| auto | create_instantiation (Substitutions &subs) noexcept -> Struct & |
Public Attributes | |
| ast::StructDecl & | st_ast |
| optional< ty::Type > | self_ty {} |
The type of this struct. Used for the self type. More... | |
| ast::Program * | member {} |
| The program this declaration is a member of. More... | |
| vector< unique_ptr< ty::Generic > > | primary_generics {} |
| Substitutions | subs |
| If this is an instantiation of a template, a mapping between type variables and their substitutions. More... | |
| std::unordered_map< Substitutions, unique_ptr< Struct > > | instantiations {} |
| std::vector< VTableEntry > | vtable_members {} |
| nullable< llvm::GlobalVariable * > | vtable_memo {} |
A struct declaration in the compiler.
Very similar to Fn, the primary use of this structure is to bind together the AST declaration of a struct (ast::StructDecl) and the type this struct defines. A struct template may also be a Struct. All the instantiations of a template are stored in instantiations.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 158 of file vals.hpp.
References st_ast.
Referenced by yume::create_vtable_for(), and yume::Compiler::run().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 160 of file vals.hpp.
References yume::ast::StructDecl::body, and st_ast.
Referenced by create_instantiation(), and yume::create_vtable_for().
|
inlinenoexcept |
Definition at line 161 of file vals.hpp.
References yume::ast::StructDecl::body, and st_ast.
|
noexcept |
|
noexcept |
|
inlinenoexcept |
|
inline |
|
inline |
Definition at line 163 of file vals.hpp.
References subs.
Referenced by yume::Compiler::create_struct(), and yume::Compiler::decl_statement().
|
inline |
Definition at line 165 of file vals.hpp.
References yume::ast::StructDecl::annotations, name(), and st_ast.
Referenced by yume::Compiler::decl_statement().
|
noexcept |
Definition at line 68 of file vals.cpp.
References yume::ast::StructDecl::name, and st_ast.
Referenced by has_annotation(), yume::semantic::TypeWalker::make_dup(), and yume::Const::referred_to_by().
| std::unordered_map<Substitutions, unique_ptr<Struct> > yume::Struct::instantiations {} |
| ast::Program* yume::Struct::member {} |
| vector<unique_ptr<ty::Generic> > yume::Struct::primary_generics {} |
| optional<ty::Type> yume::Struct::self_ty {} |
The type of this struct. Used for the self type.
Definition at line 139 of file vals.hpp.
Referenced by yume::Compiler::create_struct(), yume::Compiler::decl_statement(), get_self_ty(), yume::Const::get_self_ty(), and yume::Const::referred_to_by().
| ast::StructDecl& yume::Struct::st_ast |
Definition at line 137 of file vals.hpp.
Referenced by ast(), body(), yume::Compiler::create_struct(), has_annotation(), and name().
| Substitutions yume::Struct::subs |
If this is an instantiation of a template, a mapping between type variables and their substitutions.
Definition at line 145 of file vals.hpp.
Referenced by yume::DeclLike::fully_substituted(), and get_subs().
| std::vector<VTableEntry> yume::Struct::vtable_members {} |
Definition at line 147 of file vals.hpp.
Referenced by yume::create_vtable_for().
| nullable<llvm::GlobalVariable*> yume::Struct::vtable_memo {} |