[llvm] Missing exports for new language constants.
Bug 7458: Factor out engine node call code emission

* sources/dfmc/llvm-back-end/llvm-entry-points.dylan
  (op--engine-node-call): New method for emitting a call through an
   <engine-node> entry point. Refine calling conventions.
  (entry-point-descriptor gf-xep): Refactor to use op--engine-node-call.
  (entry-point-descriptor gf-optional-xep): Refactor to use
   op--engine-node-call.
Bug 7458: Emit code for function calls

* sources/dfmc/llvm-back-end/llvm-emit-computation.dylan
  (emit-call on <function-call> and <object>): Remove.
  (emit-call on <simple-call> and <&iep>): Pass <function> objects to IEPs
   that need them.
  (emit-call on <method-call> and <&iep>): New method.
  (emit-call on <engine-node-call> and <object>): New method.
  (emit-call on <simple-call> and <object>): New method.
  (emit-call on <simple-call> and <&generic-function>): New method.
  (emit-call on <apply> and <object>): New method.
  (emit-call on <method-apply> and <object>): New method.

* sources/dfmc/llvm-back-end/llvm-entry-points.dylan
  (entry-point-descriptor apply-mep): Temporary placeholder definition.
Bug 7458: Allow defining single-instance entry point functions

* sources/dfmc/llvm-back-end/llvm-entry-points.dylan
  (entry-point-emitter-method): Allow passing #f as a count.
  (llvm-entry-point-function): Allow passing #f as a count, and generate
   a name without a numeric suffix.
  (make-entry-point-function, llvm-entry-point-function-type): Allow passing
   #f as a count.

* sources/app/llvm-runtime-generator/llvm-runtime-generator.dylan
  (generate-runtime-entry-point): Allow passing #f as a count.
  (generate-runtime-entry-points): Generate a single instance if the
   "singular" attribute is specified in the entry-point definition.
Bug 7458: Generate XEPs for slot accessor functions

* sources/dfmc/llvm-back-end/llvm-entry-points.dylan
  (op--slotacc-xep): New utility emitter method.
  (entry-point slotacc-single-q-instance-getter-xep,
   entry-point slotacc-single-q-class-getter-xep,
   entry-point slotacc-single-q-instance-setter-xep,
   entry-point slotacc-single-q-class-setter-xep,
   entry-point slotacc-repeated-instance-getter-xep,
   entry-point slotacc-repeated-instance-setter-xep): Implement.

* sources/dfmc/llvm-back-end/llvm-primitives-lambda.dylan
  (primitive primitive-set-accessor-method-xep): Implement dynamic setting of
   slot accessor functions to one of the above XEPs.

* sources/app/llvm-runtime-generator/llvm-runtime-generator.dylan
  ($runtime-referenced-functions): Add slot accessor IEPs to list of
   functions referenced within the generated runtime.
Bug 7440 7458: Add TODO list for LLVM development
Bug 7458: Normalize constant <values> rest as part of fixed

* sources/dfmc/llvm-back-end/llvm-emit-computation.dylan
  (emit-computation on <values>): Add values from a constant reference
   rest-value to the fixed values.
Bug 7458: Fix primitive-function type errors in runtime code

* sources/common-dylan/unix-common-extensions.dylan
  (default-random-seed): Don't cast the result of primitive-string-as-raw
   as is already a pointer.

* sources/common-dylan/darwin-common-extensions.dylan
  (darwin-sysctl): Fix types to match the sysctl() signature.

* sources/system/unix-operating-system.dylan
  (make-pipe, run-outputter, %waitpid, make-envp, load-library): Fix
   pointer casting.

* sources/lib/c-ffi/memory-functions.dylan
  (clear-memory!): Add a missing pointer cast.
Bug 7458: Implement non-local exit and return

* sources/dfmc/llvm-back-end/llvm-back-end.dylan
  (llvm-bef-struct-type): New <llvm-back-end> slot containing the raw
   struct type of bind-exit frames.
  (%raw-struct-field-index): Rename from %teb-struct-field-index as it
   now also contains bind-exit frame struct fields.
  (initialize): Call initialize-bef-struct-type.

* sources/dfmc/llvm-back-end/llvm-back-end-library.dylan
  (module dfmc-llvm-back-end): Export llvm-bef-struct-type.

* sources/dfmc/llvm-back-end/llvm-primitives-thread.dylan
  (initialize-teb-struct-type, op--teb-getelementptr): Adapt to rename
   of %teb-struct-field-index to %raw-struct-field-index.

