]> granicus.if.org Git - clang/commit
[CUDA] Fix false-positive in known-emitted handling.
authorJustin Lebar <jlebar@google.com>
Mon, 17 Oct 2016 02:25:55 +0000 (02:25 +0000)
committerJustin Lebar <jlebar@google.com>
Mon, 17 Oct 2016 02:25:55 +0000 (02:25 +0000)
commit72399385177f4f8c9ae3364b2eb5ca0b3a14e36f
tree35668c1df4d42c5ad64e1c389cd08f8da5cba075
parentea85b7d530b11785eb724fd899dfaa17bbe16895
[CUDA] Fix false-positive in known-emitted handling.

Previously: When compiling for host, our constructed call graph went
*through* kernel calls.  This meant that if we had

  host calls kernel calls HD

we would incorrectly mark the HD function as known-emitted on the host
side, and thus perform host-side checks on it.

Fixing this exposed another issue, wherein when marking a function as
known-emitted, we also need to traverse the callgraph of its template,
because non-dependent calls are attached to a function's template, not
its instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284355 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaCUDA.cpp
test/SemaCUDA/trace-through-global.cu [new file with mode: 0644]