15 OS << VD->getNameAsString();
18 OS <<
"MaterializeTemporaryExpr at " << MTE;
20 if (
const auto *PVD = PB->getParmVarDecl())
21 OS <<
"$" << PVD->getNameAsString();
22 else if (PB->getImplicitThisParent())
24 else if (
const auto *FD = PB->getFieldDecl())
25 OS <<
"$this." << FD->getNameAsString();
28 OS <<
"NewAllocation at " << E;
30 OS <<
"HeapAllocation at " << E;
32 llvm_unreachable(
"unexpected allocation expression");
34 llvm_unreachable(
"access path base invalid");
35 for (
const auto &E : Elements)
40 OS <<
getID() <<
" (Path: ";
46LoanManager::getOrCreatePlaceholderBase(
const ParmVarDecl *PVD) {
47 llvm::FoldingSetNodeID ID;
49 llvm::FoldingSetInsertToken InsertToken;
50 if (
PlaceholderBase *Existing = PlaceholderBases.lookup(ID, InsertToken))
55 PlaceholderBases.insert(NewPB, InsertToken);
59const PlaceholderBase *
60LoanManager::getOrCreatePlaceholderBase(
const CXXMethodDecl *MD) {
61 llvm::FoldingSetNodeID ID;
63 llvm::FoldingSetInsertToken InsertToken;
64 if (PlaceholderBase *Existing = PlaceholderBases.lookup(ID, InsertToken))
67 void *Mem = LoanAllocator.Allocate<PlaceholderBase>();
68 PlaceholderBase *NewPB =
new (Mem) PlaceholderBase(MD);
69 PlaceholderBases.insert(NewPB, InsertToken);
73const PlaceholderBase *
74LoanManager::getOrCreatePlaceholderBase(
const FieldDecl *FD) {
75 llvm::FoldingSetNodeID ID;
77 llvm::FoldingSetInsertToken InsertToken;
78 if (PlaceholderBase *Existing = PlaceholderBases.lookup(ID, InsertToken))
81 void *Mem = LoanAllocator.Allocate<PlaceholderBase>();
82 PlaceholderBase *NewPB =
new (Mem) PlaceholderBase(FD);
83 PlaceholderBases.insert(NewPB, InsertToken);
Represents a static or instance method of a struct/union/class.
Represents a member of a struct/union/class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Represents a parameter to a function.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
const clang::ValueDecl * getAsValueDecl() const
const clang::MaterializeTemporaryExpr * getAsMaterializeTemporaryExpr() const
const PlaceholderBase * getAsPlaceholderBase() const
void dump(llvm::raw_ostream &OS) const
const clang::Expr * getAsAllocation() const
Returns the allocation expression that created this loan: a CXXNewExpr or an allocating CallExpr.
void dump(llvm::raw_ostream &OS) const
Represents the base of a placeholder access path, which is a function parameter, the implicit 'this' ...
static void Profile(llvm::FoldingSetNodeID &ID, KeyTy ParamMethodOrField)
bool isa(CodeGen::Address addr)