================
@@ -496,11 +558,28 @@ class LocalVariableMap {
     return nullptr;
   }
 
+  /// Look up the definition of \p D if the value of \p D is known to equal
+  /// its last definition. Use this when evaluating the value of a variable,
+  /// e.g. a trylock result.
+  const Expr *lookupValueExpr(const NamedDecl *D, Context &Ctx) const {
+    if (Ctx.isEmpty() || !hasTrackableValue(D))
+      return nullptr;
+    const unsigned *P = Ctx.lookup(D);
+    return P && !isClobbered(*P) ? lookupExpr(D, Ctx) : nullptr;
+  }
+
   Context getEmptyContext() { return ContextFactory.getEmptyMap(); }
 
+  /// If \p D has a definition in \p Ctx, return a context in which that
+  /// definition is cleared; otherwise return \p Ctx.
+  Context clearDefinitionIfSet(const NamedDecl *D, Context Ctx) {
+    return clearDefinition(D, Ctx);
+  }
+
----------------
bvanassche wrote:

Removed in the fixup commit.

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

Reply via email to