Commit cb3f09bd authored by rmrf's avatar rmrf

Enable support for templatized plugin action.

parent 054dc72e
......@@ -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.
......
......@@ -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());
};
......
......@@ -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
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