Skip to content

Commit 36cd4d4

Browse files
committed
CPP: Cache Expr.getType().
1 parent ec10b76 commit 36cd4d4

File tree

1 file changed

+1
-1
lines changed
  • cpp/ql/src/semmle/code/cpp/exprs

1 file changed

+1
-1
lines changed

cpp/ql/src/semmle/code/cpp/exprs/Expr.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Expr extends StmtParent, @expr {
5757
* As the type of an expression can sometimes be a TypedefType, calling getUnderlyingType()
5858
* is often more useful than calling this predicate.
5959
*/
60-
pragma[nomagic] Type getType() { expr_types(underlyingElement(this),unresolveElement(result),_) }
60+
pragma[nomagic] cached Type getType() { expr_types(underlyingElement(this),unresolveElement(result),_) }
6161

6262
/**
6363
* Gets the type of this expression after typedefs have been resolved.

0 commit comments

Comments
 (0)