Commit c6f450af authored by Kevin Modzelewski's avatar Kevin Modzelewski

rename

parent b5b9c098
...@@ -34,7 +34,7 @@ using namespace std; ...@@ -34,7 +34,7 @@ using namespace std;
// Apply a custom category to all command-line options so that they are the // Apply a custom category to all command-line options so that they are the
// only ones displayed. // only ones displayed.
static cl::OptionCategory MyToolCategory("my-tool options"); static cl::OptionCategory RefcheckingToolCategory("my-tool options");
// CommonOptionsParser declares HelpMessage with a description of the common // CommonOptionsParser declares HelpMessage with a description of the common
// command-line options related to the compilation database and input files. // command-line options related to the compilation database and input files.
...@@ -72,7 +72,7 @@ static void dump(DeclContext* ctx) { ...@@ -72,7 +72,7 @@ static void dump(DeclContext* ctx) {
} }
} }
class MyVisitor : public RecursiveASTVisitor<MyVisitor> { class RefcheckingVisitor : public RecursiveASTVisitor<RefcheckingVisitor> {
private: private:
ASTContext *Context; ASTContext *Context;
...@@ -392,10 +392,10 @@ private: ...@@ -392,10 +392,10 @@ private:
} }
public: public:
explicit MyVisitor(ASTContext *Context) : Context(Context) { explicit RefcheckingVisitor(ASTContext *Context) : Context(Context) {
} }
virtual ~MyVisitor() { virtual ~RefcheckingVisitor() {
} }
virtual bool VisitFunctionDecl(FunctionDecl* func) { virtual bool VisitFunctionDecl(FunctionDecl* func) {
...@@ -427,12 +427,12 @@ public: ...@@ -427,12 +427,12 @@ public:
} }
}; };
class MyASTConsumer : public ASTConsumer { class RefcheckingASTConsumer : public ASTConsumer {
private: private:
MyVisitor visitor; RefcheckingVisitor visitor;
public: public:
explicit MyASTConsumer(ASTContext *Context) : visitor(Context) { explicit RefcheckingASTConsumer(ASTContext *Context) : visitor(Context) {
} }
virtual void HandleTranslationUnit(ASTContext &Context) { virtual void HandleTranslationUnit(ASTContext &Context) {
...@@ -441,16 +441,16 @@ public: ...@@ -441,16 +441,16 @@ public:
} }
}; };
class MyFrontendAction : public ASTFrontendAction { class RefcheckingFrontendAction : public ASTFrontendAction {
public: public:
virtual std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, StringRef fname) { virtual std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, StringRef fname) {
return std::unique_ptr<ASTConsumer>(new MyASTConsumer(&CI.getASTContext())); return std::unique_ptr<ASTConsumer>(new RefcheckingASTConsumer(&CI.getASTContext()));
} }
}; };
int main(int argc, const char **argv) { int main(int argc, const char **argv) {
CommonOptionsParser OptionsParser(argc, argv, MyToolCategory); CommonOptionsParser OptionsParser(argc, argv, RefcheckingToolCategory);
ClangTool Tool(OptionsParser.getCompilations(), ClangTool Tool(OptionsParser.getCompilations(),
OptionsParser.getSourcePathList()); OptionsParser.getSourcePathList());
return Tool.run(newFrontendActionFactory<MyFrontendAction>().get()); return Tool.run(newFrontendActionFactory<RefcheckingFrontendAction>().get());
} }
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