@@ -2,6 +2,7 @@ import AliasAnalysis
2
2
private import SimpleSSAImports
3
3
import SimpleSSAPublicImports
4
4
private import AliasConfiguration
5
+ private import codeql.util.Unit
5
6
6
7
private predicate isTotalAccess ( Allocation var , AddressOperand addrOperand , IRType type ) {
7
8
exists ( Instruction constantBase , int bitOffset |
@@ -77,6 +78,40 @@ class MemoryLocation extends TMemoryLocation {
77
78
78
79
predicate canReuseSsaForOldResult ( Instruction instr ) { none ( ) }
79
80
81
+ abstract class VariableGroup extends Unit {
82
+ abstract Allocation getAnAllocation ( ) ;
83
+
84
+ string toString ( ) { result = "{" + strictconcat ( this .getAnAllocation ( ) .toString ( ) , ", " ) + "}" }
85
+
86
+ abstract Language:: Location getLocation ( ) ;
87
+
88
+ abstract IRFunction getIRFunction ( ) ;
89
+
90
+ abstract Language:: LanguageType getType ( ) ;
91
+
92
+ abstract int getInitializationOrder ( ) ;
93
+ }
94
+
95
+ class GroupedMemoryLocation extends MemoryLocation {
96
+ VariableGroup vg ;
97
+
98
+ GroupedMemoryLocation ( ) { none ( ) }
99
+
100
+ /** Gets an allocation of this memory location. */
101
+ Allocation getAnAllocation ( ) { result = vg .getAnAllocation ( ) }
102
+
103
+ /** Gets the set of allocations associated with this memory location. */
104
+ VariableGroup getGroup ( ) { result = vg }
105
+
106
+ predicate isMayAccess ( ) { none ( ) }
107
+
108
+ /** Holds if this memory location represents all the enclosing allocations. */
109
+ predicate isAll ( ) { none ( ) }
110
+
111
+ /** Holds if this memory location represents one or more of the enclosing allocations. */
112
+ predicate isSome ( ) { none ( ) }
113
+ }
114
+
80
115
/**
81
116
* Represents a set of `MemoryLocation`s that cannot overlap with
82
117
* `MemoryLocation`s outside of the set. The `VirtualVariable` will be
0 commit comments