[PATCH] D142844: [LTO] Demangle the function name in DiagnosticInfoDontCall message

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 10:15:38 PST 2023


aeubanks added inline comments.


================
Comment at: llvm/lib/IR/DiagnosticInfo.cpp:444
 void DiagnosticInfoDontCall::print(DiagnosticPrinter &DP) const {
-  DP << "call to " << getFunctionName() << " marked \"dontcall-";
+  DP << "call to " << demangle(getFunctionName().str())
+     << " marked \"dontcall-";
----------------
aeubanks wrote:
> nickdesaulniers wrote:
> > `demangle` returns a `std::string`. Is getting the C string necessary for printing?
> I'll fix this while landing
actually it is necessary. the `str()` is getting passed to `demangle`, it's not called on the result of `demangle()`

`demangle()` should really take a `StringRef` instead of a `const std::string&`, but that can be fixed separately


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142844/new/

https://reviews.llvm.org/D142844



More information about the llvm-commits mailing list