diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2023-05-02 11:10:43 -0700 |
---|---|---|
committer | Nick Desaulniers <ndesaulniers@google.com> | 2023-05-02 11:20:15 -0700 |
commit | c117c2c8ba4afd45a006043ec6dd858652b2ffcc (patch) | |
tree | eaf2bca8cf17d405cadb6ad2d34bf7c20b9912db /clang/lib/CodeGen/CodeGenAction.cpp | |
parent | 1f74964b403c615c121c0adbd06661adaae14667 (diff) | |
download | llvm-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.cpp | 9 |
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( |