clang 20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
clang::Sema::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
 
std::optional< FunctionEffectWithConditionOld
 
std::optional< FunctionEffectWithConditionNew
 

Detailed Description

Definition at line 15077 of file Sema.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Added 
Removed 
ConditionMismatch 

Definition at line 15078 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 15095 of file Sema.h.

Member Function Documentation

◆ effectName()

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

Definition at line 15087 of file Sema.h.

◆ shouldDiagnoseConversion()

bool clang::Sema::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 1550 of file SemaFunctionEffects.cpp.

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

◆ shouldDiagnoseMethodOverride()

Sema::FunctionEffectDiff::OverrideResult clang::Sema::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 1612 of file SemaFunctionEffects.cpp.

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

◆ shouldDiagnoseRedeclaration()

bool clang::Sema::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 1587 of file SemaFunctionEffects.cpp.

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

Member Data Documentation

◆ DiffKind

Kind clang::Sema::FunctionEffectDiff::DiffKind

Definition at line 15081 of file Sema.h.

◆ EffectKind

FunctionEffect::Kind clang::Sema::FunctionEffectDiff::EffectKind

Definition at line 15080 of file Sema.h.

◆ New

std::optional<FunctionEffectWithCondition> clang::Sema::FunctionEffectDiff::New

Definition at line 15085 of file Sema.h.

◆ Old

std::optional<FunctionEffectWithCondition> clang::Sema::FunctionEffectDiff::Old

Definition at line 15083 of file Sema.h.


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