This commit introduces make_backend function which will abstract Backend
instance creation.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
set_target_properties(enco_core PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(enco_core PRIVATE src)
target_include_directories(enco_core PUBLIC include)
+target_link_libraries(enco_core enco_intf_cmdline)
target_link_libraries(enco_core coco_core)
target_link_libraries(enco_core coco_generic)
target_link_libraries(enco_core pp)
#ifndef __ENCO_BACKEND_H__
#define __ENCO_BACKEND_H__
+#include "cmdline/View.h"
+
#include "coco/IR/Module.h"
#include "coco/IR/Data.h"
#include <ostream>
+#include <memory>
namespace enco
{
} // namespace enco
+extern "C" std::unique_ptr<enco::Backend> make_backend(const cmdline::View &);
+
#endif // __ENCO_BACKEND_H__
#include "Lower.h"
+#include <nncc/foundation/Memory.h>
+
#include <stdexcept>
+using nncc::foundation::make_unique;
+
namespace
{
}
} // namespace enco
+
+#include <iostream>
+
+std::unique_ptr<enco::Backend> make_backend(const cmdline::View &)
+{
+ return make_unique<enco::Backend>(std::cout);
+}