[all-commits] [llvm/llvm-project] 585ed2: [NFC][Clang][Preprocessor] Refine the implementati...

yronglin via All-commits all-commits at lists.llvm.org
Wed Jun 25 10:38:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 585ed213a8594c15324ea4bffc3ea2128eac50c8
      https://github.com/llvm/llvm-project/commit/585ed213a8594c15324ea4bffc3ea2128eac50c8
  Author: yronglin <yronglin777 at gmail.com>
  Date:   2025-06-26 (Thu, 26 Jun 2025)

  Changed paths:
    M clang/include/clang/Lex/Preprocessor.h
    M clang/include/clang/Lex/Token.h
    M clang/lib/Lex/PPDirectives.cpp
    M clang/lib/Lex/Preprocessor.cpp

  Log Message:
  -----------
  [NFC][Clang][Preprocessor] Refine the implementation of isNextPPTokenOneOf (#145546)

This PR follow the
suggestion(https://github.com/llvm/llvm-project/pull/143898#discussion_r2164253141)
to refine the implementation of `Preprocessor::isNextPPToken`, also use
C++ fold expression to refine `Token::isOneOf`. We don't need `bool
isOneOf(tok::TokenKind K1, tok::TokenKind K2) const` anymore.

In order to reduce the impact, specificed `TokenKind` is still passed to
`Token::isOneOf` and `Preprocessor::isNextPPTokenOneOf` as function
parameters.

---------

Signed-off-by: yronglin <yronglin777 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