[enco.cli] Use make_backend (#1669)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 28 Sep 2018 07:16:29 +0000 (16:16 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 28 Sep 2018 07:16:29 +0000 (16:16 +0900)
This commit revises enco-cli to invoke make_backend helper instead of
Backend's constructor directly.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/enco/cli/src/Driver.cpp

index 7526fbf..3145032 100644 (file)
@@ -147,6 +147,8 @@ static int entry(int argc, char **argv)
   // Usage:
   //  [Command] --frontend [Frontend .so path] --frontend-arg ...
   std::unique_ptr<FrontendZone> frontend_zone;
+  // TODO Allow users to update this variable (via command-line options)
+  cmdline::Vector backend_args;
 
   // Simple argument parser (based on map)
   std::map<std::string, std::function<void(const std::string &arg)>> argparse;
@@ -187,9 +189,9 @@ static int entry(int argc, char **argv)
 
   auto bundle = frontend->load();
 
-  enco::Backend backend{std::cout};
+  auto backend = make_backend(backend_args);
 
-  backend.compile(bundle.module(), bundle.data());
+  backend->compile(bundle.module(), bundle.data());
 
   return 0;
 }