clang 20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
clang::FunctionEffectDiff Struct Reference

#include "clang/Sema/Sema.h"

Public Types

enum class  Kind { Added , Removed , ConditionMismatch }
 
enum class  OverrideResult { NoAction , Warn , Merge }
 Describes the result of effects differing between a base class's virtual method and an overriding method in a subclass. More...
 

Public Member Functions

StringRef effectName () const
 
bool shouldDiagnoseConversion (QualType SrcType, const FunctionEffectsRef &SrcFX, QualType DstType, const FunctionEffectsRef &DstFX) const
 Return true if adding or removing the effect as part of a type conversion should generate a diagnostic.
 
bool shouldDiagnoseRedeclaration (const FunctionDecl &OldFunction, const FunctionEffectsRef &OldFX, const FunctionDecl &NewFunction, const FunctionEffectsRef &NewFX) const
 Return true if adding or removing the effect in a redeclaration should generate a diagnostic.
 
OverrideResult shouldDiagnoseMethodOverride (const CXXMethodDecl &OldMethod, const FunctionEffectsRef &OldFX, const CXXMethodDecl &NewMethod, const FunctionEffectsRef &NewFX) const
 Return true if adding or removing the effect in a C++ virtual method override should generate a diagnostic.
 

Public Attributes

FunctionEffect::Kind EffectKind
 
Kind DiffKind
 
FunctionEffectWithCondition Old
 
FunctionEffectWithCondition New
 

Detailed Description

Definition at line 442 of file Sema.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Added 
Removed 
ConditionMismatch 

Definition at line 443 of file Sema.h.

◆ OverrideResult

Describes the result of effects differing between a base class's virtual method and an overriding method in a subclass.

Enumerator
NoAction 
Warn 
Merge 

Definition at line 458 of file Sema.h.

Member Function Documentation

◆ effectName()

StringRef clang::FunctionEffectDiff::effectName ( ) const
inline

◆ shouldDiagnoseConversion()

bool FunctionEffectDiff::shouldDiagnoseConversion ( QualType  SrcType,
const FunctionEffectsRef SrcFX,
QualType  DstType,
const FunctionEffectsRef DstFX 
) const

Return true if adding or removing the effect as part of a type conversion should generate a diagnostic.

Definition at line 2839 of file Sema.cpp.

References clang::FunctionEffect::Allocating, clang::FunctionEffect::Blocking, clang::FunctionEffect::NonAllocating, clang::FunctionEffect::NonBlocking, and clang::FunctionEffect::None.

◆ shouldDiagnoseMethodOverride()

FunctionEffectDiff::OverrideResult FunctionEffectDiff::shouldDiagnoseMethodOverride ( const CXXMethodDecl OldMethod,
const FunctionEffectsRef OldFX,
const CXXMethodDecl NewMethod,
const FunctionEffectsRef NewFX 
) const

Return true if adding or removing the effect in a C++ virtual method override should generate a diagnostic.

Definition at line 2903 of file Sema.cpp.

References clang::FunctionEffect::Allocating, clang::FunctionEffect::Blocking, clang::FunctionEffect::NonAllocating, clang::FunctionEffect::NonBlocking, and clang::FunctionEffect::None.

◆ shouldDiagnoseRedeclaration()

bool FunctionEffectDiff::shouldDiagnoseRedeclaration ( const FunctionDecl OldFunction,
const FunctionEffectsRef OldFX,
const FunctionDecl NewFunction,
const FunctionEffectsRef NewFX 
) const

Return true if adding or removing the effect in a redeclaration should generate a diagnostic.

Definition at line 2877 of file Sema.cpp.

References clang::FunctionEffect::Allocating, clang::FunctionEffect::Blocking, clang::FunctionEffect::NonAllocating, clang::FunctionEffect::NonBlocking, and clang::FunctionEffect::None.

Member Data Documentation

◆ DiffKind

Kind clang::FunctionEffectDiff::DiffKind

Definition at line 446 of file Sema.h.

◆ EffectKind

FunctionEffect::Kind clang::FunctionEffectDiff::EffectKind

Definition at line 445 of file Sema.h.

◆ New

FunctionEffectWithCondition clang::FunctionEffectDiff::New

Definition at line 448 of file Sema.h.

Referenced by effectName().

◆ Old

FunctionEffectWithCondition clang::FunctionEffectDiff::Old

Definition at line 447 of file Sema.h.

Referenced by effectName().


The documentation for this struct was generated from the following files: