Perf: cache connection between const/non-const struct variants.

In one very large program, we were spending quite a bit of time repeatedly
getting const variants of StructTypes.  This speeds up the front-end by
about 40% for that test case.

(This is something of a band-aid, pending uniquing types.)
This commit is contained in:
Matt Pharr
2012-05-04 10:36:44 -07:00
parent b7bef87a4d
commit 58bb2826b2
2 changed files with 26 additions and 10 deletions

2
type.h
View File

@@ -732,6 +732,8 @@ private:
const Variability variability;
const bool isConst;
const SourcePos pos;
mutable const StructType *oppositeConstStructType;
};