summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-08-10 18:34:47 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2016-08-10 18:34:47 +0000
commit7ea9fd233bdccb45f0a43879d5f7d49d972c9a7d (patch)
tree241ab3ecc4b8f16c19d1a592232edeebdd1dba18 /llvm/lib/CodeGen/BranchFolding.cpp
parent12b0acc7274d2c39ba593be2adbb8c2a42e8809d (diff)
downloadbcm5719-llvm-7ea9fd233bdccb45f0a43879d5f7d49d972c9a7d.tar.gz
bcm5719-llvm-7ea9fd233bdccb45f0a43879d5f7d49d972c9a7d.zip
Reapply [Sema] Add sizeof diagnostics for bzero
Reapply r277787. For memset (and others) we can get diagnostics like: struct stat { int x; }; void foo(struct stat *stamps) { bzero(stamps, sizeof(stamps)); memset(stamps, 0, sizeof(stamps)); } t.c:7:28: warning: 'memset' call operates on objects of type 'struct stat' while the size is based on a different type 'struct stat *' [-Wsizeof-pointer-memaccess] memset(stamps, 0, sizeof(stamps)); ~~~~~~ ^~~~~~ t.c:7:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)? memset(stamps, 0, sizeof(stamps)); ^~~~~~ This patch implements the same class of warnings for bzero. Differential Revision: https://reviews.llvm.org/D22525 rdar://problem/18963514 llvm-svn: 278264
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud