20#ifndef LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_H
21#define LLVM_CLANG_ANALYSIS_ANALYSES_LIFETIMESAFETY_H
65 const Expr *ReturnExpr,
76 const Expr *EscapeExpr) {}
80 const Expr *EscapeExpr) {}
88 const Expr *EscapeExpr) {}
97 LifetimeSafetySemaHelper *SemaHelper,
98 LifetimeSafetyStats &Stats,
bool CollectStats);
103 LifetimeSafetyStats &Stats);
124 return *LoanPropagation;
133 std::unique_ptr<FactManager> FactMgr;
134 std::unique_ptr<LiveOriginsAnalysis> LiveOrigins;
135 std::unique_ptr<LoanPropagationAnalysis> LoanPropagation;
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
AnalysisDeclContext contains the context data for the function, method or block under analysis.
Represents a static or instance method of a struct/union/class.
This represents one expression.
Represents a member of a struct/union/class.
Represents a parameter to a function.
Scope - A scope is a transient data structure that is used while parsing the program.
Encodes a location in the source.
Abstract interface for operations requiring Sema access.
virtual void reportUseAfterFree(const Expr *IssueExpr, const Expr *UseExpr, SourceLocation FreeLoc, Confidence Confidence)
virtual void suggestLifetimeboundToImplicitThis(SuggestionScope Scope, const CXXMethodDecl *MD, const Expr *EscapeExpr)
virtual void reportDanglingField(const Expr *IssueExpr, const FieldDecl *Field, SourceLocation ExpiryLoc)
virtual void reportNoescapeViolation(const ParmVarDecl *ParmWithNoescape, const FieldDecl *EscapeField)
virtual void suggestLifetimeboundToParmVar(SuggestionScope Scope, const ParmVarDecl *ParmToAnnotate, const Expr *EscapeExpr)
virtual void reportUseAfterReturn(const Expr *IssueExpr, const Expr *ReturnExpr, SourceLocation ExpiryLoc, Confidence Confidence)
virtual void addLifetimeBoundToImplicitThis(const CXXMethodDecl *MD)
virtual void reportNoescapeViolation(const ParmVarDecl *ParmWithNoescape, const Expr *EscapeExpr)
virtual ~LifetimeSafetySemaHelper()=default
LifetimeSafetySemaHelper()=default
FactManager & getFactManager()
LifetimeSafetyAnalysis(AnalysisDeclContext &AC, LifetimeSafetySemaHelper *SemaHelper)
LoanPropagationAnalysis & getLoanPropagation() const
LiveOriginsAnalysis & getLiveOrigins() const
void collectLifetimeStats(AnalysisDeclContext &AC, OriginManager &OM, LifetimeSafetyStats &Stats)
SuggestionScope
Enum to track functions visible across or within TU.
Confidence
Enum to track the confidence level of a potential error.
void runLifetimeSafetyAnalysis(AnalysisDeclContext &AC, LifetimeSafetySemaHelper *SemaHelper, LifetimeSafetyStats &Stats, bool CollectStats)
The main entry point for the analysis.
An object to hold the factories for immutable collections, ensuring that all created states share the...
LivenessMap::Factory LivenessMapFactory
OriginLoanMap::Factory OriginMapFactory
LoanSet::Factory LoanSetFactory