[all-commits] [llvm/llvm-project] fa7dd4: [BOLT][NFC] Add BOLTError and return it from passe...

Amir Ayupov via All-commits all-commits at lists.llvm.org
Mon Feb 12 14:40:11 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fa7dd4919aa705f18f268fab5b2887d45f89d8dd
      https://github.com/llvm/llvm-project/commit/fa7dd4919aa705f18f268fab5b2887d45f89d8dd
  Author: Amir Ayupov <aaupov at fb.com>
  Date:   2024-02-12 (Mon, 12 Feb 2024)

  Changed paths:
    M bolt/include/bolt/Core/BinaryContext.h
    M bolt/lib/Core/BinaryContext.cpp
    M bolt/lib/Passes/ADRRelaxationPass.cpp
    M bolt/lib/Passes/BinaryPasses.cpp
    M bolt/lib/Passes/Instrumentation.cpp
    M bolt/lib/Passes/PatchEntries.cpp
    M bolt/lib/Passes/ReorderFunctions.cpp
    M bolt/lib/Passes/VeneerElimination.cpp

  Log Message:
  -----------
  [BOLT][NFC] Add BOLTError and return it from passes (1/2) (#81522)

As part of the effort to refactor old error handling code that
would directly call exit(1), in this patch we add a new class
BOLTError and auxiliary functions `createFatalBOLTError()` and
`createNonFatalBOLTError()` that allow BOLT code to bubble up the
problem to the caller by using the Error class as a return
type (or Expected). Also changes passes to use these.

Co-authored-by: Rafael Auler <rafaelauler at fb.com>

Test Plan: NFC




More information about the All-commits mailing list