Merge pull request #1336 from geoffw0/cached2

CPP: Cache Expr.getType().
This commit is contained in:
Jonas Jensen
2019-05-27 12:48:56 +01:00
committed by GitHub

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.