Goose  Diff

Differences From Artifact [fca62dc85c]:

  • File bs/compiler.cpp — part of check-in [7e053c8063] at 2019-06-16 14:41:50 on branch trunk — Added the current domain to sema context, and include it in function identities. (user: achavasse size: 1564)

To Artifact [e027a73c87]:

  • File bs/compiler.cpp — part of check-in [cde0c6d0e3] at 2019-06-19 19:49:50 on branch trunk —
    • parser: don't hardcode the builtins identity prefix in the rule helpers anymore.
    • builtins: move the common identity prefix used by all builtins into a separate function, to be able to easily change it.
    • builtins: prepend the CompileTime domain specifier to the root builtin identity.
    • sema: don't store the domain separately, extract it from the identity when needed instead.
    (user: achavasse size: 1548)

1
2
3
4
5
6
7
8
9
10
#include "compiler.h"
#include "builtins/builtins.h"
#include "parse/parse.h"
#include "sema/sema.h"
#include "execute/execute.h"

using namespace empathy;
using namespace empathy::util;
using namespace empathy::ir;



|







1
2
3
4
5
6
7
8
9
10
#include "compiler.h"
#include "builtins/builtins.h"
#include "builtins/helpers.h"
#include "sema/sema.h"
#include "execute/execute.h"

using namespace empathy;
using namespace empathy::util;
using namespace empathy::ir;

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
        {
            cout << str << endl;
        } );
}

uint64_t Compiler::execute( istream& source, const ptr< string >& filename )
{
    sema::Context c( m_pEnv, sema::DomainCompileTime(), TVEC( TSID( e0 ) ), GetValueType< uint64_t >() );

    auto r = make_shared< parse::Resolver >( make_shared< lex::Lexer >( source, filename ), c );
    parse::Parser p( r );

    auto cfgBuilder = make_shared< sema::CFGBuilder >();
    p.setCFGBuilder( cfgBuilder );
    p.setCurrentBB( cfgBuilder->entryBB() );







|







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
        {
            cout << str << endl;
        } );
}

uint64_t Compiler::execute( istream& source, const ptr< string >& filename )
{
    sema::Context c( m_pEnv, builtins::RootIdentity(), GetValueType< uint64_t >() );

    auto r = make_shared< parse::Resolver >( make_shared< lex::Lexer >( source, filename ), c );
    parse::Parser p( r );

    auto cfgBuilder = make_shared< sema::CFGBuilder >();
    p.setCFGBuilder( cfgBuilder );
    p.setCurrentBB( cfgBuilder->entryBB() );