[all-commits] [llvm/llvm-project] 541ccd: Allow signposts to take advantage of deferred stri...

adrian-prantl via All-commits all-commits at lists.llvm.org
Fri Jun 11 16:36:01 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 541ccd1c1bb23e1e20a382844b35312c0caffd79
      https://github.com/llvm/llvm-project/commit/541ccd1c1bb23e1e20a382844b35312c0caffd79
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2021-06-11 (Fri, 11 Jun 2021)

  Changed paths:
    M lldb/include/lldb/Utility/Timer.h
    M lldb/source/Utility/Timer.cpp
    M llvm/include/llvm/Support/Signposts.h
    M llvm/lib/Support/Signposts.cpp
    M llvm/lib/Support/Timer.cpp

  Log Message:
  -----------
  Allow signposts to take advantage of deferred string substitution

One nice feature of the os_signpost API is that format string
substitutions happen in the consumer, not the logging
application. LLVM's current Signpost class doesn't take advantage of
this though and instead always uses a static "Begin/End %s" format
string.

This patch uses variadic macros to allow the API to be used as
intended. Unfortunately, the primary use-case I had in mind (the
LLDB_SCOPED_TIMER() macro) does not get much better from this, because
__PRETTY_FUNCTION__ is *not* a macro, but a static string, so
signposts created by LLDB_SCOPED_TIMER() still use a static "%s"
format string. At least LLDB_SCOPED_TIMERF() works as intended.

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


  Commit: 635b72136e95173e74d45ae66eca714d7e4e4f87
      https://github.com/llvm/llvm-project/commit/635b72136e95173e74d45ae66eca714d7e4e4f87
  Author: Adrian Prantl <aprantl at apple.com>
  Date:   2021-06-11 (Fri, 11 Jun 2021)

  Changed paths:
    M lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

  Log Message:
  -----------
  Disambiguate usage of struct mach_header and other MachO definitions.

Unfortunately the Darwin signpost header also pulls in the system
MachO header and so we need to make sure to use the LLVM versions of
those definitions.


Compare: https://github.com/llvm/llvm-project/compare/0276cc742bfc...635b72136e95


More information about the All-commits mailing list