[PATCH] D47757: [Sema] Produce diagnostics when unavailable aligned allocation/deallocation functions are called

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 6 16:04:47 PDT 2018


ahatanak updated this revision to Diff 150211.
ahatanak marked an inline comment as done.
ahatanak retitled this revision from "[Sema] Diagnose unavailable aligned deallocation functions called from deleting destructors." to "[Sema] Produce diagnostics when unavailable aligned allocation/deallocation functions are called".
ahatanak added a comment.

Sink diagnoseUnavailableAlignedAllocation into DiagnoseUseOfDecl and add calls to it in a few other places so that diagnostics are produced for calls to aligned operator and builtin operator new/delete in addition to aligned deallocation functions called from deleting destructors.

I had to make changes to two test cases (dr2xx.cpp and call-host-fn-from-device.cu) that have nothing to do with aligned allocation/deallocation functions. The warning in dr2xx.cpp seems correct to me judging from the comment left few lines above it ("We're also missing the -Wused-but-marked-unused ").  I'm not sure about the   diagnostic in call-host-fn-from-device.cu. The original comment says the sized delete function annotated with `__device__` is called, but it seems that the non-sized `__host__` function is being called, in which case I think the diagnostic is correct.


Repository:
  rC Clang

https://reviews.llvm.org/D47757

Files:
  include/clang/Sema/Sema.h
  lib/Sema/SemaDeclCXX.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaExprCXX.cpp
  test/CXX/drs/dr2xx.cpp
  test/SemaCUDA/call-host-fn-from-device.cu
  test/SemaCXX/unavailable_aligned_allocation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47757.150211.patch
Type: text/x-patch
Size: 9340 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180606/f4b9d7bd/attachment.bin>


More information about the cfe-commits mailing list