Skip to content

Commit

Permalink
Enable visiting template instantiations.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmrf committed Dec 20, 2019
1 parent 96d96e0 commit 830ba42
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/FindConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ FindConstructor::~FindConstructor() {
constructor_stmt_ = nullptr;
}

bool FindConstructor::shouldVisitTemplateInstantiations() { return true; }
bool FindConstructor::shouldVisitTemplateInstantiations() const { return true; }

bool FindConstructor::VisitCXXMethodDecl(CXXMethodDecl *method_declaration) {
os_ << "@@ CXXMethodDecl\n";
Expand Down
2 changes: 1 addition & 1 deletion src/FindConstructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FindConstructor : public RecursiveASTVisitor<FindConstructor> {
FindConstructor(CXXRecordDecl *, llvm::raw_ostream &);
virtual ~FindConstructor();
virtual bool VisitCXXMethodDecl(CXXMethodDecl *);
bool shouldVisitTemplateInstantiations();
bool shouldVisitTemplateInstantiations() const;

Stmt *returnConstructorStmt() const;
void dump() const;
Expand Down
1 change: 1 addition & 0 deletions src/SystemCClang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ bool SystemCConsumer::fire() {
//
vector<EntryFunctionContainer *> _entryFunctionContainerVector;
FindConstructor constructor{add_module_decl->getModuleClassDecl(), os_};
constructor.dump();
add_module_decl->addConstructor(constructor.returnConstructorStmt());


Expand Down

0 comments on commit 830ba42

Please sign in to comment.