~eda-qa/leaflang/sdl

« back to all changes in this revision

Viewing changes to src/lang/expression.cpp

  • Committer: edA-qa mort-ora-y
  • Date: 2018-03-09 08:24:51 UTC
  • Revision ID: eda-qa@disemia.com-20180309082451-t4npeesvwv0g1llu
add as_abi_ptr

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "lang/language.hpp"
 
2
#include "lang/type_manager.hpp"
2
3
 
3
4
#include <typeinfo>
4
5
 
208
209
        return false;
209
210
}
210
211
 
211
 
void expr_switch::construct_result_type() {
 
212
void expr_switch::construct_result_type(type_manager& /*types*/) {
212
213
        STATE_CHECK( expr_list.size() );
213
214
        type = expr_list[0].value->type;
214
215
}
285
286
        STATE_CHECK( arg );
286
287
}
287
288
 
288
 
void expr_transform::construct_result_type() {
 
289
void expr_transform::construct_result_type(type_manager& types) {
289
290
        switch( transform ) {
290
291
                case t_deref: {
291
292
                        type = arg->type.extr();
349
350
                        type = char_type;
350
351
                        break;
351
352
                }
 
353
                
 
354
                case t_abi_ptr: {
 
355
                        type = extr_type(types.get_abi_ptr());
 
356
                        break;
 
357
                }
352
358
        }
353
359
}
354
360
 
463
469
        a = expr;
464
470
}
465
471
 
466
 
void expr_conditional::construct_result_type() {
 
472
void expr_conditional::construct_result_type(type_manager& /*types*/) {
467
473
        switch( op ) {
468
474
                case o_optional_or:
469
475
                        type = a->type;
541
547
        }
542
548
}
543
549
 
544
 
void expr_bind::construct_result_type() {
 
550
void expr_bind::construct_result_type(type_manager& /*types*/) {
545
551
        auto ft = unbound->type.extr().cast<intr_type_function const>().clone_derived();
546
552
        ft->context = type_ref();
547
553
        ft->access = intr_type_function::a_bound;