[all-commits] [llvm/llvm-project] b3576f: [llvm-exegesis] Improve error reporting

Miloš Stojanović via All-commits all-commits at lists.llvm.org
Thu Feb 6 03:26:26 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b3576f60ebc8f660afad8120a72473be47517573
      https://github.com/llvm/llvm-project/commit/b3576f60ebc8f660afad8120a72473be47517573
  Author: Miloš Stojanović <Milos.Stojanovic at rt-rk.com>
  Date:   2020-02-06 (Thu, 06 Feb 2020)

  Changed paths:
    M llvm/tools/llvm-exegesis/llvm-exegesis.cpp

  Log Message:
  -----------
  [llvm-exegesis] Improve error reporting

Fix inconsistencies in error reporting created by mixing
`report_fatal_error()` and `ExitOnErr()`, and add additional information
to the error message to make it more user friendly. Minimize the use
`report_fatal_error()` because it's meant for use in very rare cases and
it results in low information density of the error messages.

Summary of the new design:

 * For command line argument errors output `llvm-exegesis: <error_message>`,
   which is consistent with the error output format emitted by the backend
   which checks correctness of the command line arguments.
 * For other errors the format `llvm-exegesis error: <error_message>` is used.
 ** If the error occurred during file access `<error_message>` will have
    of two parts: `'<file_name>': <rest_of_the_error_message>`

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


  Commit: 141915963b6ab36ee4e577d1b27673fa4d05b409
      https://github.com/llvm/llvm-project/commit/141915963b6ab36ee4e577d1b27673fa4d05b409
  Author: Miloš Stojanović <Milos.Stojanovic at rt-rk.com>
  Date:   2020-02-06 (Thu, 06 Feb 2020)

  Changed paths:
    M llvm/tools/llvm-exegesis/lib/Target.cpp
    M llvm/tools/llvm-exegesis/lib/Target.h
    M llvm/tools/llvm-exegesis/llvm-exegesis.cpp

  Log Message:
  -----------
  [llvm-exegesis] Improve error reporting in Target.cpp

Followup to D74085.
Replace the use of `report_fatal_error()` with returning the error to
`llvm-exegesis.cpp` and handling it there.

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


Compare: https://github.com/llvm/llvm-project/compare/529e6f8791b6...141915963b6a


More information about the All-commits mailing list