Skip to content

#424 Migrate CIF code generator precondition checks to the CIF checker framework

  • Best to review per commit. There are quite a few commits, as I tried to take very small steps, one check at a time.
  • Changes to existing common CIF checks:
    • FuncNoSpecificStdLibCheck re-implemented, to be more like the unary/binary/expression checks, and to disallow standard library functions on specific arguments.
    • FuncNoSpecificStdLibCheck extended with disallows for standard library functions on specific arguments.
  • New CIF checks:
    • LocOnlyStaticEvalInitPredsCheck. Turns out I didn't need it, but seems useful to have anyway. Is similar to LocOnlyStaticEvalMarkerPredsCheck.
    • PrintNoSpecificPrintDeclsCheck.
    • VarInputOnlySimulinkCompatibleTypesCheck (CIF code generator Simulink-specific check).
  • Other changes:
    • Some refactoring for functionality related to Simulink types. Also some small renaming, JavaDoc improvements, etc.
    • A single precondition checker for all languages, with one Simulink-specific check that is target-language specific.
    • Warnings are now checking the Simulink code generator, rather than in the Simulink precondition checker. This fixes a bug where warnings were shown for function arguments and local variables of functions, that should only be reported for discrete variables.
    • Added tests for Simulink-specific preconditions and warnings.
    • Some fixes for typos and other small issues in the Simulink code generation documentation.
    • The CIF code generation documentation now states that targets may indicate additional preconditions. The Simulink code generation documentation already did so, but this was not explicitly stated with the list of general restrictions.
  • Notes:
    • Can't use constructor arguments for the checks as one of them is now conditionally added, so made a static method that returns the checks.

Addresses #424

Merge request reports