[all-commits] [llvm/llvm-project] ae2e47: [clang] NFC: Refactor UnsignedOrNone into Optional...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Tue Apr 14 06:16:09 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae2e4768f9bdcbb2c33906708a0ab6e2a7059734
      https://github.com/llvm/llvm-project/commit/ae2e4768f9bdcbb2c33906708a0ab6e2a7059734
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2026-04-14 (Tue, 14 Apr 2026)

  Changed paths:
    M clang/include/clang/APINotes/Types.h
    M clang/include/clang/AST/ASTConcept.h
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/TemplateName.h
    M clang/include/clang/AST/TypeBase.h
    M clang/include/clang/Basic/Diagnostic.h
    A clang/include/clang/Basic/OptionalUnsigned.h
    M clang/include/clang/Basic/Specifiers.h
    R clang/include/clang/Basic/UnsignedOrNone.h
    M clang/lib/APINotes/APINotesTypes.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/Sema/Sema.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaExprObjC.cpp
    M clang/lib/Sema/SemaType.cpp

  Log Message:
  -----------
  [clang] NFC: Refactor UnsignedOrNone into OptionalUnsigned<T> with enum support (#191828)

This kind optional is simpler to use when it needs to be represented in
a bitfield, because it has an `unsigned` integer representation which
avoids overflows. This applies to enums as well.

This also adds a single use of this new functionality, migrating users
of `std::optional<NullabilityKind>`
This optional used to be represented as two members in a bitfield, and
this simplifies things down to one.



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