or_ics.cc File Reference

#include <lestes/lang/cplus/sem/or_ics.g.hh>
#include <lestes/lang/cplus/sem/or_ics_actual_visitors.g.hh>
#include <lestes/lang/cplus/sem/ss_declaration.g.hh>
#include <lestes/lang/cplus/sem/ss_misc.g.hh>
#include <lestes/lang/cplus/sem/or_or.g.hh>
#include <lestes/std/source_location.hh>
#include <lestes/msg/logger.hh>
#include <lestes/lang/cplus/sem/or_ics_logger.hh>
#include <lestes/lang/cplus/sem/or_actual_visitors.g.hh>

Include dependency graph for or_ics.cc:


Namespaces

namespace  lestes
namespace  lestes::lang
namespace  lestes::lang::cplus
namespace  lestes::lang::cplus::sem

Defines

#define IS_PTR_BOOL_CONV(t1, t2)   ((t1) == OR_CV_PTR || (t1) == OR_CV_MEMBER_PTR) && ((t2) == OR_CV_BOOL)
#define IS_PTR(t1)   ((t1) == OR_CV_PTR)
#define IS_MEMBER_PTR(t1)   ((t1) == OR_CV_MEMBER_PTR)
#define IS_CLASS(t1)   t1 == OR_CV_CLASS
#define IS_VOID(t1)   t1 == OR_CV_VOID
#define DEREF_PTR(t1)   (t1.dncast<ss_pointer>()->what_get()->accept_or_ics_base_cv(v))
#define DEREF_PTR_NOVIS(t1)   ((t1).dncast<ss_pointer>()->what_get())
#define MEMBER_PTR_BASE(t1)   ((t1).dncast<ss_member_pointer>()->base_get()).dncast<ss_class>()
#define IS_VOLATILE(x)   (((x) == OR_CV_VOLATILE) || (x) == OR_CV_CONST_VOLATILE)
#define IS_PSEUDOREFERENCE(x)   (((x) == OR_CV_PSEUDOREFERENCE))
#define IS_REFERENCE(x)   (((x) == OR_CV_REFERENCE))
#define IS_CONST(x)   (((x) == OR_CV_CONST))
#define CONVERT_TO(type, rank)
#define CONVERT_TO_POINTER(_type, rank)
#define CONVERT_TO_NONTYPE(type, rank)
#define CONVERT_LVAL_RVAL()

Functions

 lestes::lang::cplus::sem::declare_logger (or_ics_log)
 lestes::lang::cplus::sem::initialize_logger (or_ics_log,"or_ics_finder", or_ics_logger)
bool lestes::lang::cplus::sem::is_better_conv_seq (ptr< or_ics_functional > r1, ptr< or_or_functional > e1, ptr< or_ics_functional > r2, ptr< or_or_functional > e2)
bool lestes::lang::cplus::sem::is_not_worse_conv_seq (ptr< or_ics_functional > r1, ptr< or_or_functional > e1, ptr< or_ics_functional > r2, ptr< or_or_functional > e2)
ptr< ::lestes::std::list<
srp< or_ics_functional > > > 
lestes::lang::cplus::sem::filter_type (ptr< ::lestes::std::list< srp< or_ics_functional > > > lst, ptr< ss_type > tgt)
ptr< or_ics_functional > lestes::lang::cplus::sem::get_best_conversion (ptr< ::lestes::std::list< srp< or_ics_functional > > > lst, ptr< or_or_functional > e)
ptr< or_ics_functional > lestes::lang::cplus::sem::or_find_ics (ptr< or_or_functional > source, ptr< ss_type > target)
ptr< ss_expression > lestes::lang::cplus::sem::convert_ptr_to_cv (ptr< or_or_functional > source)

Detailed Description

Implementation of overload resolution algorithm (see chapters 4,8,13)

TODO create a map for purposes of caching of functionals, representing conversions to the same type

Author:
jikos

Define Documentation

 
#define CONVERT_LVAL_RVAL (  ) 

Value:

