sammccall added inline comments.

================
Comment at: clang/include/clang/Lex/PPCallbacks.h:346
+
+  virtual void setPreprocessor(Preprocessor *preprocessor) {
+    preprocessor_ = preprocessor;
----------------
This seems pretty tangly from a layering point of view, giving each object a 
reference to the other. I always find it hard to reason about ownership in such 
cases.

What about lifecycle methods `beginPreprocessing(Preprocessor*)` and 
`endPreprocessing(Preprocessor*)`? It will look similar in practice: subclasses 
that need it can still track the PP instance, but the circular references will 
only be there when needed, and will be explicit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58278



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to