[PATCH] D24573: [CUDA] Do a better job at detecting wrong-side calls.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 14 10:09:17 PDT 2016


jlebar created this revision.
jlebar added a reviewer: rsmith.
jlebar added subscribers: tra, cfe-commits.

Move CheckCUDACall from ActOnCallExpr and BuildDeclRefExpr to
DiagnoseUseOfDecl.  This lets us catch some edge cases we were missing,
specifically around class operators.

This necessitates a few other changes:

 - Avoid emitting duplicate deferred diags in CheckCUDACall.

   Previously we'd carefully placed our call to CheckCUDACall such that
   it would only ever run once for a particular callsite.  But now this
   isn't the case.

 - Emit deferred diagnostics from a template
   specialization/instantiation's primary template, in addition to from
   the specialization/instantiation itself.  DiagnoseUseOfDecl ends up
   putting the deferred diagnostics on the template, rather than the
   specialization, so we need to check both.

https://reviews.llvm.org/D24573

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Sema/SemaCUDA.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/test/SemaCUDA/Inputs/cuda.h
  clang/test/SemaCUDA/call-host-fn-from-device.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24573.71381.patch
Type: text/x-patch
Size: 16403 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160914/44e78612/attachment-0001.bin>


More information about the cfe-commits mailing list