[PATCH] D135295: [clang][ExtractAPI] Don't print locations for anonymous tags

Zixu Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 12:24:42 PDT 2022


zixuw added inline comments.


================
Comment at: clang/lib/ExtractAPI/ExtractAPIConsumer.cpp:854
+  // Do not include location in anonymous decls.
+  PrintingPolicy Policy(CI.getASTContext().getLangOpts());
+  Policy.AnonymousTagLocations = false;
----------------
sammccall wrote:
> nit: this isn't *just* clearing AnonymousTagLocations, but also resetting any other PP flags to defaults based on LangOpts. You could getPrintingPolicy() instead if you didn't intend to do this.
Makes sense. Probably doesn't matter because I'm pretty sure `PrintingPolicy` for ExtractAPI is just the default now. Still, good to use `getPrintingPolicy` to be sure


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135295



More information about the cfe-commits mailing list