]> granicus.if.org Git - clang/commit
[CUDA] When we emit an error that might have been deferred, also print a callstack.
authorJustin Lebar <jlebar@google.com>
Wed, 19 Oct 2016 21:15:01 +0000 (21:15 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 19 Oct 2016 21:15:01 +0000 (21:15 +0000)
commitbf32d4a7db9373ef41d77bcac0bddca5b663013a
tree7063acd0c37d4952f2d6f149755eda71547ce5c7
parent158474dd7b2414aa831a7e61e2cd18fc27effad7
[CUDA] When we emit an error that might have been deferred, also print a callstack.

Summary:
Previously, when you did something not allowed in a host+device function
and then caused it to be codegen'ed, we would print out an error telling
you that you did something bad, but we wouldn't tell you how we decided
that the function needed to be codegen'ed.

This change causes us to print out a callstack when emitting deferred
errors.  This is immensely helpful when debugging highly-templated code,
where it's often unclear how a function became known-emitted.

We only print the callstack once per function, after we print the all
deferred errors.

This patch also switches all of our hashtables to using canonical
FunctionDecls instead of regular FunctionDecls.  This prevents a number
of bugs, some of which are caught by tests added here, in which we
assume that two FDs for the same function have the same pointer value.

Reviewers: rnk

Subscribers: cfe-commits, tra

Differential Revision: https://reviews.llvm.org/D25704

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284647 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaCUDA.cpp
test/SemaCUDA/bad-calls-on-same-line.cu
test/SemaCUDA/call-device-fn-from-host.cu
test/SemaCUDA/call-host-fn-from-device.cu
test/SemaCUDA/call-stack-for-deferred-err.cu [new file with mode: 0644]
test/SemaCUDA/exceptions.cu
test/SemaCUDA/no-call-stack-for-immediate-errs.cu [new file with mode: 0644]
test/SemaCUDA/trace-through-global.cu