Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Function_symbol Class Reference

#include <function.h>

Inheritance diagram for Function_symbol:

Inheritance graph
[legend]
Collaboration diagram for Function_symbol:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Sig_vec::const_iterator Sig_it
enum  Add_arg { must_be_declared, must_be_new, may_be_anything }

Public Methods

Sig_it sig_begin () const
Sig_it sig_end () const
Symbol_name::Kind get_function_kind () const
 Function_symbol (Abstract_scope *declared_scope, Symbol_name::Kind fun_kind)
Abstract_scopeget_declared_scope () const
Function_symbol::Kind get_kind () const
void fill_in_mangled_names (bool ignore_if_one)
Function_signatureadd_signature (Type t, Type this_type, Storage_class_specifier sc, Function_specifier_set f, Add_arg what_to_do)
 Add a signature. More...

bool is_overloaded () const
 true iff function is overloaded. More...

Type get_type () const
 Get type of this function. More...

Function_signatureget_nonoverloaded_signature () const
 Get signature of this function. More...

Function_signatureget_function_signature (Type type, bool *ambig) const
 Get function having a particular pointer type. More...

void dump (std::ostream &os)
 Dump symbol on /out/. More...


Private Types

typedef std::vector< Function_signature * > Sig_vec

Private Attributes

Sig_vec signatures
Abstract_scopedeclared_scope
Symbol_name::Kind fun_kind

Member Typedef Documentation

typedef Sig_vec::const_iterator Function_symbol::Sig_it
 

Definition at line 154 of file function.h.

Referenced by Overload_resolver::add_function(), Class_scope::add_function_decl(), enumerate_conversion_ops(), fill_in_mangled_names(), gen_candidates(), gen_constructors(), Class_symbol::get_copy_ctor(), sig_begin(), and sig_end().

typedef std::vector<Function_signature*> Function_symbol::Sig_vec [private]
 

Definition at line 143 of file function.h.


Member Enumeration Documentation

enum Function_symbol::Add_arg
 

Enumeration values:
must_be_declared 
must_be_new 
may_be_anything 

Definition at line 149 of file function.h.


Constructor & Destructor Documentation

Function_symbol::Function_symbol Abstract_scope   declared_scope,
Symbol_name::Kind    fun_kind
 

Definition at line 12 of file function.cc.

References Symbol_name::Kind, Symbol::set_status(), and Symbol::st_Defined.


Member Function Documentation

Function_signature * Function_symbol::add_signature Type    t,
Type    this_type,
Storage_class_specifier    sc,
Function_specifier_set    f,
Add_arg    what_to_do
 

Add a signature.

Parameters:
t  type of the function
this_type  type for this pointer, if needed
sc  storage class. May only be s_None when this is a definition of a function *or* a declaration at top-level.
f  function specifier set
what_to_do  what actions are we allowed to do?
Returns:
the created signature
Exceptions:
on  error

Definition at line 62 of file function.cc.

References compile_error(), Type::copy_qualifiers(), Function_specifier_set, Type::get_encoded_type(), get_function_kind(), Type::get_function_signature(), Function_signature::get_proto_type(), Type::get_return_type(), Function_signature::get_storage_specifier(), Function_signature::get_this_type(), Type::get_unqualified_type(), Type::is_qualified(), Type::is_valid(), Symbol_name::k_Constructor, Symbol_name::k_Conversion, Symbol_name::k_Destructor, Type::make_reference_type(), make_unary_function_type(), Function_signature::merge_fspec(), must_be_declared, must_be_new, Type::q_Restrict, s_Extern, s_Member, s_None, s_Static, signatures, Storage_class_specifier, and Type::with_first_arg().

Referenced by Namespace_scope::add_function_decl(), Class_scope::add_function_decl(), and Class_symbol::finish_definition().

void Function_symbol::dump std::ostream &    os [virtual]
 

Dump symbol on /out/.

Derived classes can override this to add own information.

Reimplemented from Symbol.

Definition at line 224 of file function.cc.

References Symbol::dump(), and signatures.

void Function_symbol::fill_in_mangled_names bool    ignore_if_one
 

Definition at line 32 of file function.cc.

References declared_scope, Symbol::get_basename(), Symbol_name::get_mangled_function_name(), Symbol::get_name(), Abstract_scope::get_unique_name(), Sig_it, and signatures.

Referenced by main().

Abstract_scope * Function_symbol::get_declared_scope   const [inline]
 

Definition at line 315 of file function.h.

References declared_scope.

Referenced by process_initializers().

Symbol_name::Kind Function_symbol::get_function_kind   const [inline]
 

Definition at line 158 of file function.h.

References fun_kind, and Symbol_name::Kind.

Referenced by Function_body_queue::add_function(), add_signature(), Overload_candidate::fill_in_tree(), and process_function_body().

Function_signature * Function_symbol::get_function_signature Type    type,
bool *    ambig
const
 

Get function having a particular pointer type.

Parameters:
type  desired type (must be pointer-to-member or pointer)
ambig  if non-null, stores "true" if it fails due to ambiguity, "false" if it fails due to non-existance of signature.
Returns:
the signature, or null

Definition at line 201 of file function.cc.

References Type::get_kind(), Type::k_Member, Type::k_Pointer, and signatures.

Referenced by Class_op_lookup_helper::predicate().

Function_symbol::Kind Function_symbol::get_kind   const [virtual]
 

Implements Symbol.

Definition at line 24 of file function.cc.

References Symbol::k_Function.

Function_signature * Function_symbol::get_nonoverloaded_signature   const
 

Get signature of this function.

Only works for non-overloaded functions.

Definition at line 184 of file function.cc.

References is_overloaded(), and signatures.

Referenced by get_type(), Expr_annotator::visit_name(), and Expr_annotator::visit_unary().

Type Function_symbol::get_type   const [inline]
 

Get type of this function.

Only works for non-overloaded functions.

Definition at line 323 of file function.h.

References get_nonoverloaded_signature(), and Function_signature::get_proto_type().

bool Function_symbol::is_overloaded   const
 

true iff function is overloaded.

Definition at line 162 of file function.cc.

References signatures.

Referenced by get_nonoverloaded_signature(), Expr_annotator::visit_name(), and Expr_annotator::visit_unary().

Sig_it Function_symbol::sig_begin   const [inline]
 

Definition at line 155 of file function.h.

References Sig_it, and signatures.

Referenced by Overload_resolver::add_function(), Class_scope::add_function_decl(), enumerate_conversion_ops(), gen_candidates(), gen_constructors(), and Class_symbol::get_copy_ctor().

Sig_it Function_symbol::sig_end   const [inline]
 

Definition at line 156 of file function.h.

References Sig_it, and signatures.

Referenced by Overload_resolver::add_function(), Class_scope::add_function_decl(), enumerate_conversion_ops(), gen_candidates(), gen_constructors(), and Class_symbol::get_copy_ctor().


Member Data Documentation

Abstract_scope* Function_symbol::declared_scope [private]
 

Definition at line 145 of file function.h.

Referenced by fill_in_mangled_names(), and get_declared_scope().

Symbol_name::Kind Function_symbol::fun_kind [private]
 

Definition at line 146 of file function.h.

Referenced by get_function_kind().

Sig_vec Function_symbol::signatures [private]
 

Definition at line 144 of file function.h.

Referenced by add_signature(), dump(), fill_in_mangled_names(), get_function_signature(), get_nonoverloaded_signature(), is_overloaded(), sig_begin(), and sig_end().


The documentation for this class was generated from the following files:
Generated on Mon Feb 10 17:35:38 2003 for VFiasco Semantics Compiler by doxygen1.2.15