clang
23.0.0git
lib
Analysis
LifetimeSafety
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
9
#include "
clang/Analysis/Analyses/LifetimeSafety/Loans.h
"
10
11
namespace
clang::lifetimes::internal
{
12
13
void
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
26
void
PlaceholderLoan::dump
(llvm::raw_ostream &OS)
const
{
27
OS <<
getID
() <<
" (Placeholder loan)"
;
28
}
29
30
}
// namespace clang::lifetimes::internal
Loans.h
clang::MaterializeTemporaryExpr
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition
ExprCXX.h:4920
clang::ValueDecl
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition
Decl.h:712
clang::lifetimes::internal::Loan::getID
LoanID getID() const
Definition
Loans.h:76
clang::lifetimes::internal::PathLoan::dump
void dump(llvm::raw_ostream &OS) const override
Definition
Loans.cpp:13
clang::lifetimes::internal::PlaceholderLoan::dump
void dump(llvm::raw_ostream &OS) const override
Definition
Loans.cpp:26
clang::lifetimes::internal
Definition
Checker.h:23
Generated on
for clang by
1.14.0