ptr< or_ics_visitor_cv > v = or_ics_visitor_cv::create();       \
                llog(or_ics_log) << "Performing lval->rval conversion\n"; \
                if(source_get()->type_get()->accept_or_ics_base_cv(v) == OR_CV_REFERENCE ) {    \
                        llog(or_ics_log) << "We are holding reference type\n"; \
                \
                        /* the first field is identity - the functional we can use for lval->rval composition */        \
                        ::lestes::std::list< srp< or_ics_functional > >::iterator it = seq_list->begin();                       \
                        ptr< or_ics_functional_for_lval_rval_conversion > conversion1 =                                         \
                                                or_ics_functional_for_lval_rval_conversion::create(RANK_EXACT, source_get()->type_get());       \
                        ptr< or_ics_functional_for_compound_conversion > conversion2 = or_ics_functional_for_compound_conversion::create(       \
                                                                RANK_EXACT,     \
                                                                conversion1->target_type_get(),                                 \
                                                                conversion1,    \
                                                                *it);           \
                        seq_list->push_back(conversion2);       \
                        /* the lvalue will no more be needed - only in ss_function and ss_array cases, \
                         * and they are handled separately \
                         */     \
                        seq_list->pop_front();  \
                } \

#define CONVERT_TO ( type,
rank   ) 

Value:

{       \
                for(it = it_orig; it != seq_list_end; ++it){    \
                        ptr< ss_type > type1 = ss_type_##type::instance();      \
                        ptr< or_ics_functional_for_std_conversion > conversion1 = or_ics_functional_for_std_conversion::create(rank, type1);    \
                        ptr< or_ics_functional_for_compound_conversion > conversion2 = or_ics_functional_for_compound_conversion::create(       \
                                                                        MAX((*it)->rank_get(), rank),                                   \
                                                                        conversion1->target_type_get(),                                 \
                                                                        conversion1,                                                    \
                                                                        *it);                                                           \
                        new_list->push_back(conversion2);                                                                               \
                }\
                funclist::iterator it_f = new_list->begin();\
}

#define CONVERT_TO_NONTYPE ( type,
rank   ) 

Value:

{       \
                for(it = it_orig; it != seq_list_end; it++){    \
                        ptr< ss_type > type1 = ss_##type::instance();   \
                        ptr< or_ics_functional_for_std_conversion > conversion1 = or_ics_functional_for_std_conversion::create(rank, type1);    \
                        ptr< or_ics_functional_for_compound_conversion > conversion2 = or_ics_functional_for_compound_conversion::create(       \
                                                                        MAX((*it)->rank_get(), rank),                                   \
                                                                        conversion1->target_type_get(),                                 \
                                                                        conversion1,                                                    \
                                                                        *it);                                                           \
                        new_list->push_back(conversion2);                                                                               \
                }\
}

#define CONVERT_TO_POINTER ( _type,
rank   ) 

Value:

::lestes::std::list< srp< or_ics_functional > >::iterator it = seq_list->begin();                                       \
                        ptr< ss_type > type1 = ss_pointer::instance(_type);     \
                        ptr< or_ics_functional_for_std_conversion > conversion1 = or_ics_functional_for_std_conversion::create(rank, type1);    \
                        ptr< or_ics_functional_for_compound_conversion > conversion2 = or_ics_functional_for_compound_conversion::create(       \
                                                                        MAX((*it)->rank_get(), rank),                                   \
                                                                        conversion1->target_type_get(),                                 \
                                                                        conversion1,                                                    \
                                                                        *it);                                                           \
                        seq_list->push_back(conversion2);                                                                               \

#define DEREF_PTR ( t1   )     (t1.dncast<ss_pointer>()->what_get()->accept_or_ics_base_cv(v))

#define DEREF_PTR_NOVIS ( t1   )     ((t1).dncast<ss_pointer>()->what_get())

#define IS_CLASS ( t1   )     t1 == OR_CV_CLASS

#define IS_CONST (  )     (((x) == OR_CV_CONST))

#define IS_MEMBER_PTR ( t1   )     ((t1) == OR_CV_MEMBER_PTR)

#define IS_PSEUDOREFERENCE (  )     (((x) == OR_CV_PSEUDOREFERENCE))

#define IS_PTR ( t1   )     ((t1) == OR_CV_PTR)

#define IS_PTR_BOOL_CONV ( t1,
t2   )     ((t1) == OR_CV_PTR || (t1) == OR_CV_MEMBER_PTR) && ((t2) == OR_CV_BOOL)

#define IS_REFERENCE (  )     (((x) == OR_CV_REFERENCE))

#define IS_VOID ( t1   )     t1 == OR_CV_VOID

#define IS_VOLATILE (  )     (((x) == OR_CV_VOLATILE) || (x) == OR_CV_CONST_VOLATILE)

#define MEMBER_PTR_BASE ( t1   )     ((t1).dncast<ss_member_pointer>()->base_get()).dncast<ss_class>()


Generated on Mon Feb 12 18:33:13 2007 for lestes by doxygen 1.5.1-20070107