C#: Move Expr::hasValue() to DotNet::Expr

This commit is contained in:
Tom Hvitved
2020-12-21 09:46:45 +01:00
parent 06366fa320
commit 8d6c69bf74
2 changed files with 3 additions and 3 deletions

View File

@@ -51,9 +51,6 @@ class Expr extends DotNet::Expr, ControlFlowElement, @expr {
/** Gets the value of this expression, if any */
override string getValue() { expr_value(this, result) }
/** Holds if this expression has a value. */
predicate hasValue() { exists(getValue()) }
/** Gets the enclosing statement of this expression, if any. */
final Stmt getEnclosingStmt() { enclosingStmt(this, result) }

View File

@@ -17,6 +17,9 @@ class Expr extends Element, @dotnet_expr {
/** Gets the constant value of this expression, if any. */
string getValue() { none() }
/** Holds if this expression has a value. */
final predicate hasValue() { exists(this.getValue()) }
/**
* Gets the parent of this expression. This is for example the element
* that uses the result of this expression.