[all-commits] [llvm/llvm-project] b75896: [Clang] Optimize tok::isLiteral with range-based c...

Thibault Monnier via All-commits all-commits at lists.llvm.org
Wed Aug 13 05:18:34 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b75896bc4525e153aa9cdf77e0993aae0d637a28
      https://github.com/llvm/llvm-project/commit/b75896bc4525e153aa9cdf77e0993aae0d637a28
  Author: Thibault Monnier <97551402+Thibault-Monnier at users.noreply.github.com>
  Date:   2025-08-13 (Wed, 13 Aug 2025)

  Changed paths:
    M clang/include/clang/Basic/TokenKinds.h

  Log Message:
  -----------
  [Clang] Optimize tok::isLiteral with range-based condition (#153228)

This commit optimizes `tok::isLiteral` by replacing a succession of `13`
conditions with a range-based check.

I am not sure whether this is allowed. I believe it is done nowhere else
in the codebase ; however, I have seen range-based conditions being used
with other enums.

---------

Co-authored-by: Corentin Jabot <corentinjabot at gmail.com>



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