Changeset View
Changeset View
Standalone View
Standalone View
src/Clazy.cpp
Show First 20 Lines • Show All 265 Lines • ▼ Show 20 Line(s) | 229 | { | |||
---|---|---|---|---|---|
266 | 266 | | |||
267 | m_context = new ClazyContext(ci, headerFilter, ignoreDirs, exportFixesFilename, {}, m_options); | 267 | m_context = new ClazyContext(ci, headerFilter, ignoreDirs, exportFixesFilename, {}, m_options); | ||
268 | 268 | | |||
269 | // This argument is for debugging purposes | 269 | // This argument is for debugging purposes | ||
270 | const bool dbgPrintRequestedChecks = parseArgument("print-requested-checks", args); | 270 | const bool dbgPrintRequestedChecks = parseArgument("print-requested-checks", args); | ||
271 | 271 | | |||
272 | { | 272 | { | ||
273 | std::lock_guard<std::mutex> lock(CheckManager::lock()); | 273 | std::lock_guard<std::mutex> lock(CheckManager::lock()); | ||
274 | m_checks = m_checkManager->requestedChecks(m_context, args); | 274 | m_checks = m_checkManager->requestedChecks(args, | ||
275 | m_options & ClazyContext::ClazyOption_Qt4Compat); | ||||
275 | } | 276 | } | ||
276 | 277 | | |||
277 | if (args.size() > 1) { | 278 | if (args.size() > 1) { | ||
278 | // Too many arguments. | 279 | // Too many arguments. | ||
279 | llvm::errs() << "Too many arguments: "; | 280 | llvm::errs() << "Too many arguments: "; | ||
280 | for (const std::string &a : args) | 281 | for (const std::string &a : args) | ||
281 | llvm::errs() << a << ' '; | 282 | llvm::errs() << a << ' '; | ||
282 | llvm::errs() << "\n"; | 283 | llvm::errs() << "\n"; | ||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | |||||
385 | unique_ptr<ASTConsumer> ClazyStandaloneASTAction::CreateASTConsumer(CompilerInstance &ci, llvm::StringRef) | 386 | unique_ptr<ASTConsumer> ClazyStandaloneASTAction::CreateASTConsumer(CompilerInstance &ci, llvm::StringRef) | ||
386 | { | 387 | { | ||
387 | auto context = new ClazyContext(ci, m_headerFilter, m_ignoreDirs, m_exportFixesFilename, m_translationUnitPaths, m_options); | 388 | auto context = new ClazyContext(ci, m_headerFilter, m_ignoreDirs, m_exportFixesFilename, m_translationUnitPaths, m_options); | ||
388 | auto astConsumer = new ClazyASTConsumer(context); | 389 | auto astConsumer = new ClazyASTConsumer(context); | ||
389 | 390 | | |||
390 | auto cm = CheckManager::instance(); | 391 | auto cm = CheckManager::instance(); | ||
391 | 392 | | |||
392 | vector<string> checks; checks.push_back(m_checkList); | 393 | vector<string> checks; checks.push_back(m_checkList); | ||
393 | const RegisteredCheck::List requestedChecks = cm->requestedChecks(context, checks); | 394 | const bool qt4Compat = m_options & ClazyContext::ClazyOption_Qt4Compat; | ||
395 | const RegisteredCheck::List requestedChecks = cm->requestedChecks(checks, qt4Compat); | ||||
394 | 396 | | |||
395 | if (requestedChecks.size() == 0) { | 397 | if (requestedChecks.size() == 0) { | ||
396 | llvm::errs() << "No checks were requested!\n" << "\n"; | 398 | llvm::errs() << "No checks were requested!\n" << "\n"; | ||
397 | return nullptr; | 399 | return nullptr; | ||
398 | } | 400 | } | ||
399 | 401 | | |||
400 | auto createdChecks = cm->createChecks(requestedChecks, context); | 402 | auto createdChecks = cm->createChecks(requestedChecks, context); | ||
401 | for (const auto &check : createdChecks) { | 403 | for (const auto &check : createdChecks) { | ||
Show All 10 Lines |