[all-commits] [llvm/llvm-project] 44df11: [Error] Add non-consuming toString (#95375)

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jun 14 02:35:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 44df1167f88cabbb4cfde816f279337379ea30b3
      https://github.com/llvm/llvm-project/commit/44df1167f88cabbb4cfde816f279337379ea30b3
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-06-14 (Fri, 14 Jun 2024)

  Changed paths:
    M llvm/include/llvm/Support/Error.h
    M llvm/lib/Support/Error.cpp
    M llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
    M llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
    M llvm/unittests/Support/ErrorTest.cpp

  Log Message:
  -----------
  [Error] Add non-consuming toString (#95375)

There are some places that want to convert an Error to string, but still
retain the original Error object, for example to emit a non-fatal
warning.

This currently isn't possible, because the entire Error infra is
move-based. And what people end up doing in this case is to move the
Error... twice.

This patch introduces a toStringWithoutConsuming() function to
accommodate this use case. This also requires some infrastructure that
allows visiting Errors without consuming them.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list