DSLX transpiler should not include unused headers in generated code
Open
build
cleanup
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Currently it seems that the DSLX transpiler un-conditionally include stdlib and library headers:
https://github.com/google/xls/blob/722bd8ad2125865e494897128d3c3a2cc686bd61/xls/dslx/cpp_transpiler/cpp_transpiler.cc#L45-L49
https://github.com/google/xls/blob/722bd8ad2125865e494897128d3c3a2cc686bd61/xls/dslx/cpp_transpiler/cpp_transpiler.cc#L61-L72
independently of the the fact that the generated code is using it or not.
It would be nice if the transpiled code only included headers that's actually needed so that linter and other static analysis don't flag the generated code: e.g: if only converting DSLX constants `ostream` or `vector` shouldn't be needed.
Contributor guide
Assessment
This issue has not been assessed yet.