diff options
author | Justin Lebar <jlebar@google.com> | 2016-08-15 20:38:56 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-08-15 20:38:56 +0000 |
commit | 60dcc1344a27c62ba7b49dc1ff39881b606a97a3 (patch) | |
tree | 17d3403fdafc820f889f2da77c237f18e6820b37 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 9421ba6c024151a2be99ccb58f657d09189e2464 (diff) | |
download | bcm5719-llvm-60dcc1344a27c62ba7b49dc1ff39881b606a97a3.tar.gz bcm5719-llvm-60dcc1344a27c62ba7b49dc1ff39881b606a97a3.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 54354451b85..ed18156a082 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -490,6 +490,10 @@ private: /// MDNodes. llvm::DenseMap<QualType, llvm::Metadata *> MetadataIdMap; + /// Diags gathered from FunctionDecl::takeDeferredDiags(). Emitted at the + /// very end of codegen. + std::vector<std::pair<SourceLocation, PartialDiagnostic>> DeferredDiags; + public: CodeGenModule(ASTContext &C, const HeaderSearchOptions &headersearchopts, const PreprocessorOptions &ppopts, |