This includes only the taken branch of conditional sections.
The API allows for producing a stream for a particular PP branch, which
will be used later for the secondary GLR parses of not-taken branches.
Details
- Reviewers
hokein - Commits
- rG7dc3c6190ec7: [pseudo] Strip directives from a token stream
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| clang-tools-extra/pseudo/lib/DirectiveTree.cpp | ||
|---|---|---|
| 373 | return, otherwise we we hit the unreachable code below. | |
| clang-tools-extra/pseudo/tool/ClangPseudo.cpp | ||
| 42 | preprocess seems a little confusing (the name reminds me of the traditional preprocessor process where comments are stripped, but not in our case here). may be strip-directives but it doesn't reflect the conditional-#if token work, but I think it is fine. This flag is a feature-control flag for print-source and print-tokens, can we group three of them together? | |
would be nice to land it in some of form.
| clang-tools-extra/pseudo/unittests/DirectiveTreeTest.cpp | ||
|---|---|---|
| 316 | nit: cover #include as well? | |
| clang-tools-extra/pseudo/lib/DirectiveTree.cpp | ||
|---|---|---|
| 373 | That's deliberate, K_Empty is invalid. | |
| clang-tools-extra/pseudo/tool/ClangPseudo.cpp | ||
| 42 |
Agreed, renamed it.
It's not really, it also affects the GLR parser etc. | |
rebase
add include to testcase
rename preprocess => strip-includes, and testcase
move print directivetree test to strip-includes.c
fix tests to not cook before parsing directivetree
return, otherwise we we hit the unreachable code below.