17 OS <<
"Fact (Kind: " <<
static_cast<int>(K) <<
")\n";
38 OS <<
"OriginFlow (Dest: ";
48 OS <<
"ReturnOfOrigin (";
57 OS <<
", " << (
isWritten() ?
"Write" :
"Read") <<
")\n";
62 OS <<
"TestPoint (Annotation: \"" <<
getAnnotation() <<
"\")\n";
66 llvm::StringMap<ProgramPoint> AnnotationToPointMap;
70 StringRef PointName = TPF->getAnnotation();
71 assert(AnnotationToPointMap.find(PointName) ==
72 AnnotationToPointMap.end() &&
73 "more than one test points with the same name");
74 AnnotationToPointMap[PointName] = F;
78 return AnnotationToPointMap;
82 llvm::dbgs() <<
"==========================================\n";
83 llvm::dbgs() <<
" Lifetime Analysis Facts:\n";
84 llvm::dbgs() <<
"==========================================\n";
86 if (
const auto *ND = dyn_cast<NamedDecl>(D))
87 llvm::dbgs() <<
"Function: " << ND->getQualifiedNameAsString() <<
"\n";
90 llvm::dbgs() <<
" Block B" << B->getBlockID() <<
":\n";
91 auto It = BlockToFactsMap.find(B);
92 if (It != BlockToFactsMap.end()) {
93 for (
const Fact *F : It->second) {
95 F->
dump(llvm::dbgs(), LoanMgr, OriginMgr);
98 llvm::dbgs() <<
" End of Block\n";
AnalysisDeclContext contains the context data for the function, method or block under analysis.
const Decl * getDecl() const
Represents a single basic block in a source-level CFG.
Represents a source-level, intra-procedural CFG that represents the control-flow of a Stmt.
Decl - This represents one declaration (or definition), e.g.
void dump(llvm::raw_ostream &OS, const LoanManager &LM, const OriginManager &) const override
llvm::ArrayRef< const Fact * > getFacts(const CFGBlock *B) const
llvm::StringMap< ProgramPoint > getTestPoints() const
Retrieves program points that were specially marked in the source code for testing.
void dump(const CFG &Cfg, AnalysisDeclContext &AC) const
An abstract base class for a single, atomic lifetime-relevant event.
virtual void dump(llvm::raw_ostream &OS, const LoanManager &, const OriginManager &) const
void dump(llvm::raw_ostream &OS, const LoanManager &LM, const OriginManager &OM) const override
OriginID getOriginID() const
Manages the creation, storage and retrieval of loans.
const Loan & getLoan(LoanID ID) const
void dump(llvm::raw_ostream &OS, const LoanManager &, const OriginManager &OM) const override
OriginID getSrcOriginID() const
OriginID getDestOriginID() const
Manages the creation, storage, and retrieval of origins for pointer-like variables and expressions.
void dump(OriginID OID, llvm::raw_ostream &OS) const
void dump(llvm::raw_ostream &OS, const LoanManager &, const OriginManager &OM) const override
OriginID getReturnedOriginID() const
A dummy-fact used to mark a specific point in the code for testing.
void dump(llvm::raw_ostream &OS, const LoanManager &, const OriginManager &) const override
StringRef getAnnotation() const
void dump(llvm::raw_ostream &OS, const LoanManager &, const OriginManager &OM) const override
OriginID getUsedOrigin(const OriginManager &OM) const
void dump(llvm::raw_ostream &OS) const