Cache the computation of core toString predicates.

This commit is contained in:
alexet
2019-10-25 14:31:32 +01:00
parent 6e6dab9ab8
commit 924d23f657
3 changed files with 3 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ pragma[inline]
*/ */
class ElementBase extends @element { class ElementBase extends @element {
/** Gets a textual representation of this element. */ /** Gets a textual representation of this element. */
cached
string toString() { none() } string toString() { none() }
/** /**

View File

@@ -10,6 +10,7 @@ import semmle.code.csharp.Location
*/ */
class Element extends @dotnet_element { class Element extends @dotnet_element {
/** Gets a textual representation of this element. */ /** Gets a textual representation of this element. */
cached
string toString() { none() } string toString() { none() }
/** Gets the location of this element. */ /** Gets the location of this element. */

View File

@@ -84,6 +84,7 @@ class Top extends @top {
int getNumberOfCommentLines() { numlines(this, _, _, result) } int getNumberOfCommentLines() { numlines(this, _, _, result) }
/** Gets a textual representation of this element. */ /** Gets a textual representation of this element. */
cached
string toString() { hasName(this, result) } string toString() { hasName(this, result) }
} }