[coco] Remove Instr mutator interface (#2476)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Tue, 4 Dec 2018 06:35:43 +0000 (15:35 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 4 Dec 2018 06:35:43 +0000 (15:35 +0900)
This mutator interface was introduced when Instr has closed hierarchy,
and thus it is no longer valid as Instr now support open hierarchy.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/coco/core/include/coco/IR/Instr.h

index 66afc4c..16a1fd9 100644 (file)
@@ -126,48 +126,6 @@ public:
   template <typename T> T accept(IVisitor<T> &&v) const { return accept(&v); }
 
 public:
-  /**
-   * @brief Instr mutator interface
-   *
-   * WARN Use this interface only for coco-internal classes
-   *      (to minimize changes upon Instr extension)
-   */
-  struct IMutator
-  {
-    virtual ~IMutator() = default;
-
-#define INSTR(Name) virtual void mutate(Name *) = 0;
-#include "coco/IR/Instr.lst"
-#undef INSTR
-  };
-
-  struct Mutator : public IMutator
-  {
-    virtual ~Mutator() = default;
-
-#define INSTR(Name) \
-  void mutate(Name *) override { throw std::runtime_error{"NYI"}; }
-#include "coco/IR/Instr.lst"
-#undef INSTR
-  };
-
-public:
-  void accept(IMutator *m)
-  {
-#define INSTR(Name)          \
-  if (auto ins = as##Name()) \
-  {                          \
-    return m->mutate(ins);   \
-  }
-#include "coco/IR/Instr.lst"
-#undef INSTR
-    throw std::runtime_error{"unreachable"};
-  }
-
-  void accept(IMutator &m) { return accept(&m); }
-  void accept(IMutator &&m) { return accept(&m); }
-
-public:
   const InstrIndex &index(void) const { return _index; }
 
 private: