@@ -2,6 +2,7 @@ import AliasAnalysis
22private import SimpleSSAImports
33import SimpleSSAPublicImports
44private import AliasConfiguration
5+ private import codeql.util.Unit
56
67private predicate isTotalAccess ( Allocation var , AddressOperand addrOperand , IRType type ) {
78 exists ( Instruction constantBase , int bitOffset |
@@ -77,6 +78,40 @@ class MemoryLocation extends TMemoryLocation {
7778
7879predicate canReuseSsaForOldResult ( Instruction instr ) { none ( ) }
7980
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+
80115/**
81116 * Represents a set of `MemoryLocation`s that cannot overlap with
82117 * `MemoryLocation`s outside of the set. The `VirtualVariable` will be
0 commit comments