[all-commits] [llvm/llvm-project] bcfbba: [llvm] Compare std::optional<T> to values directly...

Kazu Hirata via All-commits all-commits at lists.llvm.org
Fri Jun 13 08:11:43 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bcfbba12e6754e0a2a5a1c8e3aac3a24316bba2d
      https://github.com/llvm/llvm-project/commit/bcfbba12e6754e0a2a5a1c8e3aac3a24316bba2d
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-06-13 (Fri, 13 Jun 2025)

  Changed paths:
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/IR/Attributes.cpp

  Log Message:
  -----------
  [llvm] Compare std::optional<T> to values directly (NFC) (#143913)

This patch transforms:

  X && *X == Y

to:

  X == Y

where X is of std::optional<T>, and Y is of T or similar.



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