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