[PATCH] D123243: [pseudo] Strip directives from a token stream

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 8 02:40:39 PDT 2022


hokein added inline comments.


================
Comment at: clang-tools-extra/pseudo/lib/DirectiveTree.cpp:373
+    case DirectiveTree::Chunk::K_Empty:
+      break;
+    }
----------------
return, otherwise we we hit the unreachable code below.


================
Comment at: clang-tools-extra/pseudo/tool/ClangPseudo.cpp:40
+static opt<bool>
+    Preprocess("preprocess",
+               desc("Strip directives and select conditional sections"));
----------------
`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?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123243/new/

https://reviews.llvm.org/D123243



More information about the cfe-commits mailing list