summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCUDA/Inputs
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-10-08 01:07:11 +0000
committerJustin Lebar <jlebar@google.com>2016-10-08 01:07:11 +0000
commit9fdb46e71c6f91ccbbbd607830da62352dfd14cc (patch)
tree4fdd7a53fcda028b42c0b1e88e7c4f57b958e6f6 /clang/test/SemaCUDA/Inputs
parenta1a944e3cbb3a04f95ffdf1acebf00d60384b5cc (diff)
downloadbcm5719-llvm-9fdb46e71c6f91ccbbbd607830da62352dfd14cc.tar.gz
bcm5719-llvm-9fdb46e71c6f91ccbbbd607830da62352dfd14cc.zip
[CUDA] Do a better job at detecting wrong-side calls.
Summary: 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. Reviewers: rsmith Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D24573 llvm-svn: 283637
Diffstat (limited to 'clang/test/SemaCUDA/Inputs')
-rw-r--r--clang/test/SemaCUDA/Inputs/cuda.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/SemaCUDA/Inputs/cuda.h b/clang/test/SemaCUDA/Inputs/cuda.h
index d0546704598..4544369411f 100644
--- a/clang/test/SemaCUDA/Inputs/cuda.h
+++ b/clang/test/SemaCUDA/Inputs/cuda.h
@@ -22,7 +22,9 @@ typedef struct cudaStream *cudaStream_t;
int cudaConfigureCall(dim3 gridSize, dim3 blockSize, size_t sharedSize = 0,
cudaStream_t stream = 0);
-// Device-side placement new overloads.
+// Host- and device-side placement new overloads.
+void *operator new(__SIZE_TYPE__, void *p) { return p; }
+void *operator new[](__SIZE_TYPE__, void *p) { return p; }
__device__ void *operator new(__SIZE_TYPE__, void *p) { return p; }
__device__ void *operator new[](__SIZE_TYPE__, void *p) { return p; }
OpenPOWER on IntegriCloud