This is an archive of the discontinued LLVM Phabricator instance.

[MILR][NFC] Silence clang-tidy warning in AffineOps.cpp
ClosedPublic

Authored by bondhugula on Jul 15 2021, 9:46 PM.

Details

Summary

Silence clang-tidy warning in AffineOps.cpp due to the inability to see
through the typeswitch. NFC.

Diff Detail

Event Timeline

bondhugula created this revision.Jul 15 2021, 9:46 PM
bondhugula requested review of this revision.Jul 15 2021, 9:46 PM

Tweak comment.

What compiler does this fire on?

What compiler does this fire on?

This from clangd using:

rriddle accepted this revision.Jul 23 2021, 5:24 PM

That is surprising. I would have expected this to fire in more cases.

mlir/lib/Dialect/Affine/IR/AffineOps.cpp
111
This revision is now accepted and ready to land.Jul 23 2021, 5:24 PM
rriddle added inline comments.Jul 23 2021, 5:25 PM
mlir/lib/Dialect/Affine/IR/AffineOps.cpp
112–113

Is the template here really necessary? (I wonder if the warning would be fixed by removing it)

This function should also be marked static.

bondhugula marked an inline comment as done.

Address review comments.

mlir/lib/Dialect/Affine/IR/AffineOps.cpp
112–113

The template <> isn't necessary here but is perhaps there for better readability as it indicates an explicit specialization for the function template above. The warning isn't getting fixed by removing it. Marked it static as well.

bondhugula updated this revision to Diff 363627.Aug 2 2021, 9:59 PM

Put back template <> instead of static since the latter doesn't help with the warning.