[all-commits] [llvm/llvm-project] 50e79d: [lldb] Minor cleanups at callsites of FileSpec::Ge...

Alex via All-commits all-commits at lists.llvm.org
Tue May 2 17:20:48 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 50e79d725c105344e292d1fe8044a69467c20346
  Author: Alex Langford <alangford at apple.com>
  Date:   2023-05-02 (Tue, 02 May 2023)

  Changed paths:
    M lldb/source/Commands/CommandObjectTarget.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
    M lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp

  Log Message:
  [lldb] Minor cleanups at callsites of FileSpec::GetFileNameExtension

FileSpec::GetFileNameExtension returns a StringRef. In some cases we
are calling it and then storing the result in a local. To prevent
cases where we store the StringRef, mutate the Filespec, and then try to
use the stored StringRef afterwards, I've audited the callsites and made
adjustments to mitigate: Either marking the FileSpec it comes from as
const (to avoid mutations) or by not storing the StringRef in a local if
it makes sense not to.

Differential Revision: https://reviews.llvm.org/D149671

More information about the All-commits mailing list