C#: Turn isAutogenerated predicate into a predicate without result.

This commit is contained in:
Michael Nebel
2022-05-09 07:30:06 +02:00
parent 2dc35c123a
commit 76fd424795
3 changed files with 18 additions and 24 deletions

View File

@@ -221,9 +221,9 @@ module Public {
predicate clearsContent(ParameterPosition pos, ContentSet content) { none() }
/**
* Gets whether the summary is auto generated or not.
* Holds if the summary is auto generated.
*/
boolean isAutoGenerated() { result = false }
predicate isAutoGenerated() { none() }
}
}
@@ -904,7 +904,7 @@ module Private {
)
}
override boolean isAutoGenerated() { summaryElement(this, _, _, _, result) }
override predicate isAutoGenerated() { summaryElement(this, _, _, _, true) }
}
/** Holds if component `c` of specification `spec` cannot be parsed. */
@@ -1059,10 +1059,8 @@ module Private {
preservesValue = false and result = "taint"
}
private string renderGenerated(boolean generated) {
generated = true and result = "generated:"
or
generated = false and result = ""
private string renderGenerated(RelevantSummarizedCallable c) {
if c.isAutoGenerated() then result = "generated:" else result = ""
}
/**
@@ -1078,7 +1076,7 @@ module Private {
c.relevantSummary(input, output, preservesValue) and
csv =
c.getCallableCsv() + getComponentStackCsv(input) + ";" + getComponentStackCsv(output) +
";" + renderGenerated(c.isAutoGenerated()) + renderKind(preservesValue)
";" + renderGenerated(c) + renderKind(preservesValue)
)
}
}