Rust: Cache Element.toString

This commit is contained in:
Tom Hvitved
2025-03-11 10:54:06 +01:00
parent 9a8cb1a55b
commit d1ad65ae09
76 changed files with 117 additions and 84 deletions

View File

@@ -29,7 +29,15 @@ module Generated {
/**
* Gets the string representation of this element.
*/
string toString() { none() } // overridden by subclasses
cached
final string toString() { result = this.toStringImpl() }
/**
* INTERNAL: Do not use.
*
* Gets the string representation of this element.
*/
abstract string toStringImpl();
/**
* Gets the name of a primary CodeQL class to which this element belongs.