;
42 caseStmt::OpaqueValueExprClass:
43 if(
const Expr*SE = cast<OpaqueValueExpr>(
E)->getSourceExpr()) {
48 caseStmt::ExprWithCleanupsClass:
49 E= cast<ExprWithCleanups>(
E)->getSubExpr();
51 caseStmt::ConstantExprClass:
52 E= cast<ConstantExpr>(
E)->getSubExpr();
54 caseStmt::CXXBindTemporaryExprClass:
55 E= cast<CXXBindTemporaryExpr>(
E)->getSubExpr();
57 caseStmt::SubstNonTypeTemplateParmExprClass:
58 E= cast<SubstNonTypeTemplateParmExpr>(
E)->getReplacement();
69 if(
const auto*
E= dyn_cast<Expr>(S))
77L ? L->getStackFrame()
81 const SVal*
X= ExprBindings.lookup(
E);
92assert(!isa<ObjCForCollectionStmt>(S) &&
93 "Use ExprEngine::hasMoreIteration()!");
94assert((isa<Expr, ReturnStmt>(S)) &&
95 "Environment can only argue about Exprs, since only they express " 96 "a value! Any non-expression statement stored in Environment is a " 97 "result of a hack!");
100 switch(S->getStmtClass()) {
101 caseStmt::CXXBindTemporaryExprClass:
102 caseStmt::ExprWithCleanupsClass:
103 caseStmt::GenericSelectionExprClass:
104 caseStmt::ConstantExprClass:
105 caseStmt::ParenExprClass:
106 caseStmt::SubstNonTypeTemplateParmExprClass:
107llvm_unreachable(
"Should have been handled by ignoreTransparentExprs");
109 caseStmt::AddrLabelExprClass:
110 caseStmt::CharacterLiteralClass:
111 caseStmt::CXXBoolLiteralExprClass:
112 caseStmt::CXXScalarValueInitExprClass:
113 caseStmt::ImplicitValueInitExprClass:
114 caseStmt::IntegerLiteralClass:
115 caseStmt::ObjCBoolLiteralExprClass:
116 caseStmt::CXXNullPtrLiteralExprClass:
117 caseStmt::ObjCStringLiteralClass:
118 caseStmt::StringLiteralClass:
119 caseStmt::TypeTraitExprClass:
120 caseStmt::SizeOfPackExprClass:
121 caseStmt::PredefinedExprClass:
125 caseStmt::ReturnStmtClass: {
126 const auto*RS = cast<ReturnStmt>(S);
127 if(
const Expr*RE = RS->getRetValue())
142 if(
V.isUnknown()) {
157MarkLiveCallback(
SymbolReaper&symreaper) : SymReaper(symreaper) {}
159 boolVisitSymbol(
SymbolRefsym)
override{
160SymReaper.markLive(sym);
164 boolVisitMemRegion(
const MemRegion*R)
override{
165SymReaper.markLive(R);
188MarkLiveCallback CB(SymReaper);
191llvm::ImmutableMapRef<EnvironmentEntry, SVal>
192EBMapRef(NewEnv.ExprBindings.getRootWithoutRetain(),
198 SVal X= I.getData();
206EBMapRef = EBMapRef.add(BlkExpr,
X);
209RSScaner.
scan(
X);
213NewEnv.ExprBindings = EBMapRef.asImmutableMap();
219 unsigned intSpace,
boolIsDot)
const{
220Indent(Out, Space, IsDot) <<
"\"environment\": ";
222 if(ExprBindings.isEmpty()) {
223Out <<
"null,"<< NL;
231 for(
const auto&I : *
this) {
233 if(FoundContexts.count(LC) == 0) {
237FoundContexts.insert(LCI);
244Out <<
"{ \"pointer\": \""<< (
const void*)LCtx->
getStackFrame()
245<<
"\", \"items\": ["<< NL;
250 boolHasItem =
false;
251 unsigned intInnerSpace = Space + 1;
254BindingsTy::iterator LastI = ExprBindings.end();
255 for(BindingsTy::iterator I = ExprBindings.begin(); I != ExprBindings.end();
257 if(I->first.getLocationContext() != LC)
265 const Stmt*S = I->first.getStmt();
267assert(S !=
nullptr&&
"Expected non-null Stmt");
272 for(BindingsTy::iterator I = ExprBindings.begin(); I != ExprBindings.end();
274 if(I->first.getLocationContext() != LC)
277 const Stmt*S = I->first.getStmt();
278Indent(Out, InnerSpace, IsDot)
279<<
"{ \"stmt_id\": "<< S->getID(Ctx) <<
", \"kind\": \"" 280<< S->getStmtClassName() <<
"\", \"pretty\": ";
281S->printJson(Out,
nullptr, PP,
true);
283Out <<
", \"value\": ";
284I->second.printJson(Out,
true);
294Indent(Out, --InnerSpace, IsDot) <<
']';
299Indent(Out, --Space, IsDot) <<
"]},"<< NL;
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
static const Expr * ignoreTransparentExprs(const Expr *E)
Defines the clang::Expr interface and subclasses for C++ expressions.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
Defines the Objective-C statement AST node classes.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const clang::PrintingPolicy & getPrintingPolicy() const
This represents one expression.
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...
const LocationContext * getParent() const
It might return null.
const StackFrameContext * getStackFrame() const
void printJson(raw_ostream &Out, const char *NL="\n", unsigned int Space=0, bool IsDot=false, std::function< void(const LocationContext *)> printMoreInfoPerContext=[](const LocationContext *) {}) const
Prints out the call stack in json format.
It represents a stack frame of the call stack (based on CallEvent).
Stmt - This represents one statement.
StmtClass getStmtClass() const
An entry in the environment consists of a Stmt and an LocationContext.
const Stmt * getStmt() const
EnvironmentEntry(const Stmt *s, const LocationContext *L)
const LocationContext * getLocationContext() const
Environment getInitialEnvironment()
Environment bindExpr(Environment Env, const EnvironmentEntry &E, SVal V, bool Invalidate)
Bind a symbolic value to the given environment entry.
Environment removeDeadBindings(Environment Env, SymbolReaper &SymReaper, ProgramStateRef state)
An immutable map from EnvironemntEntries to SVals.
SVal getSVal(const EnvironmentEntry &E, SValBuilder &svalBuilder) const
Fetches the current binding of the expression in the Environment.
void printJson(raw_ostream &Out, const ASTContext &Ctx, const LocationContext *LCtx=nullptr, const char *NL="\n", unsigned int Space=0, bool IsDot=false) const
BindingsTy::iterator iterator
MemRegion - The root abstract class for all memory regions.
std::optional< SVal > getConstantVal(const Expr *E)
Returns the value of E, if it can be determined in a non-path-sensitive manner.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
A utility class that visits the reachable symbols using a custom SymbolVisitor.
bool scan(nonloc::LazyCompoundVal val)
A class responsible for cleaning up unused symbols.
bool isLive(SymbolRef sym)
The JSON file list parser is used to communicate input to InstallAPI.
Describes how types, statements, expressions, and declarations should be printed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4