HomePhabricator

[Sema] Improve -Wrange-loop-analysis warnings.

Authored by Mordante on Jan 11 2020, 1:16 AM.

Description

[Sema] Improve -Wrange-loop-analysis warnings.

No longer generate a diagnostic when a small trivially copyable type is
used without a reference. Before the test looked for a POD type and had no
size restriction. Since the range-based for loop is only available in
C++11 and POD types are trivially copyable in C++11 it's not required to
test for a POD type.

Since copying a large object will be expensive its size has been
restricted. 64 bytes is a common size of a cache line and if the object is
aligned the copy will be cheap. No performance impact testing has been
done.

Differential Revision: https://reviews.llvm.org/D72212

Details

Committed
MordanteJan 11 2020, 6:34 AM
Differential Revision
D72212: [Sema] Improve -Wrange-loop-analysis warnings
Parents
rG08275a52d83e: Fix copy+paste typo in shuffle test name
Branches
Unknown
Tags
Unknown