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:
7
expr.h
7
expr.h
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user