Goose  Diff

Differences From Artifact [ab680901ce]:

  • File bs/builtins/api/compiler.cpp — part of check-in [af650a9e95] at 2019-09-22 14:37:55 on branch trunk — Project renaming. (user: achavasse size: 7355)

To Artifact [1cb8ca46eb]:

  • File bs/builtins/api/compiler.cpp — part of check-in [4ae6912760] at 2019-09-29 22:30:12 on branch trunk —
    • Fixed some issues with implicit termination of void functions.
    • llr: give an index to each basic block, and keep track of back links towards previous blocks.
    (user: achavasse size: 6618)

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

                if( !cfg )
                    return PoisonValue();

                if( cfg->isPoisoned() )
                    return PoisonValue();

                if( c.returnType() != GetValueType< void >()
                    && !cfg->areAllBBTerminated() )
                {
                    pFuncLLR->setInvalid();

                    // TODO the return statement should always be optional at the top level of a file,
                    // so we should be passed a default return value as parameter and insert return
                    // statements automatically wherever they may be missing in the cfg.
                    DiagnosticsManager::GetInstance().emitErrorMessage( 0,
                        format( "{}: missing return statement in a function with non-void return type.", filename ) );
                    return ToValue( func ).setPoison();
                }

                pFuncLLR->body() = cfg;
                return ToValue( func );
            } );
    }
}







<
<
<
<
<
<
<
<
<
<
<
<
<





152
153
154
155
156
157
158













159
160
161
162
163

                if( !cfg )
                    return PoisonValue();

                if( cfg->isPoisoned() )
                    return PoisonValue();














                pFuncLLR->body() = cfg;
                return ToValue( func );
            } );
    }
}