Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
7aeb0270
Commit
7aeb0270
authored
Nov 17, 2017
by
Jaikrishnan Menon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: Pass compiler_action directly
parent
23cff66f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
compiler.cpp
src/ngraph/codegen/compiler.cpp
+3
-3
compiler.hpp
src/ngraph/codegen/compiler.hpp
+2
-1
No files found.
src/ngraph/codegen/compiler.cpp
View file @
7aeb0270
...
...
@@ -76,7 +76,7 @@ Compiler::~Compiler()
std
::
unique_ptr
<
llvm
::
Module
>
Compiler
::
compile
(
const
std
::
string
&
source
)
{
lock_guard
<
mutex
>
lock
(
m_mutex
);
return
s_static_compiler
.
compile
(
this
,
source
);
return
s_static_compiler
.
compile
(
compiler_action
,
source
);
}
static
std
::
string
GetExecutablePath
(
const
char
*
Argv0
)
...
...
@@ -310,7 +310,8 @@ void StaticCompiler::use_cached_files()
}
}
std
::
unique_ptr
<
llvm
::
Module
>
StaticCompiler
::
compile
(
Compiler
*
compiler
,
const
string
&
source
)
std
::
unique_ptr
<
llvm
::
Module
>
StaticCompiler
::
compile
(
std
::
unique_ptr
<
clang
::
CodeGenAction
>&
compiler_action
,
const
string
&
source
)
{
// Map code filename to a memoryBuffer
StringRef
source_ref
(
source
);
...
...
@@ -318,7 +319,6 @@ std::unique_ptr<llvm::Module> StaticCompiler::compile(Compiler* compiler, const
m_compiler
->
getInvocation
().
getPreprocessorOpts
().
addRemappedFile
(
m_source_name
,
buffer
.
get
());
// Create and execute action
auto
&
compiler_action
=
compiler
->
get_compiler_action
();
compiler_action
.
reset
(
new
EmitCodeGenOnlyAction
());
std
::
unique_ptr
<
llvm
::
Module
>
rc
;
if
(
m_compiler
->
ExecuteAction
(
*
compiler_action
)
==
true
)
...
...
src/ngraph/codegen/compiler.hpp
View file @
7aeb0270
...
...
@@ -70,7 +70,8 @@ public:
void
set_debuginfo_enabled
(
bool
state
)
{
m_debuginfo_enabled
=
state
;
}
bool
is_debuginfo_enabled
()
{
return
m_debuginfo_enabled
;
}
void
add_header_search_path
(
const
std
::
string
&
path
);
std
::
unique_ptr
<
llvm
::
Module
>
compile
(
Compiler
*
compiler
,
const
std
::
string
&
source
);
std
::
unique_ptr
<
llvm
::
Module
>
compile
(
std
::
unique_ptr
<
clang
::
CodeGenAction
>&
compiler_action
,
const
std
::
string
&
source
);
private
:
std
::
unique_ptr
<
clang
::
CompilerInstance
>
m_compiler
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment