clang: lib/Sema/SemaBase.cpp Source File (original) (raw)
4
6
8
13
15
17 return;
18
19
20
21
22
23
24
25
26
28
29
30 SemaRef.EmitDiagnostic(DiagID, *this);
31}
32
36
40 if (Diag.ImmediateDiag)
42 else if (Diag.PartialDiagId)
43 Diag.S.DeviceDeferredDiags[Diag.Fn][*Diag.PartialDiagId].second = PD;
45}
46
49 if (ImmediateDiag)
50 ImmediateDiag->AddFixItHint(Hint);
51 else if (PartialDiagId)
52 S.DeviceDeferredDiags[Fn][*PartialDiagId].second.AddFixItHint(Hint);
53}
54
55llvm::DenseMap<CanonicalDeclPtr,
56 std::vector> &
57SemaBase::SemaDiagnosticBuilder::getDeviceDeferredDiags() const {
58 return S.DeviceDeferredDiags;
59}
60
62 unsigned DiagID) {
63 bool IsError =
67 (SemaRef.DeferDiags || !IsError);
68 auto SetIsLastErrorImmediate = [&](bool Flag) {
69 if (IsError)
70 SemaRef.IsLastErrorImmediate = Flag;
71 };
72 if (!ShouldDefer) {
73 SetIsLastErrorImmediate(true);
76 }
77
79 ? SemaRef.CUDA().DiagIfDeviceCode(Loc, DiagID)
80 : SemaRef.CUDA().DiagIfHostCode(Loc, DiagID);
81 SetIsLastErrorImmediate(DB.isImmediate());
82 return DB;
83}
84
89
91 unsigned CompatDiagId) {
92 return Diag(Loc,
94}
95}
This file declares semantic analysis for CUDA constructs.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
void Clear() const
Clear out the current diagnostic.
bool isActive() const
Determine whether this diagnostic is still active.
static unsigned getCXXCompatDiagId(const LangOptions &LangOpts, unsigned CompatDiagId)
Get the appropriate diagnostic Id to use for issuing a compatibility diagnostic.
static bool isDeferrable(unsigned DiagID)
Whether the diagnostic message can be deferred.
Concrete class used by the front-end to report problems and issues.
const IntrusiveRefCntPtr< DiagnosticIDs > & getDiagnosticIDs() const
Annotates a diagnostic with some code that should be inserted, removed, or replaced to fix the proble...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
unsigned getDiagID() const
void Emit(const DiagnosticBuilder &DB) const
A generic diagnostic builder for errors which may or may not be deferred.
@ K_Immediate
Emit the diagnostic immediately (i.e., behave like Sema::Diag()).
void AddFixItHint(const FixItHint &Hint) const
Definition SemaBase.cpp:47
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
Definition SemaBase.cpp:33
SemaBase(Sema &S)
Definition SemaBase.cpp:7
ASTContext & getASTContext() const
Definition SemaBase.cpp:9
const LangOptions & getLangOpts() const
Definition SemaBase.cpp:11
DiagnosticsEngine & getDiagnostics() const
Definition SemaBase.cpp:10
SemaDiagnosticBuilder DiagCompat(SourceLocation Loc, unsigned CompatDiagId)
Emit a compatibility diagnostic.
Definition SemaBase.cpp:90
DeclContext * getCurContext() const
Definition SemaBase.cpp:12
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Definition SemaBase.cpp:61
Sema - This implements semantic analysis and AST building for C.
Encodes a location in the source.
The JSON file list parser is used to communicate input to InstallAPI.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.