[clang] [clang][dataflow] Discard unneeded `ExprToLoc` and `ExprToVal` entries. (PR #72850)

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 12:55:23 PST 2023


================
@@ -256,8 +259,12 @@ class JoinedStateBuilder {
       // to enable building analyses like computation of dominators that
       // initialize the state of each basic block differently.
       return {AC.Analysis.typeErasedInitialElement(), AC.InitEnv.fork()};
+
     if (All.size() == 1)
-      return Owned.empty() ? All.front()->fork() : std::move(Owned.front());
+      // Join the environment with itself so that we can discard unwanted
----------------
ymand wrote:

This change may obviate the value of JoinedStateBuilder altogether, since a key point was to save on copies. Once we always build a fresh one, I'm not sure the complexity is doing much anymore. Please double check this.

https://github.com/llvm/llvm-project/pull/72850


More information about the cfe-commits mailing list