From baade373fba2e08772be441b2c30d2b32f04b5cd Mon Sep 17 00:00:00 2001 From: Shinichi Umegane Date: Wed, 25 Sep 2024 20:25:27 +0900 Subject: [PATCH] Remove garbage files --- fcheck.cpp | 67 ------------------------------------------------------ 1 file changed, 67 deletions(-) delete mode 100644 fcheck.cpp diff --git a/fcheck.cpp b/fcheck.cpp deleted file mode 100644 index 4c54a6e6..00000000 --- a/fcheck.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace clang; -using namespace clang::tooling; - -class FunctionVisitor : public RecursiveASTVisitor { -public: - explicit FunctionVisitor(ASTContext *context) : context(context) {} - - bool VisitFunctionDecl(FunctionDecl *func) { - // 関数名を取得 - std::string funcName = func->getNameInfo().getName().getAsString(); - - // noexcept が指定されているかどうかを確認 - bool isNoexcept = (func->getExceptionSpecType() == EST_BasicNoexcept); - - // 結果を出力 - std::cout << "Function: " << funcName - << " - noexcept: " << (isNoexcept ? "true" : "false") - << std::endl; - - return true; - } - -private: - ASTContext *context; -}; - -class FunctionASTConsumer : public ASTConsumer { -public: - explicit FunctionASTConsumer(ASTContext *context) : visitor(context) {} - - virtual void HandleTranslationUnit(ASTContext &context) override { - visitor.TraverseDecl(context.getTranslationUnitDecl()); - } - -private: - FunctionVisitor visitor; -}; - -class FunctionFrontendAction : public ASTFrontendAction { -public: - virtual std::unique_ptr CreateASTConsumer(CompilerInstance &CI, StringRef file) override { - return std::make_unique(&CI.getASTContext()); - } -}; - -static llvm::cl::OptionCategory MyToolCategory("my-tool options"); - -int main(int argc, const char **argv) { - auto optionsParser = CommonOptionsParser::create(argc, argv, MyToolCategory); - if (!optionsParser) { - llvm::errs() << "Error creating CommonOptionsParser\n"; - return 1; - } - - ClangTool tool(optionsParser->getCompilations(), optionsParser->getSourcePathList()); - return tool.run(newFrontendActionFactory().get()); -} -