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 PathLoan::dump(llvm::raw_ostream &OS) const {
14 OS << getID() << " (Path: ";
15 if (const clang::ValueDecl *VD = Path.getAsValueDecl())
16 OS << VD->getNameAsString();
17 else if (const clang::MaterializeTemporaryExpr *MTE =
18 Path.getAsMaterializeTemporaryExpr())
19 // No nice "name" for the temporary, so deferring to LLVM default
20 OS << "MaterializeTemporaryExpr at " << MTE;
21 else
22 llvm_unreachable("access path is not one of any supported types");
23 OS << ")";
24}
25
26void PlaceholderLoan::dump(llvm::raw_ostream &OS) const {
27 OS << getID() << " (Placeholder loan)";
28}
29
30} // namespace clang::lifetimes::internal
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4920
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:712
void dump(llvm::raw_ostream &OS) const override
Definition Loans.cpp:13
void dump(llvm::raw_ostream &OS) const override
Definition Loans.cpp:26