;
28llvm_unreachable(
"Unhandled ProgramPoint kind");
57 const boolAddQuotes =
true;
59Out <<
"\"kind\": \"";
62Out <<
"BlockEntrance\"" 64<< castAs<BlockEntrance>().getBlock()->getBlockID();
68 autoFEP = getAs<FunctionExitPoint>();
69Out <<
"FunctionExit\"" 70<<
", \"block_id\": "<< FEP->getBlock()->getBlockID()
71<<
", \"stmt_id\": ";
74Out << RS->getID(Context) <<
", \"stmt\": ";
75RS->printJson(Out,
nullptr, PP, AddQuotes);
77Out <<
"null, \"stmt\": null";
82llvm_unreachable(
"BlockExitKind");
85Out <<
"CallEnter\", \"callee_decl\": \"";
87castAs<CallEnter>().getCalleeContext()->getDecl())
91Out <<
"CallExitBegin\"";
94Out <<
"CallExitEnd\"";
97Out <<
"EpsilonPoint\"";
101Out <<
"LoopExit\", \"stmt\": \"" 102<< castAs<LoopExit>().getLoopStmt()->getStmtClassName() <<
'\"';
107Out <<
"PreCall\", \"decl\": \"" 109<<
"\", \"location\": ";
116Out <<
"PostCall\", \"decl\": \"" 118<<
"\", \"location\": ";
124Out <<
"PostInitializer\", ";
127Out <<
"\"field_decl\": \""<< *FD <<
'\"';
129Out <<
"\"type\": \"";
140 const Stmt*
T=
E.getSrc()->getTerminatorStmt();
141Out <<
"Edge\", \"src_id\": "<<
E.getSrc()->getBlockID()
142<<
", \"dst_id\": "<<
E.getDst()->getBlockID() <<
", \"terminator\": ";
145Out <<
"null, \"term_kind\": null";
149 E.getSrc()->printTerminatorJson(Out, Context.
getLangOpts(),
151Out <<
", \"location\": ";
154Out <<
", \"term_kind\": \"";
155 if(isa<SwitchStmt>(
T)) {
156Out <<
"SwitchStmt\", \"case\": ";
157 if(
const Stmt*
Label=
E.getDst()->getLabel()) {
158 if(
const auto*
C= dyn_cast<CaseStmt>(
Label)) {
159Out <<
"{ \"lhs\": ";
160 if(
const Stmt*LHS =
C->getLHS()) {
161LHS->printJson(Out,
nullptr, PP, AddQuotes);
166Out <<
", \"rhs\": ";
167 if(
const Stmt*RHS =
C->getRHS()) {
168RHS->printJson(Out,
nullptr, PP, AddQuotes);
174assert(isa<DefaultStmt>(
Label));
175Out <<
"\"default\"";
178Out <<
"\"implicit default\"";
180}
else if(isa<IndirectGotoStmt>(
T)) {
182Out <<
"IndirectGotoStmt\"";
184Out <<
"Condition\", \"value\": " 185<< (*
E.getSrc()->succ_begin() ==
E.getDst() ?
"true":
"false");
191 const Stmt*S = castAs<StmtPoint>().getStmt();
192assert(S !=
nullptr&&
"Expecting non-null Stmt");
194Out <<
"Statement\", \"stmt_kind\": \""<< S->getStmtClassName()
195<<
"\", \"stmt_id\": "<< S->getID(Context)
196<<
", \"pointer\": \""<< (
const void*)S <<
"\", ";
197 if(
const auto*CS = dyn_cast<CastExpr>(S))
198Out <<
"\"cast_kind\": \""<< CS->getCastKindName() <<
"\", ";
200Out <<
"\"pretty\": ";
202S->printJson(Out,
nullptr, PP, AddQuotes);
204Out <<
", \"location\": ";
207Out <<
", \"stmt_point_kind\": \"";
208 if(getAs<PreLoad>())
210 else if(getAs<PreStore>())
212 else if(getAs<PostAllocatorCall>())
213Out <<
"PostAllocatorCall";
214 else if(getAs<PostCondition>())
215Out <<
"PostCondition";
216 else if(getAs<PostLoad>())
218 else if(getAs<PostLValue>())
219Out <<
"PostLValue";
220 else if(getAs<PostStore>())
222 else if(getAs<PostStmt>())
224 else if(getAs<PostStmtPurgeDeadSymbols>())
225Out <<
"PostStmtPurgeDeadSymbols";
226 else if(getAs<PreStmtPurgeDeadSymbols>())
227Out <<
"PreStmtPurgeDeadSymbols";
228 else if(getAs<PreStmt>())
231Out <<
"\nKind: '"<<
getKind();
232llvm_unreachable(
"' is unhandled StmtPoint kind!");
243: Desc((MsgProvider +
" : "+ Msg).str()) {}
Defines the clang::ASTContext interface.
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceManager & getSourceManager()
const LangOptions & getLangOpts() const
const clang::PrintingPolicy & getPrintingPolicy() const
static std::string getFunctionName(const Decl *D)
ASTContext & getASTContext() const
Represents a C++ base or member initializer.
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
Represents a member of a struct/union/class.
Represents an implicit call event.
SourceLocation getLocation() const
const Decl * getDecl() const
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...
LLVM_ATTRIBUTE_RETURNS_NONNULL AnalysisDeclContext * getAnalysisDeclContext() const
std::string getQualifiedNameAsString() const
Represents a point after we ran remove dead bindings AFTER processing the given statement.
Represents a point after we ran remove dead bindings BEFORE processing the given statement.
ProgramPoints can be "tagged" as representing points specific to a given analysis entity.
virtual ~ProgramPointTag()
static ProgramPoint getProgramPoint(const Stmt *S, ProgramPoint::Kind K, const LocationContext *LC, const ProgramPointTag *tag)
LLVM_DUMP_METHOD void dump() const
void printJson(llvm::raw_ostream &Out, const char *NL="\n") const
@ PreStmtPurgeDeadSymbolsKind
@ PostStmtPurgeDeadSymbolsKind
const LocationContext * getLocationContext() const
A (possibly-)qualified type.
QualType getLocalUnqualifiedType() const
Return this type with all of the instance-specific qualifiers removed, but without removing any quali...
void print(raw_ostream &OS, const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine(), unsigned Indentation=0) const
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
SimpleProgramPointTag(StringRef MsgProvider, StringRef Msg)
StringRef getTagDescription() const override
This class handles loading and caching of source files into memory.
Stmt - This represents one statement.
The JSON file list parser is used to communicate input to InstallAPI.
void printSourceLocationAsJson(raw_ostream &Out, SourceLocation Loc, const SourceManager &SM, bool AddBraces=true)
const FunctionProtoType * T
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