[PATCH] D121165: [pseudo] Add crude heuristics to choose taken preprocessor branches.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 6 08:22:55 PDT 2022


sammccall marked an inline comment as done.
sammccall added inline comments.


================
Comment at: clang-tools-extra/pseudo/lib/DirectiveMap.cpp:329
+    const auto &Tokens = Code.tokens(Dir.Tokens);
+    if (Tokens.empty() || Tokens.front().Kind != tok::hash)
+      return llvm::None;
----------------
hokein wrote:
> I thought the first token of the `Directive` should always be `tok::hash`, isn't it?
Yeah, this was defensive against parsing recovery, but we're sufficiently close to the parser that we don't need to be.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121165



More information about the cfe-commits mailing list