================
@@ -12,7 +12,16 @@ namespace clang::lifetimes::internal {
void PathLoan::dump(llvm::raw_ostream &OS) const {
OS << getID() << " (Path: ";
- OS << Path.D->getNameAsString() << ")";
+ if (const clang::ValueDecl *VD = Path.getAsValueDecl()) {
+ OS << VD->getNameAsString();
+ } else if (const clang::MaterializeTemporaryExpr *MTE =
+ Path.getAsMaterializeTemporaryExpr()) {
+ // No nice "name" for the temporary, so deferring to LLVM default
+ OS << "MaterializeTemporaryExpr at " << MTE;
+ } else {
+ llvm_unreachable("access path is not one of any supported types");
+ }
+ OS << ")";
----------------
usx95 wrote:
nit: remove the `{}` for single-stmt bodies
https://github.com/llvm/llvm-project/pull/172007
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits