From 523640f7a4c0b038ce630939af161fdfa964dba4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Thu, 16 Feb 2023 08:22:26 +0100 Subject: [PATCH] [clang][Interp][NFC] Use qualified name in Function::getName() --- clang/lib/AST/Interp/Disasm.cpp | 9 +-------- clang/lib/AST/Interp/Function.h | 7 ++++++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/clang/lib/AST/Interp/Disasm.cpp b/clang/lib/AST/Interp/Disasm.cpp index 1c95782..7a5da90 100644 --- a/clang/lib/AST/Interp/Disasm.cpp +++ b/clang/lib/AST/Interp/Disasm.cpp @@ -34,14 +34,7 @@ template inline T ReadArg(Program &P, CodePtr &OpPC) { LLVM_DUMP_METHOD void Function::dump() const { dump(llvm::errs()); } LLVM_DUMP_METHOD void Function::dump(llvm::raw_ostream &OS) const { - if (F) { - if (const auto *MD = dyn_cast(F)) - OS << MD->getParent()->getDeclName() << "::"; - OS << F->getDeclName() << " " << (const void *)this << ":\n"; - } else { - OS << "<>\n"; - } - + OS << getName() << " " << (const void *)this << "\n"; OS << "frame size: " << getFrameSize() << "\n"; OS << "arg size: " << getArgSize() << "\n"; OS << "rvo: " << hasRVO() << "\n"; diff --git a/clang/lib/AST/Interp/Function.h b/clang/lib/AST/Interp/Function.h index 434c3f7b..1eb4fa9 100644 --- a/clang/lib/AST/Interp/Function.h +++ b/clang/lib/AST/Interp/Function.h @@ -90,7 +90,12 @@ public: /// Returns the name of the function decl this code /// was generated for. - const std::string getName() const { return F->getNameInfo().getAsString(); } + const std::string getName() const { + if (!F) + return "<>"; + + return F->getQualifiedNameAsString(); + } /// Returns the location. SourceLocation getLoc() const { return Loc; } -- 2.7.4