clang 20.0.0git
Classes | Namespaces | Enumerations | Functions
Consumed.cpp File Reference
#include "clang/Analysis/Analyses/Consumed.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/Type.h"
#include "clang/Analysis/Analyses/PostOrderCFGView.h"
#include "clang/Analysis/AnalysisDeclContext.h"
#include "clang/Analysis/CFG.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <memory>
#include <optional>
#include <utility>

Go to the source code of this file.

Classes

class  clang::consumed::PropagationInfo
 
class  clang::consumed::ConsumedStmtVisitor
 

Namespaces

namespace  clang
 The JSON file list parser is used to communicate input to InstallAPI.
 
namespace  clang::consumed
 

Enumerations

enum  clang::consumed::EffectiveOp { clang::consumed::EO_And , clang::consumed::EO_Or }
 

Functions

static SourceLocation getFirstStmtLoc (const CFGBlock *Block)
 
static SourceLocation getLastStmtLoc (const CFGBlock *Block)
 
static ConsumedState invertConsumedUnconsumed (ConsumedState State)
 
static bool isCallableInState (const CallableWhenAttr *CWAttr, ConsumedState State)
 
static bool isConsumableType (const QualType &QT)
 
static bool isAutoCastType (const QualType &QT)
 
static bool isSetOnReadPtrType (const QualType &QT)
 
static bool isKnownState (ConsumedState State)
 
static bool isRValueRef (QualType ParamType)
 
static bool isTestingFunction (const FunctionDecl *FunDecl)
 
static ConsumedState mapConsumableAttrState (const QualType QT)
 
static ConsumedState mapParamTypestateAttrState (const ParamTypestateAttr *PTAttr)
 
static ConsumedState mapReturnTypestateAttrState (const ReturnTypestateAttr *RTSAttr)
 
static ConsumedState mapSetTypestateAttrState (const SetTypestateAttr *STAttr)
 
static StringRef stateToString (ConsumedState State)
 
static ConsumedState testsFor (const FunctionDecl *FunDecl)
 
static void setStateForVarOrTmp (ConsumedStateMap *StateMap, const PropagationInfo &PInfo, ConsumedState State)
 
static void splitVarStateForIf (const IfStmt *IfNode, const VarTestResult &Test, ConsumedStateMap *ThenStates, ConsumedStateMap *ElseStates)
 
static void splitVarStateForIfBinOp (const PropagationInfo &PInfo, ConsumedStateMap *ThenStates, ConsumedStateMap *ElseStates)
 

Function Documentation

◆ getFirstStmtLoc()

static SourceLocation getFirstStmtLoc ( const CFGBlock Block)
static

◆ getLastStmtLoc()

static SourceLocation getLastStmtLoc ( const CFGBlock Block)
static

◆ invertConsumedUnconsumed()

static ConsumedState invertConsumedUnconsumed ( ConsumedState  State)
static

◆ isAutoCastType()

static bool isAutoCastType ( const QualType QT)
static

◆ isCallableInState()

static bool isCallableInState ( const CallableWhenAttr *  CWAttr,
ConsumedState  State 
)
static

◆ isConsumableType()

static bool isConsumableType ( const QualType QT)
static

◆ isKnownState()

static bool isKnownState ( ConsumedState  State)
static

◆ isRValueRef()

static bool isRValueRef ( QualType  ParamType)
static

◆ isSetOnReadPtrType()

static bool isSetOnReadPtrType ( const QualType QT)
static

◆ isTestingFunction()

static bool isTestingFunction ( const FunctionDecl FunDecl)
static

Definition at line 185 of file Consumed.cpp.

References clang::Decl::hasAttr().

Referenced by clang::consumed::ConsumedStmtVisitor::handleCall(), and testsFor().

◆ mapConsumableAttrState()

static ConsumedState mapConsumableAttrState ( const QualType  QT)
static

◆ mapParamTypestateAttrState()

static ConsumedState mapParamTypestateAttrState ( const ParamTypestateAttr *  PTAttr)
static

◆ mapReturnTypestateAttrState()

static ConsumedState mapReturnTypestateAttrState ( const ReturnTypestateAttr *  RTSAttr)
static

◆ mapSetTypestateAttrState()

static ConsumedState mapSetTypestateAttrState ( const SetTypestateAttr *  STAttr)
static

◆ setStateForVarOrTmp()

static void setStateForVarOrTmp ( ConsumedStateMap StateMap,
const PropagationInfo PInfo,
ConsumedState  State 
)
static

◆ splitVarStateForIf()

static void splitVarStateForIf ( const IfStmt IfNode,
const VarTestResult &  Test,
ConsumedStateMap ThenStates,
ConsumedStateMap ElseStates 
)
static

◆ splitVarStateForIfBinOp()

static void splitVarStateForIfBinOp ( const PropagationInfo PInfo,
ConsumedStateMap ThenStates,
ConsumedStateMap ElseStates 
)
static

◆ stateToString()

static StringRef stateToString ( ConsumedState  State)
static

◆ testsFor()

static ConsumedState testsFor ( const FunctionDecl FunDecl)
static