Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fca7d9a

Browse files
committed
C#: Cache IRType like for C++
1 parent fb4dac5 commit fca7d9a

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

csharp/ql/src/semmle/code/csharp/ir/implementation/IRType.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
private import internal.IRTypeInternal
66

7+
cached
78
private newtype TIRType =
89
TIRVoidType() or
910
TIRUnknownType() or

csharp/ql/src/semmle/code/csharp/ir/internal/CSharpType.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ private IRType getIRTypeForPRValue(Type type) {
144144

145145
string getOpaqueTagIdentityString(Type tag) { result = tag.getQualifiedName() }
146146

147+
cached
147148
private newtype TCSharpType =
148149
TPRValueType(Type type) { exists(getIRTypeForPRValue(type)) } or
149150
TGLValueAddressType(Type type) { any() } or
@@ -163,6 +164,7 @@ class CSharpType extends TCSharpType {
163164
* Gets the `IRType` that represents this `CSharpType`. Many different `CSharpType`s can map to a
164165
* single `IRType`.
165166
*/
167+
cached
166168
abstract IRType getIRType();
167169

168170
/**

0 commit comments

Comments
 (0)