@@ -47,7 +47,7 @@ using ObjectFields = SmallDenseMap<StringAttr, EvaluatorValuePtr>;
4747// / the appropriate reference count.
4848struct EvaluatorValue : std::enable_shared_from_this<EvaluatorValue> {
4949 // Implement LLVM RTTI.
50- enum class Kind { Attr, Object, List, Tuple, Map, Reference, BasePath, Path };
50+ enum class Kind { Attr, Object, List, Reference, BasePath, Path };
5151 EvaluatorValue (MLIRContext *ctx, Kind kind, Location loc)
5252 : kind(kind), ctx(ctx), loc(loc) {}
5353 Kind getKind () const { return kind; }
@@ -224,44 +224,6 @@ struct ListValue : EvaluatorValue {
224224 SmallVector<EvaluatorValuePtr> elements;
225225};
226226
227- // / A Map value.
228- struct MapValue : EvaluatorValue {
229- MapValue (om::MapType type, DenseMap<Attribute, EvaluatorValuePtr> elements,
230- Location loc)
231- : EvaluatorValue(type.getContext(), Kind::Map, loc), type(type),
232- elements (std::move(elements)) {
233- markFullyEvaluated ();
234- }
235-
236- // Partially evaluated value.
237- MapValue (om::MapType type, Location loc)
238- : EvaluatorValue(type.getContext(), Kind::Map, loc), type(type) {}
239-
240- const auto &getElements () const { return elements; }
241- void setElements (DenseMap<Attribute, EvaluatorValuePtr> newElements) {
242- elements = std::move (newElements);
243- markFullyEvaluated ();
244- }
245-
246- // Finalize the evaluator value.
247- LogicalResult finalizeImpl ();
248-
249- // / Return the type of the value, which is a MapType.
250- om::MapType getMapType () const { return type; }
251-
252- // / Return an array of keys in the ascending order.
253- ArrayAttr getKeys ();
254-
255- // / Implement LLVM RTTI.
256- static bool classof (const EvaluatorValue *e) {
257- return e->getKind () == Kind::Map;
258- }
259-
260- private:
261- om::MapType type;
262- DenseMap<Attribute, EvaluatorValuePtr> elements;
263- };
264-
265227// / A composite Object, which has a type and fields.
266228struct ObjectValue : EvaluatorValue {
267229 ObjectValue (om::ClassOp cls, ObjectFields fields, Location loc)
@@ -313,46 +275,6 @@ struct ObjectValue : EvaluatorValue {
313275 llvm::SmallDenseMap<StringAttr, EvaluatorValuePtr> fields;
314276};
315277
316- // / Tuple values.
317- struct TupleValue : EvaluatorValue {
318- using TupleElements = llvm::SmallVector<EvaluatorValuePtr>;
319- TupleValue (TupleType type, TupleElements tupleElements, Location loc)
320- : EvaluatorValue(type.getContext(), Kind::Tuple, loc), type(type),
321- elements (std::move(tupleElements)) {
322- markFullyEvaluated ();
323- }
324-
325- // Partially evaluated value.
326- TupleValue (TupleType type, Location loc)
327- : EvaluatorValue(type.getContext(), Kind::Tuple, loc), type(type) {}
328-
329- void setElements (TupleElements newElements) {
330- elements = std::move (newElements);
331- markFullyEvaluated ();
332- }
333-
334- LogicalResult finalizeImpl () {
335- for (auto &&value : elements)
336- if (failed (finalizeEvaluatorValue (value)))
337- return failure ();
338-
339- return success ();
340- }
341- // / Implement LLVM RTTI.
342- static bool classof (const EvaluatorValue *e) {
343- return e->getKind () == Kind::Tuple;
344- }
345-
346- // / Return the type of the value, which is a TupleType.
347- TupleType getTupleType () const { return type; }
348-
349- const TupleElements &getElements () const { return elements; }
350-
351- private:
352- TupleType type;
353- TupleElements elements;
354- };
355-
356278// / A Basepath value.
357279struct BasePathValue : EvaluatorValue {
358280 BasePathValue (MLIRContext *context);
@@ -493,14 +415,6 @@ struct Evaluator {
493415 FailureOr<EvaluatorValuePtr> evaluateListConcat (ListConcatOp op,
494416 ActualParameters actualParams,
495417 Location loc);
496- FailureOr<EvaluatorValuePtr>
497- evaluateTupleCreate (TupleCreateOp op, ActualParameters actualParams,
498- Location loc);
499- FailureOr<EvaluatorValuePtr>
500- evaluateTupleGet (TupleGetOp op, ActualParameters actualParams, Location loc);
501- FailureOr<evaluator::EvaluatorValuePtr>
502- evaluateMapCreate (MapCreateOp op, ActualParameters actualParams,
503- Location loc);
504418 FailureOr<evaluator::EvaluatorValuePtr>
505419 evaluateBasePathCreate (FrozenBasePathCreateOp op,
506420 ActualParameters actualParams, Location loc);
@@ -543,8 +457,6 @@ operator<<(mlir::Diagnostic &diag,
543457 diag << " Object(" << object->getType () << " )" ;
544458 else if (auto *list = llvm::dyn_cast<evaluator::ListValue>(&evaluatorValue))
545459 diag << " List(" << list->getType () << " )" ;
546- else if (auto *map = llvm::dyn_cast<evaluator::MapValue>(&evaluatorValue))
547- diag << " Map(" << map->getType () << " )" ;
548460 else if (llvm::isa<evaluator::BasePathValue>(&evaluatorValue))
549461 diag << " BasePath()" ;
550462 else if (llvm::isa<evaluator::PathValue>(&evaluatorValue))
0 commit comments