clang 20.0.0git
|
#include "clang/Analysis/Analyses/UninitializedValues.h"
#include "clang/AST/Attr.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/Expr.h"
#include "clang/AST/OperationKinds.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtObjC.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/Analysis/DomainSpecific/ObjCNoReturn.h"
#include "clang/Analysis/FlowSensitive/DataflowWorklist.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PackedVector.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Casting.h"
#include <algorithm>
#include <cassert>
#include <optional>
Go to the source code of this file.
Macros | |
#define | DEBUG_LOGGING 0 |
Enumerations | |
enum | Value { Unknown = 0x0 , Initialized = 0x1 , Uninitialized = 0x2 , MayUninitialized = 0x3 } |
Functions | |
static bool | recordIsNotEmpty (const RecordDecl *RD) |
static bool | isTrackedVar (const VarDecl *vd, const DeclContext *dc) |
static bool | isUninitialized (const Value v) |
static bool | isAlwaysUninit (const Value v) |
static const Expr * | stripCasts (ASTContext &C, const Expr *Ex) |
static FindVarResult | findVar (const Expr *E, const DeclContext *DC) |
If E is an expression comprising a reference to a single variable, find that variable. | |
static const DeclRefExpr * | getSelfInitExpr (VarDecl *VD) |
static bool | isPointerToConst (const QualType &QT) |
static bool | hasTrivialBody (CallExpr *CE) |
static bool | runOnBlock (const CFGBlock *block, const CFG &cfg, AnalysisDeclContext &ac, CFGBlockValues &vals, const ClassifyRefs &classification, llvm::BitVector &wasAnalyzed, UninitVariablesHandler &handler) |
#define DEBUG_LOGGING 0 |
Definition at line 41 of file UninitializedValues.cpp.
enum Value |
Enumerator | |
---|---|
Unknown | |
Initialized | |
Uninitialized | |
MayUninitialized |
Definition at line 120 of file UninitializedValues.cpp.
|
static |
If E is an expression comprising a reference to a single variable, find that variable.
Definition at line 266 of file UninitializedValues.cpp.
References E, clang::DeclContext::getParentASTContext(), isTrackedVar(), and stripCasts().
|
static |
Definition at line 328 of file UninitializedValues.cpp.
References clang::Decl::getASTContext(), clang::DeclRefExpr::getDecl(), clang::VarDecl::getInit(), clang::ValueDecl::getType(), clang::Init, clang::Type::isRecordType(), and stripCasts().
Definition at line 423 of file UninitializedValues.cpp.
References clang::CallExpr::getDirectCallee().
Definition at line 129 of file UninitializedValues.cpp.
References Uninitialized, and v.
Definition at line 419 of file UninitializedValues.cpp.
References clang::Type::getPointeeType(), clang::Type::isAnyPointerType(), and clang::QualType::isConstQualified().
Referenced by findPtrToConstParams().
|
static |
Definition at line 60 of file UninitializedValues.cpp.
References clang::Type::getAsRecordDecl(), clang::Decl::getDeclContext(), clang::ValueDecl::getType(), clang::VarDecl::hasGlobalStorage(), clang::VarDecl::isExceptionVariable(), clang::Decl::isImplicit(), clang::VarDecl::isInitCapture(), clang::VarDecl::isLocalVarDecl(), clang::Type::isRVVSizelessBuiltinType(), clang::Type::isScalarType(), clang::Type::isVectorType(), and recordIsNotEmpty().
Referenced by findVar().
Definition at line 125 of file UninitializedValues.cpp.
References Uninitialized, and v.
|
static |
Definition at line 43 of file UninitializedValues.cpp.
References clang::RecordDecl::fields(), and recordIsNotEmpty().
Referenced by isTrackedVar(), and recordIsNotEmpty().
|
static |
Definition at line 836 of file UninitializedValues.cpp.
References E, clang::CFGBlock::getBlockID(), clang::CFGTerminator::getStmt(), clang::CFGBlock::getTerminator(), clang::GCCAsmStmt::isAsmGoto(), clang::CFGBlock::pred_begin(), and clang::CFGBlock::pred_end().
Referenced by clang::runUninitializedVariablesAnalysis().
|
static |
Definition at line 250 of file UninitializedValues.cpp.
References clang::C, and clang::Expr::IgnoreParenNoopCasts().
Referenced by findVar(), and getSelfInitExpr().