[PATCH] D91327: [NewPM] Redesign of PreserveCFG Checker

Serguei Katkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 17 22:43:47 PST 2020


skatkov added inline comments.


================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:769
+    auto *F = any_cast<const Function *>(IR);
+    if (auto *Result = FAM.getCachedResult<PreservedCFGCheckerAnalysis>(
+            *const_cast<Function *>(F)))
----------------
Result -> GraphBefore 


================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:771
+            *const_cast<Function *>(F)))
+      checkCFG(P, F->getName(), *Result, CFG(F, false /* TrackBBLifetime */));
     else
----------------
why do you check before pass runs?


================
Comment at: llvm/lib/Passes/StandardInstrumentations.cpp:778
       [this](StringRef P, const PreservedAnalyses &PassPA) {
-        auto Before = GraphStackBefore.pop_back_val();
-        assert(Before.first == P &&
+        assert(PassStack.pop_back_val() == P &&
                "Before and After callbacks must correspond");
----------------
you should not PassStack.pop_back_val() for product build?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91327



More information about the cfe-commits mailing list