Commit 8c47e8f1 authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

CPU: Address review comments #1

parent a48a75d5
......@@ -67,7 +67,7 @@ static std::string GetExecutablePath(const char* Argv0)
execution_state::execution_state()
: m_execution_engine{nullptr}
, pch_enabled(false)
, precompiled_headers_enabled(false)
, debuginfo_enabled(false)
{
}
......@@ -147,7 +147,7 @@ std::unique_ptr<llvm::Module> execution_state::compile(const string& source, con
CGO.setDebugInfo(codegenoptions::FullDebugInfo);
}
if (pch_enabled)
if (precompiled_headers_enabled)
{
// Preprocessor options
auto& PPO = Clang->getInvocation().getPreprocessorOpts();
......
......@@ -44,10 +44,11 @@ public:
execution_state();
~execution_state();
void enable_pch() { pch_enabled = true; }
void disable_pch() { pch_enabled = false; }
void enable_debuginfo() { debuginfo_enabled = true; }
void disable_debuginfo() { debuginfo_enabled = false; }
void set_precompiled_headers_enabled(bool state) { precompiled_headers_enabled = state; }
bool is_precompiled_headers_enabled() { return precompiled_headers_enabled; }
void set_debuginfo_enabled(bool state) { debuginfo_enabled = state; }
bool is_debuginfo_enabled() { return debuginfo_enabled; }
std::unique_ptr<llvm::Module> compile(const std::string& source, const std::string& name = "");
bool add_module(std::unique_ptr<llvm::Module>&);
......@@ -65,7 +66,7 @@ public:
private:
llvm::ExecutionEngine* m_execution_engine;
std::string jit_error;
bool pch_enabled;
bool precompiled_headers_enabled;
bool debuginfo_enabled;
template <typename signature>
......
......@@ -14,7 +14,7 @@
#include <algorithm>
#include "ngraph/runtime/cpu/call_frame.hpp"
#include "call_frame.hpp"
using namespace std;
using namespace ngraph::runtime::cpu;
......
......@@ -246,11 +246,11 @@ extern "C" void __entrypoint(ngraph::runtime::cpu::CallFrame* call_frame,
ngraph::codegen::execution_state estate;
#if NGCPU_PCH
estate.enable_pch();
estate.set_precompiled_headers_enabled(true);
#endif
#if NGCPU_DEBUGINFO
estate.enable_debuginfo();
estate.set_debuginfo_enabled(true);
#endif
auto llvm_module = estate.compile(TU, "__ngcpu_codegen.cpp");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment