Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
caesr-pub
systemc-clang
Commits
cb3f09bd
Commit
cb3f09bd
authored
Dec 23, 2018
by
rmrf
Browse files
Enable support for templatized plugin action.
parent
054dc72e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
17 deletions
+14
-17
paths.sh
paths.sh
+2
-2
src/PluginAction.h
src/PluginAction.h
+2
-1
src/SystemCClang.h
src/SystemCClang.h
+10
-14
No files found.
paths.sh
View file @
cb3f09bd
...
...
@@ -6,11 +6,11 @@
# Path for where the binaries are for clang
# SET this.
export
LLVM_BUILD_DIR
=
/home/
$USER
/clang-7.0.0/
export
LLVM_BUILD_DIR
=
/home/
$USER
/
bin/
clang-7.0.0/
# Path where SystemC is installed
# SET this.
export
SYSTEMC
=
/home/
$USER
/
sw
/systemc-2.3.3/
export
SYSTEMC
=
/home/
$USER
/
code
/systemc-2.3.3/
systemc/
# Path for the systemc-clang build directory
# SET this.
...
...
src/PluginAction.h
View file @
cb3f09bd
...
...
@@ -29,7 +29,8 @@ public:
);
//FrontendActionFactory *fe = newFrontendActionFactory < LightsCameraAction < A > >();
//Tool.run (fe);
Tool
.
run
(
newFrontendActionFactory
<
LightsCameraAction
<
SystemCConsumer
>
>
().
get
());
//Tool.run ( newFrontendActionFactory< LightsCameraAction<SystemCConsumer> >().get());
Tool
.
run
(
newFrontendActionFactory
<
LightsCameraAction
<
A
>
>
().
get
());
};
...
...
src/SystemCClang.h
View file @
cb3f09bd
...
...
@@ -51,8 +51,6 @@ using namespace clang::tooling;
#include "SCuitable/GlobalSuspensionAutomata.h"
#include "SCuitable/FindGPUMacro.h"
//#include "matchers/sc_module.h"
using
namespace
clang
;
namespace
scpar
{
...
...
@@ -60,9 +58,6 @@ namespace scpar {
class
SystemCConsumer
:
public
ASTConsumer
,
public
RecursiveASTVisitor
<
SystemCConsumer
>
{
private:
public:
llvm
::
raw_ostream
&
_os
;
SourceManager
&
_sm
;
...
...
@@ -77,7 +72,7 @@ namespace scpar {
Model
*
getSystemCModel
();
virtual
void
HandleTranslationUnit
(
ASTContext
&
context
);
virtual
void
HandleTranslationUnit
(
ASTContext
&
context
);
ASTContext
&
_context
;
private:
...
...
@@ -89,22 +84,23 @@ namespace scpar {
};
// End class SystemCConsumer
class
SystemCClang
:
public
SystemCConsumer
{
public:
SystemCClang
(
CompilerInstance
&
ci
)
:
SystemCConsumer
(
ci
)
{
}
bool
postFire
()
{
return
true
;
}
};
template
<
typename
A
>
class
LightsCameraAction
:
template
<
typename
A
>
class
LightsCameraAction
:
public
clang
::
ASTFrontendAction
{
protected:
virtual
std
::
unique_ptr
<
clang
::
ASTConsumer
>
CreateASTConsumer
(
CompilerInstance
&
ci
,
llvm
::
StringRef
inFile
)
{
// virtual ASTConsumer * CreateASTConsumer(CompilerInstance & ci, StringRef) {
return
std
::
unique_ptr
<
clang
::
ASTConsumer
>
(
new
SystemCConsumer
(
ci
));
//return new A(ci);
return
std
::
unique_ptr
<
clang
::
ASTConsumer
>
(
new
A
(
ci
));
};
};
// End class LightsCameraAction
}
// End namespace scpar
#endif
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