17 using namespace clang;
26 llvm_unreachable(
"Unhandled ProgramPoint kind");
47 return print(
"\n", llvm::errs());
62 getLocationContext()->getAnalysisDeclContext()->getASTContext();
66 Out <<
"Block Entrance: B" 67 << castAs<BlockEntrance>().getBlock()->getBlockID();
71 auto FEP = getAs<FunctionExitPoint>();
72 Out <<
"Function Exit: B" << FEP->getBlock()->getBlockID();
74 Out << CR <<
" Return: S" << RS->getID(Context) << CR;
89 Out <<
"CallExitBegin";
97 Out <<
"PostStmtPurgeDeadSymbols";
101 Out <<
"PreStmtPurgeDeadSymbols";
105 Out <<
"Epsilon Point";
131 Out <<
"PostInitializer: ";
144 const BlockEdge &E = castAs<BlockEdge>();
151 Out <<
"\\|Terminator: ";
155 if (isa<SwitchStmt>(T)) {
159 if (
const auto *
C = dyn_cast<CaseStmt>(Label)) {
160 Out << CR <<
"case ";
162 C->getLHS()->printPretty(
166 if (
const Stmt *RHS =
C->getRHS()) {
174 assert(isa<DefaultStmt>(Label));
175 Out << CR <<
"default:";
178 Out << CR <<
"(implicit) default:";
179 }
else if (isa<IndirectGotoStmt>(T)) {
182 Out << CR <<
"Condition: ";
196 const Stmt *S = castAs<StmtPoint>().getStmt();
197 assert(S !=
nullptr &&
"Expecting non-null Stmt");
200 << (
const void *)S <<
"> ";
205 if (getAs<PreStmt>())
206 Out << CR <<
"PreStmt" << CR;
207 else if (getAs<PostLoad>())
208 Out << CR <<
"PostLoad" << CR;
209 else if (getAs<PostStore>())
210 Out << CR <<
"PostStore" << CR;
211 else if (getAs<PostLValue>())
212 Out << CR <<
"PostLValue" << CR;
213 else if (getAs<PostAllocatorCall>())
214 Out << CR <<
"PostAllocatorCall" << CR;
223 : Desc((MsgProvider +
" : " + Msg).
str()) {}
A (possibly-)qualified type.
succ_iterator succ_begin()
Stmt - This represents one statement.
unsigned getBlockID() const
const CFGBlock * getSrc() const
Represents a point after we ran remove dead bindings BEFORE processing the given statement.
Represents a point when we exit a loop.
Represents an implicit call event.
QualType getLocalUnqualifiedType() const
Return this type with all of the instance-specific qualifiers removed, but without removing any quali...
const char * getStmtClassName() const
static ProgramPoint getProgramPoint(const Stmt *S, ProgramPoint::Kind K, const LocationContext *LC, const ProgramPointTag *tag)
void print(raw_ostream &Out, unsigned Indentation=0, bool PrintInstantiation=false) const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
SourceLocation getBeginLoc() const LLVM_READONLY
Represents a member of a struct/union/class.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
void printTerminator(raw_ostream &OS, const LangOptions &LO) const
printTerminator - A simple pretty printer of the terminator of a CFGBlock.
LLVM_DUMP_METHOD void dump() const
SimpleProgramPointTag(StringRef MsgProvider, StringRef Msg)
SourceLocation getLocation() const
void print(raw_ostream &OS, const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine(), unsigned Indentation=0) const
StringRef getTagDescription() const override
const clang::PrintingPolicy & getPrintingPolicy() const
Represents a point after we ran remove dead bindings AFTER processing the given statement.
FieldDecl * getAnyMember() const
void print(StringRef CR, llvm::raw_ostream &Out) const
static void printLocation(raw_ostream &Out, SourceLocation SLoc, const SourceManager &SM, StringRef CR, StringRef Postfix)
const CFGBlock * getDst() const
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
CFGTerminator getTerminator()
const Stmt * getLoopStmt() const
Encodes a location in the source.
ProgramPoints can be "tagged" as representing points specific to a given analysis entity...
int64_t getID(const ASTContext &Context) const
const Decl * getDecl() const
unsigned getExpansionColumnNumber(SourceLocation Loc, bool *Invalid=nullptr) const
Dataflow Directional Tag Classes.
Represents a C++ base or member initializer.
SourceManager & getSourceManager()
void printPretty(raw_ostream &OS, PrinterHelper *Helper, const PrintingPolicy &Policy, unsigned Indentation=0, StringRef NewlineSymbol="\, const ASTContext *Context=nullptr) const
static Decl::Kind getKind(const Decl *D)
virtual ~ProgramPointTag()
const LangOptions & getLangOpts() const
This class handles loading and caching of source files into memory.
QualType getType() const
Return the type wrapped by this type source info.