~eda-qa/leaflang/cpp

« back to all changes in this revision

Viewing changes to src/ir/compiler.cpp

  • Committer: edA-qa mort-ora-y
  • Date: 2017-06-03 05:03:54 UTC
  • mfrom: (98.1.18 typefixes)
  • Revision ID: eda-qa@disemia.com-20170603050354-6hfg5huvq56zjs66
merging typefixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#include "ir/builder.hpp"
3
3
#include "ir/type_manager.hpp"
4
4
#include "ir/std_functions.hpp"
 
5
#include "ir/dump.hpp"
5
6
 
6
 
#define SHOW_DEBUG 0
 
7
#define SHOW_DEBUG 1
7
8
#include "util/debug.hpp"
8
9
#include "lang/dump.hpp"
9
10
 
170
171
*/
171
172
void compiler::assign( value_ref left, value_ref right, builder & where, builder & store_block, unsigned flags )
172
173
{
 
174
        where.add_comment( "assign" );
173
175
        if( flags & af_force_resolve )
174
176
        {
175
177
                //the store block may not immediately follow the access block, this allows proper
181
183
        }
182
184
        
183
185
        assign_copy_value( left, right, store_block, flags );
 
186
        where.add_comment( "assign-end" );
184
187
}
185
188
 
186
189
value_ref compiler::assign_arg( value_ref in, builder & where )
200
203
void compiler::assign_copy_value( value_ref dst, value_ref src, builder & where, unsigned flags )
201
204
{
202
205
        auto dst_t = dst.result_type();
 
206
        
203
207
        if( flags & af_init_refer ) {
204
208
                if( dst_t->is_shared_pointer() )
205
209
                        dst = where.access_raw_shared(dst);
209
213
        }
210
214
        
211
215
        auto t = src.result_type();
 
216
        STATE_CHECK( t->copy == type::c_default, dump::get_type(dst_t.get()) );
212
217
        if( t->fundamental == type::f_tuple ) {
213
218
                for( size_t i=0; i < t->sub.size(); ++i ) {
214
219
                        assign_copy_value(