Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1266 More support for constant functions

closed-accepted
nobody
None
5
2013-03-24
2013-03-09
Martin Whitaker
No

When assigning to a bit/logic variable inside a constant function, the RHS expression value must be trimmed to match the size of the variable.

1 Attachments

Discussion

  • Pure functions with constant operands can be evaluated at compile time rather than at run time. This patch provides a global control to enable this optimisation. Until constant function support is complete, by default it is disabled.

     
  • This patch adds support for disable statements and system task calls in constant user functions. It also makes the checks for a function being constant work when the function contains nested scopes (named blocks).

    UPDATE: Removed white space error.

     
    Last edit: Martin Whitaker 2013-03-24
  • Here is a bundle of regression tests that check the above changes. All the tests are self-checking and need no special compiler flags.

     
    Attachments
  • Applied to git master.

     
    • status: open --> closed-accepted