aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorNick Desaulniers <ndesaulniers@google.com>2023-05-02 11:10:43 -0700
committerNick Desaulniers <ndesaulniers@google.com>2023-05-02 11:20:15 -0700
commitc117c2c8ba4afd45a006043ec6dd858652b2ffcc (patch)
treeeaf2bca8cf17d405cadb6ad2d34bf7c20b9912db /clang/lib/CodeGen/CodeGenAction.cpp
parent1f74964b403c615c121c0adbd06661adaae14667 (diff)
downloadllvm-c117c2c8ba4afd45a006043ec6dd858652b2ffcc.zip
llvm-c117c2c8ba4afd45a006043ec6dd858652b2ffcc.tar.gz
llvm-c117c2c8ba4afd45a006043ec6dd858652b2ffcc.tar.bz2
[Demangle] make llvm::demangle take std::string_view rather than const std::string&
As suggested by @erichkeane in https://reviews.llvm.org/D141451#inline-1429549 There's potential for a lot more cleanups around these APIs. This is just a start. Callers need to be more careful about sub-expressions producing strings that don't outlast the expression using ``llvm::demangle``. Add a release note. Reviewed By: MaskRay, #lld-macho Differential Revision: https://reviews.llvm.org/D149104
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 29adf88..b054147 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -633,9 +633,8 @@ BackendConsumer::StackSizeDiagHandler(const llvm::DiagnosticInfoStackSize &D) {
return false;
Diags.Report(*Loc, diag::warn_fe_frame_larger_than)
- << D.getStackSize()
- << D.getStackLimit()
- << llvm::demangle(D.getFunction().getName().str());
+ << D.getStackSize() << D.getStackLimit()
+ << llvm::demangle(D.getFunction().getName());
return true;
}
@@ -649,7 +648,7 @@ bool BackendConsumer::ResourceLimitDiagHandler(
Diags.Report(*Loc, DiagID)
<< D.getResourceName() << D.getResourceSize() << D.getResourceLimit()
- << llvm::demangle(D.getFunction().getName().str());
+ << llvm::demangle(D.getFunction().getName());
return true;
}
@@ -854,7 +853,7 @@ void BackendConsumer::DontCallDiagHandler(const DiagnosticInfoDontCall &D) {
Diags.Report(LocCookie, D.getSeverity() == DiagnosticSeverity::DS_Error
? diag::err_fe_backend_error_attr
: diag::warn_fe_backend_warning_attr)
- << llvm::demangle(D.getFunctionName().str()) << D.getNote();
+ << llvm::demangle(D.getFunctionName()) << D.getNote();
}
void BackendConsumer::MisExpectDiagHandler(