Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
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
paths.sh
View file @
cb3f09bd
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
# Path for where the binaries are for clang
# Path for where the binaries are for clang
# SET this.
# 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
# Path where SystemC is installed
# SET this.
# 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
# Path for the systemc-clang build directory
# SET this.
# SET this.
...
...
src/PluginAction.h
View file @
cb3f09bd
...
@@ -29,7 +29,8 @@ public:
...
@@ -29,7 +29,8 @@ public:
);
);
//FrontendActionFactory *fe = newFrontendActionFactory < LightsCameraAction < A > >();
//FrontendActionFactory *fe = newFrontendActionFactory < LightsCameraAction < A > >();
//Tool.run (fe);
//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;
...
@@ -51,8 +51,6 @@ using namespace clang::tooling;
#include
"SCuitable/GlobalSuspensionAutomata.h"
#include
"SCuitable/GlobalSuspensionAutomata.h"
#include
"SCuitable/FindGPUMacro.h"
#include
"SCuitable/FindGPUMacro.h"
//#include "matchers/sc_module.h"
using
namespace
clang
;
using
namespace
clang
;
namespace
scpar
{
namespace
scpar
{
...
@@ -60,9 +58,6 @@ namespace scpar {
...
@@ -60,9 +58,6 @@ namespace scpar {
class
SystemCConsumer
:
class
SystemCConsumer
:
public
ASTConsumer
,
public
ASTConsumer
,
public
RecursiveASTVisitor
<
SystemCConsumer
>
{
public
RecursiveASTVisitor
<
SystemCConsumer
>
{
private:
public:
public:
llvm
::
raw_ostream
&
_os
;
llvm
::
raw_ostream
&
_os
;
SourceManager
&
_sm
;
SourceManager
&
_sm
;
...
@@ -77,7 +72,7 @@ namespace scpar {
...
@@ -77,7 +72,7 @@ namespace scpar {
Model
*
getSystemCModel
();
Model
*
getSystemCModel
();
virtual
void
HandleTranslationUnit
(
ASTContext
&
context
);
virtual
void
HandleTranslationUnit
(
ASTContext
&
context
);
ASTContext
&
_context
;
ASTContext
&
_context
;
private:
private:
...
@@ -89,22 +84,23 @@ namespace scpar {
...
@@ -89,22 +84,23 @@ namespace scpar {
};
// End class SystemCConsumer
};
// End class SystemCConsumer
class
SystemCClang
:
public
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
{
public
clang
::
ASTFrontendAction
{
protected:
protected:
virtual
std
::
unique_ptr
<
clang
::
ASTConsumer
>
CreateASTConsumer
(
CompilerInstance
&
ci
,
llvm
::
StringRef
inFile
)
{
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
A
(
ci
));
return
std
::
unique_ptr
<
clang
::
ASTConsumer
>
(
new
SystemCConsumer
(
ci
));
//return new A(ci);
};
};
};
// End class LightsCameraAction
};
// End class LightsCameraAction
}
// End namespace scpar
}
// End namespace scpar
#endif
#endif
Write
Preview
Supports
Markdown
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