[PATCH] D72212: [Sema] Improve -Wrange-loop-analysis warnings

Richard Trieu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 8 19:10:55 PST 2020


rtrieu added inline comments.


================
Comment at: clang/lib/Sema/SemaStmt.cpp:2812-2813
 
-  // TODO: Determine a maximum size that a POD type can be before a diagnostic
-  // should be emitted.  Also, only ignore POD types with trivial copy
-  // constructors.
-  if (VariableType.isPODType(SemaRef.Context))
+  // Small trivially copyable types are cheap to copy. Do not emit the
+  // diagnostic for these instances.
+  ASTContext &Ctx = SemaRef.Context;
----------------
You should add why 64 bytes was chosen to this comment to both explain the 64 * 8 magic number in the following lines, and to let people reading this code know  why that was picked without needed to look up the patch notes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72212/new/

https://reviews.llvm.org/D72212





More information about the cfe-commits mailing list