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
f6a578b4
Unverified
Commit
f6a578b4
authored
Jan 17, 2018
by
Robert Kimball
Committed by
GitHub
Jan 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add toggle to compiler diagnostic output (#388)
parent
981dabef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
compiler.cpp
src/ngraph/codegen/compiler.cpp
+16
-7
compiler.hpp
src/ngraph/codegen/compiler.hpp
+1
-0
No files found.
src/ngraph/codegen/compiler.cpp
View file @
f6a578b4
...
@@ -123,6 +123,7 @@ static std::string GetExecutablePath(const char* Argv0)
...
@@ -123,6 +123,7 @@ static std::string GetExecutablePath(const char* Argv0)
StaticCompiler
::
StaticCompiler
()
StaticCompiler
::
StaticCompiler
()
:
m_precompiled_header_valid
(
false
)
:
m_precompiled_header_valid
(
false
)
,
m_debuginfo_enabled
(
false
)
,
m_debuginfo_enabled
(
false
)
,
m_enable_diag_output
((
std
::
getenv
(
"NGRAPH_COMPILER_DIAG_ENABLE"
)
!=
nullptr
))
,
m_source_name
(
"code.cpp"
)
,
m_source_name
(
"code.cpp"
)
{
{
initialize
();
initialize
();
...
@@ -150,19 +151,27 @@ void StaticCompiler::initialize()
...
@@ -150,19 +151,27 @@ void StaticCompiler::initialize()
args
.
push_back
(
"-inline-threshold=1000000"
);
args
.
push_back
(
"-inline-threshold=1000000"
);
// Prepare DiagnosticEngine
// Prepare DiagnosticEngine
IntrusiveRefCntPtr
<
DiagnosticOptions
>
DiagOpts
=
new
DiagnosticOptions
();
IntrusiveRefCntPtr
<
DiagnosticOptions
>
diag_options
=
new
DiagnosticOptions
();
DiagOpts
->
ErrorLimit
=
20
;
diag_options
->
ErrorLimit
=
20
;
TextDiagnosticPrinter
*
textDiagPrinter
=
new
clang
::
TextDiagnosticPrinter
(
errs
(),
&*
DiagOpts
);
IntrusiveRefCntPtr
<
DiagnosticIDs
>
diag_id
(
new
DiagnosticIDs
());
IntrusiveRefCntPtr
<
DiagnosticIDs
>
DiagID
(
new
DiagnosticIDs
());
DiagnosticsEngine
diag_engine
(
diag_id
,
&*
diag_options
);
DiagnosticsEngine
DiagEngine
(
DiagID
,
&*
DiagOpts
,
textDiagPrinter
);
// Create and initialize CompilerInstance
// Create and initialize CompilerInstance
m_compiler
=
std
::
unique_ptr
<
CompilerInstance
>
(
new
CompilerInstance
());
m_compiler
=
std
::
unique_ptr
<
CompilerInstance
>
(
new
CompilerInstance
());
m_compiler
->
createDiagnostics
();
DiagnosticConsumer
*
diag_consumer
;
if
(
m_enable_diag_output
)
{
diag_consumer
=
new
TextDiagnosticPrinter
(
errs
(),
&*
diag_options
);
}
else
{
diag_consumer
=
new
IgnoringDiagConsumer
();
}
m_compiler
->
createDiagnostics
(
diag_consumer
);
// Initialize CompilerInvocation
// Initialize CompilerInvocation
CompilerInvocation
::
CreateFromArgs
(
CompilerInvocation
::
CreateFromArgs
(
m_compiler
->
getInvocation
(),
&
args
[
0
],
&
args
[
0
]
+
args
.
size
(),
DiagE
ngine
);
m_compiler
->
getInvocation
(),
&
args
[
0
],
&
args
[
0
]
+
args
.
size
(),
diag_e
ngine
);
configure_search_path
();
configure_search_path
();
...
...
src/ngraph/codegen/compiler.hpp
View file @
f6a578b4
...
@@ -86,6 +86,7 @@ private:
...
@@ -86,6 +86,7 @@ private:
std
::
unique_ptr
<
clang
::
CompilerInstance
>
m_compiler
;
std
::
unique_ptr
<
clang
::
CompilerInstance
>
m_compiler
;
bool
m_precompiled_header_valid
;
bool
m_precompiled_header_valid
;
bool
m_debuginfo_enabled
;
bool
m_debuginfo_enabled
;
bool
m_enable_diag_output
;
std
::
string
m_source_name
;
std
::
string
m_source_name
;
std
::
vector
<
std
::
string
>
m_extra_search_path_list
;
std
::
vector
<
std
::
string
>
m_extra_search_path_list
;
std
::
string
m_pch_path
;
std
::
string
m_pch_path
;
...
...
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