[all-commits] [llvm/llvm-project] d0c3b6: Delay initialization of OptBisect

Krzysztof Parzyszek via All-commits all-commits at lists.llvm.org
Thu Aug 5 07:04:48 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d0c3b61498ecc04c9d95f6af7eb7560727500d56
      https://github.com/llvm/llvm-project/commit/d0c3b61498ecc04c9d95f6af7eb7560727500d56
  Author: Krzysztof Parzyszek <kparzysz at quicinc.com>
  Date:   2021-08-05 (Thu, 05 Aug 2021)

  Changed paths:
    M llvm/include/llvm/IR/OptBisect.h
    M llvm/lib/IR/OptBisect.cpp

  Log Message:
  -----------
  Delay initialization of OptBisect

When LLVM is used in other projects, it may happen that global cons-
tructors will execute before the call to ParseCommandLineOptions.
Since OptBisect is initialized via a constructor, and has no ability
to be updated at a later time, passing "-opt-bisect-limit" to the
parse function may have no effect.

To avoid this problem use a cl::cb (callback) to set the bisection
limit when the option is actually processed.

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




More information about the All-commits mailing list