clang API Documentation
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/StmtCXX.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/Type.h"
#include "clang/Analysis/Analyses/Consumed.h"
#include "clang/Analysis/Analyses/PostOrderCFGView.h"
#include "clang/Analysis/AnalysisContext.h"
#include "clang/Analysis/CFG.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
Go to the source code of this file.
static SourceLocation getFirstStmtLoc | ( | const CFGBlock * | Block | ) | [static] |
Definition at line 57 of file Consumed.cpp.
Referenced by getLastStmtLoc().
static SourceLocation getLastStmtLoc | ( | const CFGBlock * | Block | ) | [static] |
Definition at line 72 of file Consumed.cpp.
References getFirstStmtLoc(), clang::CFGBlock::getTerminator(), clang::SourceLocation::isValid(), 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 clang::consumed::ConsumedStateMap::intersectAtLoopHead().
static ConsumedState invertConsumedUnconsumed | ( | ConsumedState | State | ) | [static] |
Definition at line 99 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_None, clang::consumed::CS_Unconsumed, and clang::consumed::CS_Unknown.
Referenced by clang::consumed::PropagationInfo::invertTest(), clang::consumed::splitVarStateForIf(), and clang::consumed::splitVarStateForIfBinOp().
static bool isAutoCastType | ( | const QualType & | QT | ) | [static] |
Definition at line 151 of file Consumed.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::Type::isPointerType(), and clang::Type::isReferenceType().
static bool isCallableInState | ( | const CallableWhenAttr * | CWAttr, |
ConsumedState | State | ||
) | [static] |
Definition at line 113 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_None, clang::consumed::CS_Unconsumed, clang::consumed::CS_Unknown, S, and Unknown.
Referenced by clang::consumed::ConsumedStmtVisitor::checkCallability().
static bool isConsumableType | ( | const QualType & | QT | ) | [static] |
Definition at line 141 of file Consumed.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::Type::isPointerType(), and clang::Type::isReferenceType().
Referenced by mapConsumableAttrState(), clang::consumed::ConsumedStmtVisitor::VisitCXXConstructExpr(), clang::consumed::ConsumedStmtVisitor::VisitParmVarDecl(), and clang::consumed::ConsumedStmtVisitor::VisitVarDecl().
static bool isKnownState | ( | ConsumedState | State | ) | [static] |
Definition at line 168 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_None, clang::consumed::CS_Unconsumed, and clang::consumed::CS_Unknown.
Referenced by clang::consumed::splitVarStateForIfBinOp().
static bool isPointerOrRef | ( | QualType | ParamType | ) | [static] |
Definition at line 188 of file Consumed.cpp.
References clang::Type::isPointerType(), and clang::Type::isReferenceType().
Referenced by clang::consumed::ConsumedStmtVisitor::handleCall().
static bool isRValueRef | ( | QualType | ParamType | ) | [static] |
Definition at line 180 of file Consumed.cpp.
References clang::Type::isRValueReferenceType().
Referenced by clang::consumed::ConsumedStmtVisitor::handleCall(), TryReferenceInitializationCore(), and clang::consumed::ConsumedStmtVisitor::VisitParmVarDecl().
static bool isSetOnReadPtrType | ( | const QualType & | QT | ) | [static] |
Definition at line 161 of file Consumed.cpp.
References clang::Type::getPointeeCXXRecordDecl().
Referenced by clang::consumed::ConsumedStmtVisitor::handleCall(), and clang::consumed::ConsumedStmtVisitor::VisitCXXConstructExpr().
static bool isTestingFunction | ( | const FunctionDecl * | FunDecl | ) | [static] |
Definition at line 184 of file Consumed.cpp.
References clang::Decl::hasAttr().
Referenced by clang::consumed::ConsumedStmtVisitor::handleCall(), and testsFor().
static ConsumedState mapConsumableAttrState | ( | const QualType | QT | ) | [static] |
Definition at line 192 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_Unconsumed, clang::consumed::CS_Unknown, clang::Type::getAsCXXRecordDecl(), clang::Decl::getAttr(), isConsumableType(), and Unknown.
Referenced by clang::consumed::ConsumedStmtVisitor::VisitCXXConstructExpr(), and clang::consumed::ConsumedStmtVisitor::VisitParmVarDecl().
static ConsumedState mapParamTypestateAttrState | ( | const ParamTypestateAttr * | PTAttr | ) | [static] |
Definition at line 210 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_Unconsumed, clang::consumed::CS_Unknown, and Unknown.
Referenced by clang::consumed::ConsumedStmtVisitor::handleCall(), and clang::consumed::ConsumedStmtVisitor::VisitParmVarDecl().
static ConsumedState mapReturnTypestateAttrState | ( | const ReturnTypestateAttr * | RTSAttr | ) | [static] |
Definition at line 223 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_Unconsumed, clang::consumed::CS_Unknown, and Unknown.
Referenced by clang::consumed::ConsumedStateMap::checkParamsForReturnTypestate(), clang::consumed::ConsumedStmtVisitor::handleCall(), and clang::consumed::ConsumedStmtVisitor::VisitCXXConstructExpr().
static ConsumedState mapSetTypestateAttrState | ( | const SetTypestateAttr * | STAttr | ) | [static] |
Definition at line 235 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_Unconsumed, clang::consumed::CS_Unknown, and Unknown.
Referenced by clang::consumed::ConsumedStmtVisitor::handleCall().
static StringRef stateToString | ( | ConsumedState | State | ) | [static] |
Definition at line 247 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_None, clang::consumed::CS_Unconsumed, and clang::consumed::CS_Unknown.
Referenced by clang::consumed::ConsumedStmtVisitor::checkCallability(), clang::consumed::ConsumedStateMap::checkParamsForReturnTypestate(), clang::consumed::ConsumedStmtVisitor::handleCall(), and clang::consumed::ConsumedStmtVisitor::VisitReturnStmt().
static ConsumedState testsFor | ( | const FunctionDecl * | FunDecl | ) | [static] |
Definition at line 264 of file Consumed.cpp.
References clang::consumed::CS_Consumed, clang::consumed::CS_Unconsumed, clang::Decl::getAttr(), and isTestingFunction().
Referenced by clang::consumed::ConsumedStmtVisitor::handleCall().