From 9e6770af9086326b3d7c0cb29e8b144fb3578369 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 15 Nov 2019 17:59:42 +0000 Subject: command: Use new frontend experimentally Signed-off-by: David Shah --- common/command.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/command.cc b/common/command.cc index 13cd3498..c75f91ef 100644 --- a/common/command.cc +++ b/common/command.cc @@ -35,7 +35,7 @@ #include #include "command.h" #include "design_utils.h" -#include "frontend_base.h" +#include "json_frontend.h" #include "jsonparse.h" #include "jsonwrite.h" #include "log.h" @@ -266,9 +266,13 @@ int CommandHandler::executeMain(std::unique_ptr ctx) if (vm.count("json")) { std::string filename = vm["json"].as(); std::ifstream f(filename); +#ifdef LEGACY_FRONTEND if (!parse_json_file(f, filename, w.getContext())) log_error("Loading design failed.\n"); - +#else + if (!parse_json(f, filename, w.getContext())) + log_error("Loading design failed.\n"); +#endif customAfterLoad(w.getContext()); w.notifyChangeContext(); w.updateActions(); @@ -285,8 +289,13 @@ int CommandHandler::executeMain(std::unique_ptr ctx) if (vm.count("json")) { std::string filename = vm["json"].as(); std::ifstream f(filename); +#ifdef LEGACY_FRONTEND if (!parse_json_file(f, filename, ctx.get())) log_error("Loading design failed.\n"); +#else + if (!parse_json(f, filename, ctx.get())) + log_error("Loading design failed.\n"); +#endif customAfterLoad(ctx.get()); } -- cgit v1.2.3