[PATCH] D93222: [RFC][analyzer] Introduce MacroExpansionContext to libAnalysis
Gábor Horváth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Dec 16 03:22:28 PST 2020
xazax.hun added inline comments.
================
Comment at: clang/lib/Analysis/MacroExpansionContext.cpp:22
+ : PP(PP), SM(PP.getSourceManager()), LangOpts(LangOpts) {
+ class MacroExpansionRangeRecorder : public PPCallbacks {
+ const Preprocessor &PP;
----------------
steakhal wrote:
> xazax.hun wrote:
> > It may be more idiomatic to put classes in an anonymous namespace rather than expanding them in a method.
> I tried, but I could not hide the `MacroExpansionRangeRecorder` class as a detail.
> https://godbolt.org/z/bcYK7x
> Let me know if there is a better way to hide details.
I don't see any problems with the code you linked. What do you mean by could not hide it better? I think, it is very common to have utility functions with the current file as the visibility.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93222/new/
https://reviews.llvm.org/D93222
More information about the cfe-commits
mailing list