@@ -150,32 +150,34 @@ template <typename T, typename... Ts> struct Union<T, Ts...> {
150
150
151
151
template <typename T> using ListT = llvm::SmallVector<T, 0 >;
152
152
153
- // The ObjectT class represents a variable (as defined in the OpenMP spec).
153
+ // The ObjectT class represents a variable or a locator (as defined in
154
+ // the OpenMP spec).
155
+ // Note: the ObjectT template is not defined. Any user of it is expected to
156
+ // provide their own specialization that conforms to the requirements listed
157
+ // below.
158
+ //
159
+ // Let ObjectS be any specialization of ObjectT:
154
160
//
155
- // A specialization of ObjectT<Id, Expr> must provide the following definitions:
161
+ // ObjectS must provide the following definitions:
156
162
// {
157
163
// using IdTy = Id;
158
164
// using ExprTy = Expr;
159
165
//
160
166
// auto id() const -> IdTy {
161
- // return the identifier of the object (for use in tests for
162
- // presence/absence of the object)
163
- // }
164
- //
165
- // auto ref() const -> (e.g. const ExprTy&) {
166
- // return the expression accessing (referencing) the object
167
+ // // Return a value such that a.id() == b.id() if and only if:
168
+ // // (1) both `a` and `b` represent the same variable or location, or
169
+ // // (2) bool(a.id()) == false and bool(b.id()) == false
167
170
// }
168
171
// }
169
172
//
170
- // For example, the ObjectT instance created for "var[x+1]" would have
171
- // the `id()` return the identifier for `var`, and the `ref()` return the
172
- // representation of the array-access `var[x+1]`.
173
+ // The type IdTy should be hashable (usable as key in unordered containers).
173
174
//
174
- // The identity of an object must always be present, i.e. it cannot be
175
- // nullptr, std::nullopt, etc. The reference is optional.
175
+ // Values of type IdTy should be contextually convertible to `bool`.
176
176
//
177
- // Note: the ObjectT template is not defined. Any user of it is expected to
178
- // provide their own specialization that conforms to the above requirements.
177
+ // If S is an object of type ObjectS, then `bool(S.id())` is `false` if
178
+ // and only if S does not represent any variable or location.
179
+ //
180
+ // ObjectS should be copyable, movable, and default-constructible.
179
181
template <typename IdType, typename ExprType> struct ObjectT ;
180
182
181
183
// By default, object equality is only determined by its identity.
0 commit comments