[PATCH] D25541: [CUDA] Emit deferred diagnostics during Sema rather than during codegen.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 12 18:42:33 PDT 2016


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

Emitting deferred diagnostics during codegen was a hack.  It did work,
but usability was poor, both for us as compiler devs and for users.  We
don't codegen if there are any sema errors, so for users this meant that
they wouldn't see deferred errors if there were any non-deferred errors.
For devs, this meant that we had to carefully split up our tests so that
when we tested deferred errors, we didn't emit any non-deferred errors.

This change moves checking for deferred errors into Sema.  See the big
comment in SemaCUDA.cpp for an overview of the idea.

This checking adds overhead to compilation, because we have to maintain
a partial call graph.  As a result, this change makes deferred errors a
CUDA-only concept (whereas before they were a general concept).  If
anyone else wants to use this framework for something other than CUDA,
we can generalize at that time.

This patch makes the minimal set of test changes -- after this lands,
I'll go back through and do a cleanup of the tests that we no longer
have to split up.


https://reviews.llvm.org/D25541

Files:
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/Decl.h
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/Decl.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/CodeGen/CodeGenModule.h
  clang/lib/Sema/SemaCUDA.cpp
  clang/test/Parser/lambda-attr.cu
  clang/test/SemaCUDA/call-host-fn-from-device.cu
  clang/test/SemaCUDA/function-overload.cu
  clang/test/SemaCUDA/method-target.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25541.74466.patch
Type: text/x-patch
Size: 25001 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161013/7d45882d/attachment-0001.bin>


More information about the cfe-commits mailing list