Add the notion of deferred diagnostics.
authorJustin Lebar <jlebar@google.com>
Mon, 15 Aug 2016 20:38:56 +0000 (20:38 +0000)
committerJustin Lebar <jlebar@google.com>
Mon, 15 Aug 2016 20:38:56 +0000 (20:38 +0000)
commit60dcc1344a27c62ba7b49dc1ff39881b606a97a3
tree17d3403fdafc820f889f2da77c237f18e6820b37
parent9421ba6c024151a2be99ccb58f657d09189e2464
Add the notion of deferred diagnostics.

Summary:
This patch lets you create diagnostics that are emitted if and only if a
particular FunctionDecl is codegen'ed.

This is necessary for CUDA, where some constructs -- e.g. calls from
host+device functions to host functions when compiling for device -- are
allowed to appear in semantically-correct programs, but only if they're
never codegen'ed.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

llvm-svn: 278735
clang/include/clang/AST/ASTContext.h
clang/include/clang/AST/Decl.h
clang/lib/AST/Decl.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h