* sources/dfmc/llvm-back-end/llvm-primitives-nlx.dylan
  (<nlx-info>): New class for representing non-local exit scopes.
  (*live-nlx*): New thread variable representing the current non-local
   exit scope.
  (op--call): New method for performing ins--invoke within an NLX block,
   or ins--call otherwise.
  ($llvm-eh-personality-function-type): New constant representing the
   type of exception handling personality functions.
  ($llvm-opendylan-eh-personality-function): New constant for the
   exception handling personality function for Open Dylan.
  ($llvm-eh-landingpad-type): New constant for the value type of landingpad
   instructions.
  (op--landingpad): New utility method for inserting a landingpad instruction.
  (op--resume): New utility function for inserting a resume instruction
   (if there is no outer NLX block) or a branch to an existing resume/cleanup
   path.
  (initialize-bef-struct-type): New back-end initialization method for
   defining the Bind Exit Frame raw struct type.
  (op--bef-getelementptr): New utility function for indexing into bind-exit
   frame fields.
  (op--typeid): New utility method for instantiating a new global constant
   whose address is used as an LLVM exception handling type ID.
  (op--allocate-bef): New utility method for emitting the
   stack-allocation of a new bind-exit frame object and initializing
   its fields.
  (primitive primitive-nlx): New auxiliary C primitive declaration.

* sources/dfmc/llvm-back-end/llvm-primitives.dylan
  (primitive-call-emitter-method): Use op--call if the referenced runtime
   primitive can unwind (as determined by the can-unwind attribute),
   or ins--call if it can not.

* sources/dfmc/llvm-back-end/llvm-primitives-basic.dylan
  (primitive primitive-slot-value): Use op--call.

* sources/dfmc/llvm-back-end/llvm-primitives-lambda.dylan
  (primitive-mep-apply-with-optionals,
   primitive-engine-node-apply-with-optionals): Mark as can-unwind.
  (primitive-apply): Mark as can-unwind, and use op--call.

* sources/dfmc/llvm-back-end/llvm-emit-type-check.dylan
  (op--type-check-error): Use op--call.

* sources/dfmc/llvm-back-end/llvm-mv.dylan
  (op--set-bef-value): New method for emitting the storing of multiple
   values into a bind-exit frame.
  (primitive-bef-values): New auxiliary primitive for retrieving values
   stored in a bind-exit frame.

* sources/dfmc/llvm-back-end/llvm-emit-computation.dylan
  (emit-call, emit-computation on <slot-value>,
   emit-primitive-call on <primitive-call> and <&c-function>,
   emit-primitive-call on <primitive-indirect-call> and <&c-function>):
   Use op--call.
  (emit-computation on <bind-exit>): Emit local and nonlocal bind-exit and
   the following control and data flow merge.
  (emit-computation on <exit>): Emit local and nonlocal exits and the return
   of values through bind-exit frames.
  (emit-computation on <unwind-protect>): Emit code for cleanup blocks.

* sources/app/llvm-runtime-generator/llvm-runtime-generator.dylan
  (generate-runtime-header): Generate a struct declaration for the BEF
   structure as well as the TEB structure.
Bug 7458: Factor out copies to and from the MV area

* sources/dfmc/llvm-back-end/llvm-mv.dylan
  (op--copy-from-mv-area): New emitter method.
  (op--copy-into-mv-area): New emitter method.
  (op--protect-temporary): Refactor to use op--copy-from-mv-area.
  (op--restore-temporary): Refactor to use op--copy-into-mv-area.
  (op--set-bef-value): Refactor to use op--copy-from-mv-area.
  (primitive-bef-values): Refactor to use op--copy-into-mv-area.
Bug 7458: Implement primitive-values

* sources/dfmc/llvm-back-end/llvm-primitives-basic.dylan
  (primitive primitive-values): Move (empty) definition from here.

* sources/dfmc/llvm-back-end/llvm-mv.dylan
  (primitive primitive-values): Move definition here and implement
   returning values from a <simple-object-vector>.
Bug 7458: Base entry point object references on definitions

