This is an archive of the discontinued LLVM Phabricator instance.

[LLVM] Fix some Clang-tidy readability-container-size-empty and Include What You Use warnings in headers; other minor fixes
AbandonedPublic

Authored by Eugene.Zelenko on Sep 13 2016, 7:01 PM.

Details

Summary

I checked this patch on my own build on RHEL 6. Regressions were OK.

Diff Detail

Repository
rL LLVM

Event Timeline

Eugene.Zelenko retitled this revision from to [LLVM] Fix some Clang-tidy readability-container-size-empty and Include What You Use warnings in headers; other minor fixes.
Eugene.Zelenko updated this object.
Eugene.Zelenko set the repository for this revision to rL LLVM.
Eugene.Zelenko added a subscriber: llvm-commits.

Using size() to actually implement the empty() method of a container seems fine to me and should be considered a false positive of clang-tidy.

Only three containers implement empty() via size(), so it'll be better to make them consistent with other containers.

mehdi_amini added inline comments.Sep 14 2016, 1:37 PM
include/llvm/CodeGen/LiveRangeEdit.h
158

I don't really understand how it is more clear or better? I prefer the other version of empty() FWIW.

Prazek added inline comments.Sep 15 2016, 4:19 PM
include/llvm/CodeGen/LiveRangeEdit.h
158

+1

Eugene.Zelenko abandoned this revision.Sep 15 2016, 5:08 PM