[all-commits] [llvm/llvm-project] d9e778: [NFC] Use int underlying type for CodeGenOpt::Level

Scott Linder via All-commits all-commits at lists.llvm.org
Mon Jan 23 15:32:30 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d9e778dfa7df1d100865a0cfe198651aff3b839c
      https://github.com/llvm/llvm-project/commit/d9e778dfa7df1d100865a0cfe198651aff3b839c
  Author: Scott Linder <Scott.Linder at amd.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    M llvm/include/llvm/Support/CodeGen.h

  Log Message:
  -----------
  [NFC] Use int underlying type for CodeGenOpt::Level

In practice the change from an unspecified underlying type to uint8_t in
25c0ea2a5370813f46686918a84e0de27e107d08 means some builds break due to
ambiguity resolving operator<< on ostreams (I assume because they define
uint8_t differently).

There were also valid points raised on the review saying that we can
just use int here anyway. Pinning it to any type removes the potential
for UB when constructing it, and int is the de-facto default.




More information about the All-commits mailing list