diff --git a/clang/lib/AST/Interp/Disasm.cpp b/clang/lib/AST/Interp/Disasm.cpp index 1c95782536fba4..7a5da90cd90025 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 434c3f7b0defdc..1eb4fa90d79430 100644 --- a/clang/lib/AST/Interp/Function.h +++ b/clang/lib/AST/Interp/Function.h @@ -90,7 +90,12 @@ class Function final { /// 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; }