17 OS <<
"Fact (Kind: " <<
static_cast<int>(K) <<
")\n";
38 OS <<
"OriginFlow (Dest: ";
48 OS <<
"OriginEscapes (";
57 OS <<
", " << (
isWritten() ?
"Write" :
"Read") <<
")\n";
62 OS <<
"TestPoint (Annotation: \"" <<
getAnnotation() <<
"\")\n";
66 llvm::StringMap<ProgramPoint> AnnotationToPointMap;
67 for (
const auto &BlockFacts : BlockToFacts) {
68 for (
const Fact *F : BlockFacts) {
70 StringRef PointName = TPF->getAnnotation();
71 assert(!AnnotationToPointMap.contains(PointName) &&
72 "more than one test points with the same name");
73 AnnotationToPointMap[PointName] = F;
77 return AnnotationToPointMap;
81 llvm::dbgs() <<
"==========================================\n";
82 llvm::dbgs() <<
" Lifetime Analysis Facts:\n";
83 llvm::dbgs() <<
"==========================================\n";
85 if (
const auto *ND = dyn_cast<NamedDecl>(D))
86 llvm::dbgs() <<
"Function: " << ND->getQualifiedNameAsString() <<
"\n";
89 llvm::dbgs() <<
" Block B" << B->getBlockID() <<
":\n";
92 F->dump(llvm::dbgs(), LoanMgr, OriginMgr);
94 llvm::dbgs() <<
" End of Block\n";
100 for (
const auto &BlockToFactsVec : BlockToFacts) {
101 for (
const Fact *F : BlockToFactsVec)
103 return BlockToFactsVec;
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
llvm::ArrayRef< const Fact * > getBlockContaining(ProgramPoint P) const
Retrieves all the facts in the block containing Program Point P.
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
OriginID getEscapedOriginID() const
void dump(llvm::raw_ostream &OS, const LoanManager &, const OriginManager &OM) const override
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
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
const Fact * ProgramPoint
A ProgramPoint identifies a location in the CFG by pointing to a specific Fact.
void dump(llvm::raw_ostream &OS) const