* sources/lib/run-time/Makefile.in: Provide PLATFORM_LFLAGS, LLVM_LFLAGS and LFLAGS. Use them when generating .o from .bc to avoid warnings about unused arguments from the CFLAGS.
* sources/lib/run-time/Makefile.in (PLATFORM_CFLAGS): Use -Wno-unknown-attributes to hide verbose warnings that clang is generating due to an error in the current (7.4.2) release of the Boehm GC's headers. This can be removed once there is a new release of the Boehm GC.
* sources/lib/run-time/Makefile.in: (all): Place near the top and have it build runtime-libraries. This makes sure that the all target is before any other target. On Mac OS X, there were some targets for the Mach exception handling prior to the all target. (runtime-libraries): Build the runtime libraries.
This isn't a complete fix as we have yet to sort out how we will handle class-test-function. * sources/duim/tests/core/duim-test-suite.lid: Build specification.dylan after everything else. * sources/duim/tests/core/events.dylan (generic test-event-class): No longer open. Fixes a warning. * sources/duim/tests/core/gadgets.dylan (generic test-gadget-class): No longer open. Fixes a warning. * sources/duim/tests/core/styles.dylan (constant-test <contrasting-color>): Make this a class-test instead as it is testing a class.
* sources/lib/run-time/llvm-exceptions.c (catch_mach_exception_raise_state_identity): Handle EXC_I386_EXTERR the same as EXC_I386_SSEEXTERR. When compiling for the x87 FPU rather than SSE2 instructions, EXC_I386_EXTERR will happen when there is an FPU exception at run-time.
* sources/common-dylan/transcendentals.dylan (sqrt): Remove explicit error check for an invalid operation. This will cause an <arithmetic-domain-error> to be raised.
* sources/lib/run-time/llvm-exceptions.c (primitive_reset_float_environment): Request FE_INVALID. (DylanFPEHandler): Handle FE_INVALID. * sources/dfmc/llvm-back-end/llvm-exceptions.dylan: (dylan-float-invalid-error): New. * sources/app/llvm-runtime-generator/llvm-runtime-generator.dyla ($runtime-referenced-functions): Add #"float-invalid".
* sources/lib/run-time/x86-freebsd-exceptions.c (EstablishDylanExceptionHandlers): Call RestoreFPState to set up the initial FP exception masks correctly. (RestoreFPState): Request float underflow exceptions and move to be located before the first call site.
* sources/harp/native-rtg/exception-handlers.dylan (dylan-float-invalid-error): New. * sources/lib/run-time/harp-support/x86-freebsd/runtime.harp, sources/lib/run-time/harp-support/x86-freebsd/runtime.o, sources/lib/run-time/harp-support/x86-linux/runtime.harp, sources/lib/run-time/harp-support/x86-linux/runtime.o, sources/lib/run-time/harp-support/x86-windows/runtime.harp, sources/lib/run-time/harp-support/x86-windows/runtime.obj: Update. * sources/lib/run-time/x86-freebsd-exceptions.c, sources/lib/run-time/x86-linux-exceptions.c: (DylanFPEHandler): Handle FPE_FLTINV, invoke float-invalid(). * sources/lib/run-time/x86-windows-exceptions.c: (DylanExceptionFilter): Handle EXCEPTION_FLT_INVALID_OPERATION, invoke float-invalid().
This exception is thrown by libm functions, so it should be translated to conditions just like the other ones. * sources/dfmc/modeling/namespaces.dylan (&module dylan-extensions): Export float-invalid and <arithmetic-domain-error>. * sources/dylan/float.dylan (float-invalid): New. * sources/dylan/number.dylan (<arithmetic-domain-error>): New. * sources/common-dylan/library.dylan (module common-extensions): Export <arithmetic-domain-error>.
By using not-inline functions, we can be more sure that the compiler (either Dylan or the underlying LLVM or C compilers) won't optimize away key parts of these tests. * sources/common-dylan/tests/classes.dylan (class-test <division-by-zero-error> class-test <arithmetic-overflow-error> class-test <arithmetic-underflow-error>): Extract key parts of the tests into not-inline functions.
When a function is flagged as not-inline in Dylan, it is useful for that information to be passed along to C and LLVM to prevent it from being inlined during code generation. This is particularly useful in tests where you want to prevent the compiler from optimizing away the thing that you're testing. * sources/dfmc/llvm-back-end/llvm-emit-code.dylan (llvm-function-attributes): New. (emit-code): Get function attributes and pass them along to the <llvm-function>. * sources/dfmc/c-back-end/c-emit-object.dylan (emit-lambda-interface-using-function): Pass not-inline along to the generated C function. * sources/lib/run-time/run-time.h (OPEN_DYLAN_NO_INLINE): New portability macro.
Replace an overly simplistic criterion for identifying a local block exit with a more sophisticated (but still not perfect) estimate. A full solution would likely require performing data-flow analysis, but the DFM structures are poorly equipped to support this type of check. * sources/dfmc/flow-graph/closure.dylan (analyze-block): Replace the original "overly conservative" check with one using computations-exit-with-intervening-block?(). (computations-exit-with-intervening-block?, exit-with-intervening-block?): New methods for identifying <block> computations whose exits cross other blocks.
* sources/lib/llvm/llvm-debug.dylan (llvm-make-dbg-local-variable): Use generic arithmetic to prevent integer overflow for high-numbered function argument debug info.
* sources/lib/variable-search/darwin-variable-value.dylan (variable-value): Fix treating <raw-machine-word> as a pointer. * sources/lib/variable-search/unix-variable-value.dylan: (variable-value): Fix treating <raw-machine-word> as a pointer.
* sources/dfmc/llvm-back-end/llvm-primitives-machine-word.dylan (primitive primitive-machine-word-unsigned-double-shift-right): Return the correct value. (Was returning the input rather than the shifted result.)
* sources/dfmc/llvm-back-end/llvm-emit-computation.dylan (emit-local-merge-assignment): Fix determination of whether a <llvm-global-mv> can have #rest values or not. (do-emit-return on <llvm-local-mv>): Handle copying #rest values from a <llvm-local-mv> into the global MV area. * sources/dfmc/llvm-linker/llvm-linker.dylan ($object-extern-names): New constant listing objects that may be referenced from within code generated for computations without an entry in heap-referenced-objects. (emit-code-externs): Generate extern references for objects when needed.