15 #ifndef LLVM_CLANG_ANALYSIS_ANALYSES_UNINITIALIZEDVALUES_H
16 #define LLVM_CLANG_ANALYSIS_ANALYSES_UNINITIALIZEDVALUES_H
19 #include "llvm/ADT/SmallVector.h"
23 class AnalysisDeclContext;
56 : User(User), UninitAfterCall(
false), UninitAfterDecl(
false),
57 AlwaysUninit(AlwaysUninit) {}
60 UninitBranches.push_back(B);
87 return AlwaysUninit ?
Always :
virtual ~UninitVariablesHandler()
The use is uninitialized whenever a certain branch is taken.
branch_iterator branch_begin() const
Branches which inevitably result in the variable being used uninitialized.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
The use might be uninitialized.
void setUninitAfterCall()
AnalysisDeclContext contains the context data for the function or method under analysis.
SmallVectorImpl< Branch >::const_iterator branch_iterator
bool branch_empty() const
Kind
The kind of uninitialized use.
const Expr * getUser() const
Get the expression containing the uninitialized use.
Expr - This represents one expression.
CFG - Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt...
virtual void handleSelfInit(const VarDecl *vd)
Called when the uninitialized variable analysis detects the idiom 'int x = x'.
void runUninitializedVariablesAnalysis(const DeclContext &dc, const CFG &cfg, AnalysisDeclContext &ac, UninitVariablesHandler &handler, UninitVariablesAnalysisStats &stats)
UninitUse(const Expr *User, bool AlwaysUninit)
A use of a variable, which might be uninitialized.
virtual void handleUseOfUninitVariable(const VarDecl *vd, const UninitUse &use)
Called when the uninitialized variable is used at the given expression.
The use is uninitialized the first time it is reached after we reach the variable's declaration...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
void setUninitAfterDecl()
Kind getKind() const
Get the kind of uninitialized use.
The use is always uninitialized.
The use is uninitialized the first time it is reached after the function is called.
unsigned NumVariablesAnalyzed
void addUninitBranch(Branch B)
branch_iterator branch_end() const