61 llvm::Expected<clang::tooling::CommonOptionsParser> options_parser{
62 clang::tooling::CommonOptionsParser::create(argc, argv, category)};
64 llvm::dbgs() <<
"Options parser\n";
65 if (
auto err = options_parser.takeError() ) {
66 llvm::logAllUnhandledErrors(std::move(err), llvm::errs(),
"[PluginAction Error]");
70 ClangTool Tool(options_parser->getCompilations(),
71 options_parser->getSourcePathList());
75 if (debug_mode || (debug_only !=
"")) {
76 LLVM_DEBUG(llvm::dbgs() <<
"Debug mode enabled\n";);
77 llvm::DebugFlag =
true;
80 if (debug_only !=
"") {
82 setCurrentDebugType(debug_only.c_str());
84 llvm::setCurrentDebugType(debug_only.c_str());
88 std::unique_ptr<FrontendActionFactory> FrontendFactory;
89 FrontendFactory = newFrontendActionFactory<SystemCClangAXN>();
91 llvm::dbgs() <<
"Start SCCL\n";
92 Tool.run(FrontendFactory.get());