Page MenuHomePhabricator

[clang-tidy] new altera kernel name restriction check
Needs ReviewPublic

Authored by ffrankies on Jan 4 2020, 8:10 PM.

Details

Summary

This lint check is part of the FLOCL (FPGA Linters for OpenCL) project out of the Synergy Lab at Virginia Tech.

FLOCL is a set of lint checks aimed at FPGA developers who code in OpenCL.

The altera kernel name restriction check finds kernel files and include directives whose filename is "kernel.cl", "Verilog.cl", or "VHDL.cl". Such kernel file names cause the Altera Offline Compiler to generate intermediate design files that have the same names as certain internal files, which leads to a compilation error.

As per the "Guidelines for Naming the Kernel" section in the "Intel FPGA SDK for OpenCL Pro Edition: Programming Guide."

Depends on D66564 due to the altera module being introduced there.

Diff Detail

Event Timeline

ffrankies created this revision.Jan 4 2020, 8:10 PM
Eugene.Zelenko added inline comments.
clang-tidy/altera/KernelNameRestrictionCheck.cpp
22

Please separate with empty line.

47

Please separate with empty line.

docs/ReleaseNotes.rst
79

Please fix indentation and use single back-ticks to highlight file names. Same in documentation.

docs/clang-tidy/checks/altera-kernel-name-restriction.rst
14

May be link is better?

Eugene.Zelenko added inline comments.Jan 4 2020, 10:03 PM
clang-tidy/altera/KernelNameRestrictionCheck.cpp
14

Please include string, vector

70

Please don't use auto unless type is not spelled in same statement or iterator.

71

Please don't use auto unless type is not spelled in same statement or iterator.

83

Please don't use auto unless type is not spelled in same statement or iterator.

85

Please don't use auto unless type is not spelled in same statement or iterator.

ffrankies marked 9 inline comments as done.
ffrankies edited the summary of this revision. (Show Details)

Implemented changes requested by @Eugene.Zelenko:

  • Added empty lines around namespace block
  • Fixed use of auto keyword
  • Fixed formatting in documentation
  • Added dependency on previous revision (D66564) to the Summary.