Page MenuHomePhabricator

[clang-tidy] new altera ID dependent backward branch check
Needs ReviewPublic

Authored by ffrankies on Nov 11 2019, 10:36 AM.

Details

Summary

This lint check is a 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 write code in OpenCL.

The altera ID dependent backward branch lint check finds ID dependent variables and fields used within loops, and warns of their usage. Using these variables in loops can lead to performance degradation.

Diff Detail

Event Timeline

ffrankies created this revision.Nov 11 2019, 10:36 AM
jdoerfert resigned from this revision.Nov 11 2019, 11:55 AM
Eugene.Zelenko added inline comments.
clang-tidy/altera/IdDependentBackwardBranchCheck.cpp
106 ↗(On Diff #228743)

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

129 ↗(On Diff #228743)

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

mgehre removed a subscriber: mgehre.Nov 11 2019, 10:55 PM

Implemented changes requested by @Eugene.Zelenko

Also changed for loop in hasIdDepVar and hasIdDepField to range-based for loops, and updated the license information in IdDependentBackwardBranchCheck.cpp

clang-tidy/altera/IdDependentBackwardBranchCheck.cpp
115 ↗(On Diff #231309)

May be comments were shifted with code, but here const auto * could be used, because type is spelled in dyn_cast<>.

116 ↗(On Diff #231309)

May be comments were shifted with code, but here const auto * could be used, because type is spelled in dyn_cast<>.

124 ↗(On Diff #231309)

May be comments were shifted with code, but here const auto * could be used, because type is iterator.

125 ↗(On Diff #231309)

May be comments were shifted with code, but here const auto * could be used, because type is spelled in dyn_cast<>.

165 ↗(On Diff #231309)

const auto *. Same in other dyn_cast<>.

ffrankies updated this revision to Diff 232724.Dec 7 2019, 8:13 PM
ffrankies marked 2 inline comments as done.

Addressed @Eugene.Zelenko's comments on use of auto

ffrankies updated this revision to Diff 254305.Apr 1 2020, 1:45 PM
ffrankies marked 5 inline comments as done.
Eugene.Zelenko set the repository for this revision to rG LLVM Github Monorepo.
Eugene.Zelenko removed a project: Restricted Project.