diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h --- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h @@ -119,10 +119,11 @@ return L1 == L2; } - void transferTypeErased(const CFGElement *Element, TypeErasedLattice &E, + void transferTypeErased(const CFGElement &Element, TypeErasedLattice &E, Environment &Env) final { Lattice &L = llvm::any_cast(E.Value); - static_cast(this)->transfer(Element, L, Env); + // FIXME: change the contract of `transfer` to take a reference. + static_cast(this)->transfer(&Element, L, Env); } void transferBranchTypeErased(bool Branch, const Stmt *Stmt, diff --git a/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h --- a/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h @@ -96,7 +96,7 @@ /// Applies the analysis transfer function for a given control flow graph /// element and type-erased lattice element. - virtual void transferTypeErased(const CFGElement *, TypeErasedLattice &, + virtual void transferTypeErased(const CFGElement &, TypeErasedLattice &, Environment &) = 0; /// Applies the analysis transfer function for a given edge from a CFG block diff --git a/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp b/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp --- a/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp +++ b/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp @@ -374,7 +374,7 @@ } // User-provided analysis - AC.Analysis.transferTypeErased(&Element, State.Lattice, State.Env); + AC.Analysis.transferTypeErased(Element, State.Lattice, State.Env); // Post processing if (PostVisitCFG) {