Cache type and lvalue type in IndexExpr and MemberExpr

This saves a bunch of redundant work and unnecessary duplicated
memory allocations.
This commit is contained in:
Matt Pharr
2012-05-04 13:14:17 -07:00
parent e495ef2c48
commit c0019bd8e5
2 changed files with 59 additions and 29 deletions

7
expr.h
View File

@@ -284,6 +284,10 @@ public:
int EstimateCost() const;
Expr *baseExpr, *index;
private:
mutable const Type *type;
mutable const PointerType *lvalueType;
};
@@ -320,6 +324,9 @@ public:
member is found. (i.e. this is true if the MemberExpr was a '->'
operator, and is false if it was a '.' operator. */
bool dereferenceExpr;
protected:
mutable const Type *type, *lvalueType;
};