From c740954528c464825e078cb20be9e6506104c7a8 Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Thu, 5 Mar 2015 17:34:20 +0100 Subject: [PATCH] Updating bitcode emitter stub according to new Emitter iface. --- BitcodeEmitter.cpp | 70 ++++++++-------------------------------------- BitcodeEmitter.hpp | 38 ++++++++++--------------- 2 files changed, 26 insertions(+), 82 deletions(-) diff --git a/BitcodeEmitter.cpp b/BitcodeEmitter.cpp index 14f1568..f0d128a 100644 --- a/BitcodeEmitter.cpp +++ b/BitcodeEmitter.cpp @@ -18,17 +18,19 @@ */ #include "BitcodeEmitter.hpp" +#include "Nodes.hpp" using namespace monicelli; +struct BitcodeEmitter::Private { +}; -void BitcodeEmitter::emit(Id const& node) { +BitcodeEmitter::BitcodeEmitter() { + d = new Private; } -void BitcodeEmitter::emit(Integer const& node) { -} - -void BitcodeEmitter::emit(Float const& node) { +BitcodeEmitter::~BitcodeEmitter() { + delete d; } void BitcodeEmitter::emit(Return const& node) { @@ -76,66 +78,18 @@ void BitcodeEmitter::emit(Module const& node) { void BitcodeEmitter::emit(Program const& node) { } -void BitcodeEmitter::emit(ExpLt const& node) { +void BitcodeEmitter::emit(Id const& node) { } -void BitcodeEmitter::emit(ExpGt const& node) { +void BitcodeEmitter::emit(Integer const& node) { } -void BitcodeEmitter::emit(ExpLte const& node) { +void BitcodeEmitter::emit(Float const& node) { } -void BitcodeEmitter::emit(ExpGte const& node) { +void BitcodeEmitter::emit(BinaryExpression const& node) { } -void BitcodeEmitter::emit(ExpPlus const& node) { -} - -void BitcodeEmitter::emit(ExpMinus const& node) { -} - -void BitcodeEmitter::emit(ExpTimes const& node) { -} - -void BitcodeEmitter::emit(ExpDiv const& node) { -} - -void BitcodeEmitter::emit(ExpShl const& node) { -} - -void BitcodeEmitter::emit(ExpShr const& node) { -} - -void BitcodeEmitter::emit(SemiExpEq const& node) { -} - -void BitcodeEmitter::emit(SemiExpLt const& node) { -} - -void BitcodeEmitter::emit(SemiExpGt const& node) { -} - -void BitcodeEmitter::emit(SemiExpLte const& node) { -} - -void BitcodeEmitter::emit(SemiExpGte const& node) { -} - -void BitcodeEmitter::emit(SemiExpPlus const& node) { -} - -void BitcodeEmitter::emit(SemiExpMinus const& node) { -} - -void BitcodeEmitter::emit(SemiExpTimes const& node) { -} - -void BitcodeEmitter::emit(SemiExpDiv const& node) { -} - -void BitcodeEmitter::emit(SemiExpShl const& node) { -} - -void BitcodeEmitter::emit(SemiExpShr const& node) { +void BitcodeEmitter::emit(BinarySemiExpression const& node) { } diff --git a/BitcodeEmitter.hpp b/BitcodeEmitter.hpp index 2e756b8..e96067c 100644 --- a/BitcodeEmitter.hpp +++ b/BitcodeEmitter.hpp @@ -26,9 +26,10 @@ namespace monicelli { class BitcodeEmitter: public Emitter { public: - virtual void emit(Id const&) override; - virtual void emit(Integer const&) override; - virtual void emit(Float const&) override; + BitcodeEmitter(); + BitcodeEmitter(BitcodeEmitter &) = delete; + virtual ~BitcodeEmitter(); + virtual void emit(Return const&) override; virtual void emit(Loop const&) override; virtual void emit(VarDeclaration const&) override; @@ -44,27 +45,16 @@ public: virtual void emit(Function const&) override; virtual void emit(Module const&) override; virtual void emit(Program const&) override; - virtual void emit(ExpLt const&) override; - virtual void emit(ExpGt const&) override; - virtual void emit(ExpLte const&) override; - virtual void emit(ExpGte const&) override; - virtual void emit(ExpPlus const&) override; - virtual void emit(ExpMinus const&) override; - virtual void emit(ExpTimes const&) override; - virtual void emit(ExpDiv const&) override; - virtual void emit(ExpShl const&) override; - virtual void emit(ExpShr const&) override; - virtual void emit(SemiExpEq const&) override; - virtual void emit(SemiExpLt const&) override; - virtual void emit(SemiExpGt const&) override; - virtual void emit(SemiExpLte const&) override; - virtual void emit(SemiExpGte const&) override; - virtual void emit(SemiExpPlus const&) override; - virtual void emit(SemiExpMinus const&) override; - virtual void emit(SemiExpTimes const&) override; - virtual void emit(SemiExpDiv const&) override; - virtual void emit(SemiExpShl const&) override; - virtual void emit(SemiExpShr const&) override; + + virtual void emit(Id const&) override; + virtual void emit(Integer const&) override; + virtual void emit(Float const&) override; + virtual void emit(BinaryExpression const&) override; + virtual void emit(BinarySemiExpression const&) override; + +private: + struct Private; + Private const* d; }; }