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

Skip to content

Commit df1d64f

Browse files
author
Dave Bartolomeo
authored
Merge pull request #2244 from jbj/IRType-cached
C++: Minimal caching of the IR type system
2 parents f808dce + fca7d9a commit df1d64f

4 files changed

Lines changed: 6 additions & 0 deletions

File tree

cpp/ql/src/semmle/code/cpp/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

cpp/ql/src/semmle/code/cpp/ir/internal/CppType.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ private IRType getIRTypeForPRValue(Type type) {
175175
)
176176
}
177177

178+
cached
178179
private newtype TCppType =
179180
TPRValueType(Type type) { exists(getIRTypeForPRValue(type)) } or
180181
TFunctionGLValueType() or
@@ -203,6 +204,7 @@ class CppType extends TCppType {
203204
* Gets the `IRType` that represents this `CppType`. Many different `CppType`s can map to a single
204205
* `IRType`.
205206
*/
207+
cached
206208
IRType getIRType() { none() }
207209

208210
/**

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)