diff options
author | yronglin <yronglin777@gmail.com> | 2025-06-24 18:55:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-24 18:55:21 +0800 |
commit | e8976e92f655f8c358081ffae01e10ea159cd37d (patch) | |
tree | 2a0a89496b67332eda5f8c7af3751972669f3c21 /llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp | |
parent | 4d2b79b04a9ebd6c678c465c9a4b1f311ccfbfc2 (diff) | |
download | llvm-e8976e92f655f8c358081ffae01e10ea159cd37d.zip llvm-e8976e92f655f8c358081ffae01e10ea159cd37d.tar.gz llvm-e8976e92f655f8c358081ffae01e10ea159cd37d.tar.bz2 |
[clang][Preprocessor] Add peekNextPPToken, makes look ahead next token without side-effects (#143898)
This PR introduce a new function `peekNextPPToken`. It's an extension of
`isNextPPTokenLParen` and can makes look ahead one token in preprocessor
without side-effects.
It's also the 1st part of
https://github.com/llvm/llvm-project/pull/107168 and it was used to look
ahead next token then determine whether current lexing pp directive is
one of pp-import or pp-module directive.
At the start of phase 4 an import or module token is treated as starting
a directive and are converted to their respective keywords iff:
- After skipping horizontal whitespace are
- at the start of a logical line, or
- preceded by an export at the start of the logical line.
- Are followed by an identifier pp token (before macro expansion), or
- <, ", or : (but not ::) pp tokens for import, or
- ; for module
Otherwise the token is treated as an identifier.
---------
Signed-off-by: yronglin <yronglin777@gmail.com>
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions