Remove Content::NoContent

This commit is contained in:
Asger F
2022-09-15 14:44:35 +02:00
parent 9c93ad904f
commit 7dfa58b50d
2 changed files with 3 additions and 20 deletions

View File

@@ -390,8 +390,7 @@ private module Cached {
class TContentSet = TSingletonContent or TAnyElementContent or TElementLowerBoundContent;
cached
newtype TOptionalContent =
TNoContent() or
newtype TContent =
TKnownElementContent(ConstantValue cv) {
not cv.isInt(_) or
cv.getInt() in [0 .. 10]
@@ -418,11 +417,6 @@ private module Cached {
// Only used by type-tracking
TAttributeName(string name) { name = any(AST::SetterMethodCall c).getTargetName() }
cached
class TContent =
TKnownElementContent or TUnknownElementContent or TKnownPairValueContent or
TUnknownPairValueContent or TFieldContent or TAttributeName;
/**
* Holds if `e` is an `ExprNode` that may be returned by a call to `c`.
*/

View File

@@ -235,8 +235,8 @@ predicate localExprFlow(CfgNodes::ExprCfgNode e1, CfgNodes::ExprCfgNode e2) {
localFlow(exprNode(e1), exprNode(e2))
}
/** A reference contained in an object, or the `noContent()` value. */
class OptionalContent extends TOptionalContent {
/** A reference contained in an object. */
class Content extends TContent {
/** Gets a textual representation of this content. */
string toString() { none() }
@@ -244,9 +244,6 @@ class OptionalContent extends TOptionalContent {
Location getLocation() { none() }
}
/** A reference contained in an object. */
class Content extends OptionalContent, TContent { }
/** Provides different sub classes of `Content`. */
module Content {
/** An element in a collection, for example an element in an array or in a hash. */
@@ -337,14 +334,6 @@ module Content {
/** Gets `AttributeNameContent` of the given name. */
AttributeNameContent getAttributeName(string name) { result.getName() = name }
/** A value representing no content. */
class NoContent extends OptionalContent, TNoContent {
override string toString() { result = "noContent()" }
}
/** Gets the `noContent()` value. */
NoContent noContent() { any() }
}
class OptionalContentSet extends TOptionalContentSet {