[PATCH] D72893: [NewPassManager] Add assertions when getting statefull cached analysis.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 12:08:14 PST 2020


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


================
Comment at: llvm/include/llvm/IR/PassManager.h:1249
+    const AnalysisManagerT &getInnerManager() const { return *OuterAM; }
+    friend FunctionAnalysisManagerCGSCCProxy;
     const AnalysisManagerT *OuterAM;
----------------
A quick clarification before addressing all the comments: only `FunctionAnalysisManagerCGSCCProxy` is a `friend` and can get the actual manager by calling `getInnerManager`.
This is used in lib/Analysis/CGSCCPassManager.cpp:226 (I need to update the naming below, it's not `MAMProxy`, it's `MAM`).


The unit tests do **not** have access to this API. They are using managers already declared in the test itself and it's probably worth not allowing even that, because, you know, it's hack to allow something disallowed... 
As you mentioned, I'll look to delete or update the tests wherever the API `cachedResultExists` cannot be used.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72893





More information about the llvm-commits mailing list