C#: Cache IRType like for C++

This commit is contained in:
Jonas Jensen
2019-11-06 07:42:34 +01:00
parent fb4dac597c
commit fca7d9a391
2 changed files with 3 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
private import internal.IRTypeInternal
cached
private newtype TIRType =
TIRVoidType() or
TIRUnknownType() or

View File

@@ -144,6 +144,7 @@ private IRType getIRTypeForPRValue(Type type) {
string getOpaqueTagIdentityString(Type tag) { result = tag.getQualifiedName() }
cached
private newtype TCSharpType =
TPRValueType(Type type) { exists(getIRTypeForPRValue(type)) } or
TGLValueAddressType(Type type) { any() } or
@@ -163,6 +164,7 @@ class CSharpType extends TCSharpType {
* Gets the `IRType` that represents this `CSharpType`. Many different `CSharpType`s can map to a
* single `IRType`.
*/
cached
abstract IRType getIRType();
/**