clang 23.0.0git
Loans.cpp
Go to the documentation of this file.
1//===- Loans.cpp - Loan Implementation --------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
12
13void AccessPath::dump(llvm::raw_ostream &OS) const {
14 switch (K) {
15 case Kind::ValueDecl:
16 if (const clang::ValueDecl *VD = getAsValueDecl())
17 OS << VD->getNameAsString();
18 break;
20 if (const clang::MaterializeTemporaryExpr *MTE =
22 OS << "MaterializeTemporaryExpr at " << MTE;
23 break;
25 if (const auto *PVD = getAsPlaceholderParam())
26 OS << "$" << PVD->getNameAsString();
27 break;
29 OS << "$this";
30 break;
31 }
32}
33
34void Loan::dump(llvm::raw_ostream &OS) const {
35 OS << getID() << " (Path: ";
36 Path.dump(OS);
37 OS << ")";
38}
39} // namespace clang::lifetimes::internal
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4921
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:712
const clang::ValueDecl * getAsValueDecl() const
Definition Loans.h:74
const clang::MaterializeTemporaryExpr * getAsMaterializeTemporaryExpr() const
Definition Loans.h:78
void dump(llvm::raw_ostream &OS) const
Definition Loans.cpp:13
const ParmVarDecl * getAsPlaceholderParam() const
Definition Loans.h:83
void dump(llvm::raw_ostream &OS) const
Definition Loans.cpp:34