Cache element types in StructType.
Previously, GetElementType() would end up causing dynamic allocation to happen to compute the final element type (turning types with unbound variability into the same type with the struct's variability) each it was called, which was wasteful and slow. Now we cache the result. Another 20% perf on compiling that problematic program.
This commit is contained in: