#include <class.h>
Inheritance diagram for Class_symbol:
Public Types | |
typedef std::vector< Class_symbol * > | bases_t |
typedef std::vector< Variable_symbol * > | members_t |
typedef std::vector< Function_symbol * > | memfuns_t |
Public Methods | |
Class_symbol (Kind k, Abstract_scope *in_scope, std::string real_name) | |
~Class_symbol () | |
Symbol::Kind | get_kind () const |
bool | is_pod () const |
bool | is_aggregate () const |
const std::string & | get_real_name () const |
bool | is_base_class_of (Class_symbol *other) const |
bool | is_unique_base_class_of (Class_symbol *other) const |
void | enumerate_base_classes (bool with_virtuals, bases_t *output) |
void | add_base_class (Class_symbol *sym, bool is_virt) |
Add base class. More... | |
void | dump (std::ostream &os) |
Dump symbol on /out/. More... | |
Symbol_pair | lookup_helper (std::string name) const |
Class_scope * | get_scope () |
If this symbol names a scope, return that scope. More... | |
Class_symbol::members_t::const_iterator | mem_begin () const |
Class_symbol::members_t::const_iterator | mem_end () const |
Class_symbol::bases_t::const_iterator | vbc_begin () const |
Class_symbol::bases_t::const_iterator | vbc_end () const |
Class_symbol::bases_t::const_iterator | base_begin () const |
Class_symbol::bases_t::const_iterator | base_end () const |
void | start_definition (std::string basename) |
Start class definition. More... | |
void | finish_definition () |
Finish class definition. More... | |
Private Types | |
enum | Assignment_operator { no_assignment_operator, const_assignment_operator, nonconst_assignment_operator } |
Private Methods | |
void | maybe_add_vbc (Class_symbol *sym) |
Add virtual base class, if it is not already there. More... | |
Function_signature * | get_copy_ctor (Function_symbol *fsym, bool must_be_ref) const |
Given a function signature, return the copy constructor or assignment operator (i.e. More... | |
bool | implicit_copy_ctor_is_const () const |
Class_symbol::Assignment_operator | implicit_assignment_operator_style () const |
Private Attributes | |
Kind | k |
Abstract_scope * | in_scope |
std::string | real_name |
bases_t | base_classes |
bases_t | virtual_base_classes |
members_t | members |
memfuns_t | member_functions |
bool | pod |
bool | aggregate |
Friends | |
class | Class_lookup_helper |
class | Class_scope |
Definition at line 54 of file class.h.
|
Definition at line 56 of file class.h. Referenced by Class_scope::add_function_decl(), and enumerate_conversion_ops(). |
|
|
|
|
|
Definition at line 74 of file class.h. Referenced by finish_definition(), and implicit_assignment_operator_style(). |
|
|
|
|
|
Add base class. This will also check conditions (class must be defined, class must not already be a base class, ...). FIXME: This does not reject ': virtual A, virtual A'. Definition at line 123 of file class.cc. References aggregate, base_classes, compile_error(), get_kind(), Symbol::get_name(), Symbol::is_defined(), Symbol::k_ClassOrStruct, maybe_add_vbc(), pod, and virtual_base_classes. Referenced by process_base_classes(). |
|
Definition at line 281 of file class.h. References base_classes. Referenced by process_initializers(). |
|
Definition at line 288 of file class.h. References base_classes. Referenced by process_initializers(). |
|
Dump symbol on /out/. Derived classes can override this to add own information. Reimplemented from Symbol. Definition at line 147 of file class.cc. References base_classes, Symbol::dump(), and virtual_base_classes. |
|
Definition at line 86 of file class.cc. References base_classes, and virtual_base_classes. Referenced by Class_scope::add_function_decl(), and enumerate_conversion_ops(). |
|
Finish class definition.
Definition at line 188 of file class.cc. References Type::add_qualifier(), Function_symbol::add_signature(), Class_scope::add_symbol(), aggregate, Assignment_operator, Symbol_name::ASSIGNMENT_OPERATOR_NAME, const_assignment_operator, Symbol_name::CONSTRUCTOR_NAME, f_Inline, get_copy_ctor(), get_scope(), Type_symbol::get_type(), implicit_assignment_operator_style(), implicit_copy_ctor_is_const(), Symbol_name::k_Constructor, Symbol_name::k_Operator, lookup_helper(), Type::make_reference_type(), make_unary_function_type(), member_functions, Function_symbol::must_be_new, no_assignment_operator, pod, Type::q_Const, s_Member, Function_signature::set_generated(), and Symbol_pair::untag. Referenced by parse_class(). |
|
Given a function signature, return the copy constructor or assignment operator (i.e. the signature which takes a "cv-T&" as parameter). Definition at line 250 of file class.cc. References Type::get_function_arg(), Type::get_kind(), Type::get_num_function_args(), Function_signature::get_proto_type(), Type_symbol::get_type(), Type::is_same_unqualified_type(), Type::k_Reference, Type::sans_reference(), Function_symbol::sig_begin(), Function_symbol::sig_end(), and Function_symbol::Sig_it. Referenced by finish_definition(), implicit_assignment_operator_style(), and implicit_copy_ctor_is_const(). |
|
Implements Symbol. Definition at line 52 of file class.cc. References k. Referenced by add_base_class(), and Init_handler::process_class(). |
|
Definition at line 237 of file class.h. References real_name. Referenced by Class_scope::is_constructor(). |
|
If this symbol names a scope, return that scope. Otherwise, return 0 Reimplemented from Symbol. Definition at line 165 of file class.cc. References Class_scope. Referenced by Expr_annotator::do_funcall(), finish_definition(), gen_constructors(), Symbol_name::lookup_symbol_in_scope(), parse_class(), Expr_annotator::process_member_access(), Expr_annotator::visit_array(), Expr_annotator::visit_arrowmember(), Expr_annotator::visit_assign(), Expr_annotator::visit_comma(), Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary(). |
|
Definition at line 296 of file class.cc. References Assignment_operator, Symbol_name::ASSIGNMENT_OPERATOR_NAME, base_classes, const_assignment_operator, Type::get_basis_type(), get_copy_ctor(), Type::get_function_arg(), Type::get_kind(), Function_signature::get_proto_type(), Type::get_type_symbol(), Type::is_class_type(), Type::is_qualified(), Type::k_Reference, lookup_helper(), mem_begin(), mem_end(), no_assignment_operator, nonconst_assignment_operator, Type::q_Const, Symbol_pair::untag, and virtual_base_classes. Referenced by finish_definition(). |
|
Definition at line 267 of file class.cc. References base_classes, Symbol_name::CONSTRUCTOR_NAME, Type::get_basis_type(), get_copy_ctor(), Type::get_function_arg(), Function_signature::get_proto_type(), Type::get_type_symbol(), Type::is_class_type(), Type::is_qualified(), lookup_helper(), mem_begin(), mem_end(), Type::q_Const, Symbol_pair::untag, and virtual_base_classes. Referenced by finish_definition(). |
|
Definition at line 230 of file class.h. References aggregate. Referenced by Init_handler::get_default_initializer_for_type(), Type::is_aggregate(), and Init_handler::process_brace(). |
|
Definition at line 60 of file class.cc. References base_classes, and virtual_base_classes. Referenced by Implicit_conversion::convert_reference(), get_composite_mptr_type(), is_unique_base_class_of(), and Implicit_conversion::scs_is_better_than(). |
|
Definition at line 223 of file class.h. References pod. Referenced by Type::is_pod(). |
|
Definition at line 77 of file class.cc. References is_base_class_of(). Referenced by gen_builtin_conversions(), get_composite_pointer_type(), is_covariant_or_same(), Expr_annotator::process_member_access(), Expr_annotator::process_pm_expr(), and Expr_annotator::visit_name(). |
|
Definition at line 244 of file class.h. References Symbol_table::get_instance(), Symbol_name::get_mangled_scope_from_symbol(), Symbol_name::get_mangled_symbol_name(), and Symbol::get_name(). Referenced by finish_definition(), Init_handler::get_default_initializer_for_type(), implicit_assignment_operator_style(), implicit_copy_ctor_is_const(), Class_scope::lookup_here(), Init_handler::make_constructor_call(), Class_op_lookup_helper::predicate(), Class_name_lookup_helper::predicate(), and Expr_annotator::visit_assign(). |
|
Add virtual base class, if it is not already there.
Definition at line 106 of file class.cc. References base_classes, compile_error(), Symbol::get_name(), and virtual_base_classes. Referenced by add_base_class(). |
|
Definition at line 253 of file class.h. References members. Referenced by implicit_assignment_operator_style(), implicit_copy_ctor_is_const(), Init_handler::process_class(), and process_initializers(). |
|
Definition at line 260 of file class.h. References members. Referenced by implicit_assignment_operator_style(), implicit_copy_ctor_is_const(), Init_handler::process_class(), and process_initializers(). |
|
Start class definition.
Definition at line 174 of file class.cc. References Class_scope::add_symbol(), Symbol_table::get_instance(), Type_symbol::get_type(), and Symbol_table::set_peer(). Referenced by parse_class(). |
|
Definition at line 267 of file class.h. References virtual_base_classes. Referenced by process_initializers(). |
|
Definition at line 274 of file class.h. References virtual_base_classes. Referenced by process_initializers(). |
|
|
|
Definition at line 72 of file class.h. Referenced by get_scope(). |
|
Definition at line 69 of file class.h. Referenced by add_base_class(), finish_definition(), and is_aggregate(). |
|
Definition at line 65 of file class.h. Referenced by add_base_class(), Class_lookup_helper::add_class(), base_begin(), base_end(), dump(), enumerate_base_classes(), implicit_assignment_operator_style(), implicit_copy_ctor_is_const(), is_base_class_of(), and maybe_add_vbc(). |
|
|
|
Definition at line 60 of file class.h. Referenced by get_kind(). |
|
Definition at line 67 of file class.h. Referenced by Class_scope::add_function_decl(), and finish_definition(). |
|
Definition at line 66 of file class.h. Referenced by Class_scope::add_variable(), mem_begin(), and mem_end(). |
|
Definition at line 69 of file class.h. Referenced by add_base_class(), Class_scope::add_function_decl(), Class_scope::add_variable(), finish_definition(), and is_pod(). |
|
Definition at line 62 of file class.h. Referenced by get_real_name(). |
|
Definition at line 65 of file class.h. Referenced by add_base_class(), Class_lookup_helper::add_class(), dump(), enumerate_base_classes(), Class_lookup_helper::finish(), implicit_assignment_operator_style(), implicit_copy_ctor_is_const(), is_base_class_of(), maybe_add_vbc(), vbc_begin(), and vbc_end(). |