================
@@ -74,11 +84,25 @@ class AnalysisImpl
   /// one.
   Lattice join(Lattice L1, Lattice L2) const {
     LivenessMap Merged = L1.LiveOrigins;
-    // Take the earliest UseFact to make the join hermetic and commutative.
-    auto CombineUseFact = [](const UseFact &A,
-                             const UseFact &B) -> const UseFact * {
-      return A.getUseExpr()->getExprLoc() < B.getUseExpr()->getExprLoc() ? &A
-                                                                         : &B;
+    // Take the earliest Fact to make the join hermetic and commutative.
+    auto CombineCausingFact = [](const Fact &A, const Fact &B) -> const Fact * 
{
+      SourceLocation LocA = GetFactLoc(A);
+      SourceLocation LocB = GetFactLoc(B);
+
+      bool aValid = LocA.isValid();
+      bool bValid = LocB.isValid();
+
+      if (aValid && bValid) {
+        if (LocA < LocB)
+          return &A;
+        if (LocB < LocA)
+          return &B;
+      } else if (aValid) {
+        return &A;
+      } else if (bValid) {
+        return &B;
+      }
+      return &A < &B ? &A : &B;
----------------
kashika0112 wrote:

Done

https://github.com/llvm/llvm-project/pull/165370
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to