* sources/dfmc/llvm-back-end/llvm-entry-points.dylan
  ($number-xeps, $number-meps, $xep-string, $rest-xep-string,
   $rest-key-xep-string, $gf-xep-string, $gf-optional-xep-string,
   $rest-key-mep-string, emit-name-internal on <&lambda-xep>,
   emit-name-internal on <&slot-accessor-xep>, $special-gf-engine-max-args,
   emit-name-internal on <&keyword-method-mep>): Remove.
  (llvm-entry-point-function): Use llvm-builder-global-defined?.
  (llvm-entry-point-info): New generic function with definitions connecting
   <&shared-entry-point> instances with the corresponding
   <llvm-entry-point-descriptor> and count.
  (emit-name-internal on <&shared-entry-point>): New method generating names
   using llvm-entry-point-info.

* sources/dfmc/llvm-back-end/llvm-back-end-types.dylan
  (llvm-entry-point-type): Remove.

* sources/dfmc/llvm-back-end/llvm-back-end-library.dylan
  (module dfmc-llvm-back-end): Remove export of llvm-entry-point-type,
   and add export of llvm-entry-point-info.

* sources/dfmc/llvm-linker/llvm-link-object.dylan
  (emit-extern on <&shared-entry-point>): Generate entry-point external
   declarations from entry-point definitions.
Bug 7458: Improve commentary

* sources/dfmc/llvm-back-end/llvm-primitives-machine-word.dylan: Improve
  commentary.
Bug 7458: Improve the LLVM back-end test jig

* Makefile.in (testl): Test-compile a larger set of libraries with
  the LLVM back-end.
Bug 7440: Add an ins--if convenience macro to emit conditionals

* sources/lib/llvm/llvm-builder.dylan
  (ins--if): New convenience macro for emitting conditional blocks
   as LLVM IR.
  (do-ins--if): Auxiliary emitter function implementing ins--if.

* sources/lib/llvm/llvm-library.dylan
  (module llvm-builder): Export ins--if.

* sources/lib/llvm/tests/specification.dylan
  (module-spec llvm-builder): Add macro-test ins--if-test.

* sources/lib/llvm/tests/llvm-builder-test.dylan
  (macro-test ins--if-test): New test units for ins--if.
Bug 7440: Add support for LLVM module flags

* sources/lib/llvm/llvm-module.dylan
  (llvm-module-add-flag): New function for adding module flags via the
  !llvm.module.flags named metadata item.

* sources/lib/llvm/llvm-library.dylan
  (module llvm): Export llvm-module-add-flag.
Bug 7440: Mark debug metadata for LLVM tools

* sources/lib/llvm/llvm-debug.dylan
  ($llvm-debug-metadata-version): New constant.
  (llvm-make-dbg-compile-unit): When debug information is used, mark
   the module using the "Debug Info Version" module flag.
Bug 7458: Fix instance comparisons against <boolean>

* sources/dfmc/llvm-back-end/llvm-emit-type-check.dylan
  (do-emit-instance-cmp): Fix instance? comparison result for #f, and
   simplify code using ins--if.
Bug 7440: Add an ins--iterate convenience macro to emit loops

* sources/lib/llvm/llvm-builder.dylan
  (ins--iterate): New convenience macro for emitting looping constructs
   as LLVM IR.
  (ins--iterate-aux): New auxiliary macro definition.
  (do-add-iterate-phi-operand): New auxiliary function for adding
   operands to loop head phi nodes.

* sources/lib/llvm/llvm-library.dylan
  (module llvm-builder): Export ins--iterate.

* sources/lib/llvm/tests/specification.dylan
  (module-spec llvm-builder): Add macro-test ins--iterate-test.

* sources/lib/llvm/tests/llvm-builder-test.dylan
  (macro-test ins--iterate-test): New tests for ins--iterate.
Bug 7558: Complete implementation of the boot-time symbol table

* sources/dfmc/llvm-back-end/llvm-primitives-symbol.dylan
  (op--lookup-symbol): Complete implementation of linear search of %oblist.
  (op--as-lowercase): New auxiliary emitter method.
  (primitive primitive-strncasecmp): New auxiliary primitive for
   case-insensitive characater comparisons.
  (op--register-symbol): Complete implementation of adding symbols to %oblist.
  (primitive primitive-resolve-symbol): Complete emitter implementation.
  (primitive primitive-string-as-symbol): Complete emitter implementation.
  (primitive primitive-preboot-symbols): Complete emitter implementation.

* sources/app/llvm-runtime-generator/llvm-runtime-generator.dylan
  ($wrapper-classes): Add <symbol> to the list of wrappers referenced
   by the runtime.