This is an archive of the discontinued LLVM Phabricator instance.

[VP][NFCI] Address various clang-tidy warnings
ClosedPublic

Authored by frasercrmck on Jun 15 2021, 3:39 AM.

Diff Detail

Event Timeline

frasercrmck created this revision.Jun 15 2021, 3:39 AM
frasercrmck requested review of this revision.Jun 15 2021, 3:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2021, 3:39 AM

LGTM with nit.

llvm/unittests/IR/VPIntrinsicTest.cpp
253

I know const auto* follows the convention. However, i like just const auto here because do we really want to assert the type structure of what is actually just 'some' iterator to us?

frasercrmck added inline comments.Jun 16 2021, 11:18 PM
llvm/unittests/IR/VPIntrinsicTest.cpp
253

Yes I agree it's a bit weird because it looks like an iterator but it's ultimately a Type * const *. Alternatively we could perhaps explicitly use FunctionType::param_iterator. That's also a fairly common way of doing it in llvm, relatively speaking. I'm a bit wary of overriding clang-tidy in general as its opinions -- rightly or wrongly -- are what decides whether tools like editors show warnings, whether patches are landed "despite ongoing or failed builds" etc.

simoll added inline comments.Jun 17 2021, 11:51 PM
llvm/unittests/IR/VPIntrinsicTest.cpp
253

+1 for FunctionType::param_iterator

Use FunctionType::param_iterator over auto.

frasercrmck marked an inline comment as done.Jun 18 2021, 2:12 AM
frasercrmck added inline comments.
llvm/unittests/IR/VPIntrinsicTest.cpp
253

You have yourself a deal! I take it your LGTM still stands? I'll wait for your okay.

simoll accepted this revision.Jun 18 2021, 7:23 AM
This revision is now accepted and ready to land.Jun 18 2021, 7:23 AM
frasercrmck marked an inline comment as done.
  • rebase

reflow to 80 cols

  • undo unrelated change
This revision was automatically updated to reflect the committed changes.