Commit cb3f09bd authored by rmrf's avatar rmrf
Browse files

Enable support for templatized plugin action.

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