Commit 23cff66f authored by Jaikrishnan Menon's avatar Jaikrishnan Menon

CPU: Add a method instead of using friend access

parent c5cce78d
...@@ -318,7 +318,7 @@ std::unique_ptr<llvm::Module> StaticCompiler::compile(Compiler* compiler, const ...@@ -318,7 +318,7 @@ std::unique_ptr<llvm::Module> StaticCompiler::compile(Compiler* compiler, const
m_compiler->getInvocation().getPreprocessorOpts().addRemappedFile(m_source_name, buffer.get()); m_compiler->getInvocation().getPreprocessorOpts().addRemappedFile(m_source_name, buffer.get());
// Create and execute action // Create and execute action
auto& compiler_action = compiler->compiler_action; auto& compiler_action = compiler->get_compiler_action();
compiler_action.reset(new EmitCodeGenOnlyAction()); compiler_action.reset(new EmitCodeGenOnlyAction());
std::unique_ptr<llvm::Module> rc; std::unique_ptr<llvm::Module> rc;
if (m_compiler->ExecuteAction(*compiler_action) == true) if (m_compiler->ExecuteAction(*compiler_action) == true)
......
...@@ -50,13 +50,11 @@ private: ...@@ -50,13 +50,11 @@ private:
class ngraph::codegen::Compiler class ngraph::codegen::Compiler
{ {
friend StaticCompiler;
public: public:
Compiler(); Compiler();
~Compiler(); ~Compiler();
std::unique_ptr<llvm::Module> compile(const std::string& source); std::unique_ptr<llvm::Module> compile(const std::string& source);
std::unique_ptr<clang::CodeGenAction>& get_compiler_action() { return compiler_action; }
private: private:
std::unique_ptr<clang::CodeGenAction> compiler_action; std::unique_ptr<clang::CodeGenAction> compiler_action;
}; };
......
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