CPP: Cache Expr.getType().

This commit is contained in:
Geoffrey White
2019-05-17 15:01:37 +01:00
parent ec10b76d5a
commit 36cd4d44d1

View File

@@ -57,7 +57,7 @@ class Expr extends StmtParent, @expr {
* As the type of an expression can sometimes be a TypedefType, calling getUnderlyingType()
* is often more useful than calling this predicate.
*/
pragma[nomagic] Type getType() { expr_types(underlyingElement(this),unresolveElement(result),_) }
pragma[nomagic] cached Type getType() { expr_types(underlyingElement(this),unresolveElement(result),_) }
/**
* Gets the type of this expression after typedefs have been resolved.