#include #include #include ">

clang: lib/Analysis/Consumed.cpp File Reference (original) (raw)

#include "[clang/Analysis/Analyses/Consumed.h](Consumed%5F8h%5Fsource.html)"
#include "[clang/AST/Attr.h](AST%5F2Attr%5F8h%5Fsource.html)"
#include "[clang/AST/Decl.h](Decl%5F8h%5Fsource.html)"
#include "[clang/AST/DeclCXX.h](DeclCXX%5F8h%5Fsource.html)"
#include "[clang/AST/Expr.h](Expr%5F8h%5Fsource.html)"
#include "[clang/AST/ExprCXX.h](ExprCXX%5F8h%5Fsource.html)"
#include "[clang/AST/Stmt.h](Stmt%5F8h%5Fsource.html)"
#include "[clang/AST/StmtVisitor.h](StmtVisitor%5F8h%5Fsource.html)"
#include "[clang/AST/Type.h](Type%5F8h%5Fsource.html)"
#include "[clang/Analysis/Analyses/PostOrderCFGView.h](PostOrderCFGView%5F8h%5Fsource.html)"
#include "[clang/Analysis/AnalysisDeclContext.h](AnalysisDeclContext%5F8h%5Fsource.html)"
#include "[clang/Analysis/CFG.h](CFG%5F8h%5Fsource.html)"
#include "[clang/Basic/LLVM.h](LLVM%5F8h%5Fsource.html)"
#include "[clang/Basic/OperatorKinds.h](OperatorKinds%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"
#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.

Namespaces
namespace clang
The JSON file list parser is used to communicate input to InstallAPI.
namespace clang::consumed
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)

getFirstStmtLoc()

getLastStmtLoc()

Definition at line 76 of file Consumed.cpp.

References Block, getFirstStmtLoc(), getLastStmtLoc(), clang::CFGBlock::getTerminatorStmt(), clang::SourceLocation::isValid(), Loc, clang::CFGBlock::pred_begin(), clang::CFGBlock::pred_size(), clang::CFGBlock::rbegin(), clang::CFGBlock::rend(), clang::CFGBlock::succ_begin(), and clang::CFGBlock::succ_size().

Referenced by getLastStmtLoc(), and clang::consumed::ConsumedStateMap::intersectAtLoopHead().

invertConsumedUnconsumed()

isAutoCastType()

isCallableInState()

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

isConsumableType()

isKnownState()

isRValueRef()

isSetOnReadPtrType()

static bool isSetOnReadPtrType ( const QualType & QT) static

isTestingFunction()

mapConsumableAttrState()

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()

splitVarStateForIf()

splitVarStateForIfBinOp()

Definition at line 946 of file Consumed.cpp.

References clang::consumed::CS_None, clang::consumed::CS_Unknown, clang::consumed::EO_And, clang::consumed::PropagationInfo::getLTest(), clang::consumed::PropagationInfo::getRTest(), clang::consumed::ConsumedStateMap::getState(), invertConsumedUnconsumed(), isKnownState(), clang::consumed::ConsumedStateMap::markUnreachable(), clang::consumed::ConsumedStateMap::setState(), and clang::consumed::PropagationInfo::testEffectiveOp().

stateToString()

testsFor()