[PATCH] D131039: [clang][dataflow] Add cache of `ControlFlowContext`s for function decls.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 4 10:51:03 PDT 2022

ymandel marked 2 inline comments as done.
ymandel added inline comments.

Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:38
+  // DEPRECATED. Use overload above.
   static llvm::Expected<ControlFlowContext> build(const Decl *D, Stmt *S,
xazax.hun wrote:
> I think LLVM can use the `[[deprecated]]` attribute.
Thanks -- I verifed and it works. But, it produces warnings which I'm afraid may be a problem with some builds. So, I want to hold off until I can clean up all of our uses.

Comment at: clang/include/clang/Analysis/FlowSensitive/ControlFlowContext.h:63-65
+  const Decl *ContainingDecl;
   std::unique_ptr<CFG> Cfg;
   llvm::DenseMap<const Stmt *, const CFGBlock *> StmtToBlock;
xazax.hun wrote:
> This starts to look more and more similar to `AnalysisDeclContext`. I wonder if at some point we should factor the common code out into a common base class or something.
Agreed. Filed issue #56932.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list