Goose  Diff

Differences From Artifact [0b1e836161]:

  • File bs/builtins/api/compiler.cpp — part of check-in [7d2def7b75] at 2020-12-27 14:40:24 on branch trunk — Renamed "ir" to "eir" (expression intermediate representation) and "llr" to "cir" (code intermediate representation) for clarity. (user: achavasse size: 8765)

To Artifact [9e0e5f14cb]:

  • File bs/builtins/api/compiler.cpp — part of check-in [0345b9f807] at 2021-01-02 18:00:11 on branch trunk — Some more renaming. (user: achavasse size: 8759)

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
                    DiagnosticsManager::GetInstance().emitErrorMessage( v.locationId(),
                        "CreateConstant: the expression doesn't evaluate to a constant." );
                    return;
                }

                pEnv.lock()->storeValue(
                    AppendToVectorTerm( RootIdentity(), StringId( name.c_str() ) ),
                    ANYTERM( _ ), ValueToIRExpr( v ) );
            } );

        RegisterBuiltinFunc< Intrinsic< uint32_t ( string ) > >( e, "#Include"_sid,
            [pEnv]( auto&& c, const Value& fnameval ) -> Value
            {
                auto filename = *FromValue< string >( fnameval );








|







128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
                    DiagnosticsManager::GetInstance().emitErrorMessage( v.locationId(),
                        "CreateConstant: the expression doesn't evaluate to a constant." );
                    return;
                }

                pEnv.lock()->storeValue(
                    AppendToVectorTerm( RootIdentity(), StringId( name.c_str() ) ),
                    ANYTERM( _ ), ValueToEIR( v ) );
            } );

        RegisterBuiltinFunc< Intrinsic< uint32_t ( string ) > >( e, "#Include"_sid,
            [pEnv]( auto&& c, const Value& fnameval ) -> Value
            {
                auto filename = *FromValue< string >( fnameval );

186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
                    DiagnosticsManager::GetInstance().emitErrorMessage( params.locationId(),
                        "#CompileFileToFunction: template parameter lists are not supported.", 0 );
                    return PoisonValue();
                }

                // TODO at some point we'll want to pass the base identity to use as a param but
                // let's wait and see how the module and namespace stuff pans out first
                sema::Context localC( pEnv.lock(), builtins::RootIdentity(), ValueToIRExpr( rt ) );
                auto ftype = BuildFuncType( localC, rt, params );

                auto funcIdentity = AppendToVectorTerm( builtins::RootIdentity(),
                    TERM( StringId( Env::NewUniqueId() ) ) );

                c.env()->addVisibilityRule( builtins::RootIdentity(), funcIdentity );








|







186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
                    DiagnosticsManager::GetInstance().emitErrorMessage( params.locationId(),
                        "#CompileFileToFunction: template parameter lists are not supported.", 0 );
                    return PoisonValue();
                }

                // TODO at some point we'll want to pass the base identity to use as a param but
                // let's wait and see how the module and namespace stuff pans out first
                sema::Context localC( pEnv.lock(), builtins::RootIdentity(), ValueToEIR( rt ) );
                auto ftype = BuildFuncType( localC, rt, params );

                auto funcIdentity = AppendToVectorTerm( builtins::RootIdentity(),
                    TERM( StringId( Env::NewUniqueId() ) ) );

                c.env()->addVisibilityRule( builtins::RootIdentity(), funcIdentity );