clang 22.0.0git
LiveVariables.cpp File Reference
#include "clang/Analysis/Analyses/LiveVariables.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Analysis/AnalysisDeclContext.h"
#include "clang/Analysis/CFG.h"
#include "clang/Analysis/FlowSensitive/DataflowWorklist.h"
#include "clang/Basic/SourceManager.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <optional>
#include <vector>

Go to the source code of this file.

Functions

static LiveVariablesImpl & getImpl (void *x)
static bool isAlwaysAlive (const VarDecl *D)
static const VariableArrayTypeFindVA (QualType Ty)
static const ExprLookThroughExpr (const Expr *E)
static void AddLiveExpr (llvm::ImmutableSet< const Expr * > &Set, llvm::ImmutableSet< const Expr * >::Factory &F, const Expr *E)
static void AddAllConditionalTerms (llvm::ImmutableSet< const Expr * > &Set, llvm::ImmutableSet< const Expr * >::Factory &F, const Expr *Cond)
 Add as a live expression all individual conditions in a logical expression.
static bool writeShouldKill (const VarDecl *VD)

Function Documentation

◆ AddAllConditionalTerms()

void AddAllConditionalTerms ( llvm::ImmutableSet< const Expr * > & Set,
llvm::ImmutableSet< const Expr * >::Factory & F,
const Expr * Cond )
static

Add as a live expression all individual conditions in a logical expression.

For example, for the expression: "(a < b) || (c && d && ((e || f) != (g && h)))" the following expressions will be added as live: "a < b", "c", "d", "((e || f) != (g && h))"

Definition at line 226 of file LiveVariables.cpp.

References AddAllConditionalTerms(), AddLiveExpr(), clang::Cond, and clang::Set.

Referenced by AddAllConditionalTerms().

◆ AddLiveExpr()

void AddLiveExpr ( llvm::ImmutableSet< const Expr * > & Set,
llvm::ImmutableSet< const Expr * >::Factory & F,
const Expr * E )
static

Definition at line 215 of file LiveVariables.cpp.

References LookThroughExpr(), and clang::Set.

Referenced by AddAllConditionalTerms().

◆ FindVA()

const VariableArrayType * FindVA ( QualType Ty)
static

Definition at line 185 of file LiveVariables.cpp.

References clang::QualType::getTypePtr().

◆ getImpl()

◆ isAlwaysAlive()

bool isAlwaysAlive ( const VarDecl * D)
static

◆ LookThroughExpr()

const Expr * LookThroughExpr ( const Expr * E)
static

Definition at line 198 of file LiveVariables.cpp.

References clang::Expr::IgnoreParens().

Referenced by AddLiveExpr().

◆ writeShouldKill()

bool writeShouldKill ( const VarDecl * VD)
static