clang: lib/Sema/SemaBase.cpp Source File (original) (raw)

4

6

8

12

14

16 return;

17

18

19

20

21

22

23

24

25

27

28

30}

31

34}

35

39 if (Diag.ImmediateDiag)

41 else if (Diag.PartialDiagId)

44}

45

48 if (ImmediateDiag)

49 ImmediateDiag->AddFixItHint(Hint);

50 else if (PartialDiagId)

51 S.DeviceDeferredDiags[Fn][*PartialDiagId].second.AddFixItHint(Hint);

52}

53

54llvm::DenseMap<CanonicalDeclPtr,

55 std::vector> &

56SemaBase::SemaDiagnosticBuilder::getDeviceDeferredDiags() const {

57 return S.DeviceDeferredDiags;

58}

59

61 bool DeferHint) {

62 bool IsError =

67 auto SetIsLastErrorImmediate = [&](bool Flag) {

68 if (IsError)

70 };

71 if (!ShouldDefer) {

72 SetIsLastErrorImmediate(true);

75 }

76

80 SetIsLastErrorImmediate(DB.isImmediate());

81 return DB;

82}

83

86 bool DeferHint) {

88}

89

90}

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 ...

PartialDiagnostic::DiagStorageAllocator & getDiagAllocator()

void Clear() const

Clear out the current diagnostic.

bool isActive() const

Determine whether this diagnostic is still active.

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

SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)

Emit a diagnostic.

PartialDiagnostic PDiag(unsigned DiagID=0)

Build a partial diagnostic.

ASTContext & getASTContext() const

const LangOptions & getLangOpts() const

DiagnosticsEngine & getDiagnostics() const

SemaDiagnosticBuilder DiagIfHostCode(SourceLocation Loc, unsigned DiagID)

Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as host cod...

SemaDiagnosticBuilder DiagIfDeviceCode(SourceLocation Loc, unsigned DiagID)

Creates a SemaDiagnosticBuilder that emits the diagnostic if the current context is "used as device c...

Sema - This implements semantic analysis and AST building for C.

bool IsLastErrorImmediate

Is the last error level diagnostic immediate.

FunctionDecl * getCurFunctionDecl(bool AllowLambda=false) const

Returns a pointer to the innermost enclosing function, or nullptr if the current context is not insid...

SemaDiagnosticBuilder::DeferredDiagnosticsType DeviceDeferredDiags

Diagnostics that are emitted only if we discover that the given function must be codegen'ed.

const LangOptions & LangOpts

bool DeferDiags

Whether deferrable diagnostics should be deferred.

DiagnosticsEngine & Diags

void EmitDiagnostic(unsigned DiagID, const DiagnosticBuilder &DB)

Cause the built diagnostic to be emitted on the DiagosticsEngine.

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 ASTContext::SectionInfo &Section)

Insertion operator for diagnostics.