Skip to content

Refactor collection of header files. Refactor C++ data type modelling. Extend generator script test suite.

Frederik Hennig requested to merge fhennig/header-collection into master

This rather large MR introduces a number of changes to header file collection, C++ type modelling and the lang.cpp API, and the generator script test suite.

Header file collection

This MR simplifies and clarifies the way information about required header files is modelled and collected by the SFG.

  • Remove required_headers properties from AugExpr and SfgVar
  • Introduce HeaderFile typeclass to model header files
  • For variables, attach all header information to their data type; introduce CppType and the cpptype utility to simplify creating C++ type classes and specifying their associated headers
  • Have DependentExpression track required headers in the same way as variables; introduce includes() query to collect header files form all ExprLike alternatives
  • Update ir.call_tree nodes to allow dynamic tracking of headers
  • Update composer to transfer header information from AugExprs to the IR where required
  • Update header collection to include headers for constructor and function parameters

C++ types and API Mirror

We clean up and refactor the C++ API mirror in accordance to the above changes.

  • Deprecate all std_<field type>_ref factory functions in favor of <>.from_field() static methods
  • Refactor C++ STL AugExpr classes to use the cpptype utility
  • Refactor exposition of STL classes through lang.cpp.std

Generator Script Test Suite

The generator script test suite is heavily refactored and extended to become the primary testing driver for pystencils-sfg.

  • Introduce a YAML index file to define and configure all generator script tests
  • Remove static output checking against files in expected folder in favor of regex-based checks
  • Introduce test harnesses that are compiled against generated code and executed to check correctness dynamically

Merge request reports