Lines Matching +full:clang +full:- +full:analyzer

1 //===--- ExecuteCompilerInvocation.cpp ------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 // minimize the impact of pulling in essentially everything else in Clang.
12 //===----------------------------------------------------------------------===//
14 #include "clang/ARCMigrate/ARCMTActions.h"
15 #include "clang/CodeGen/CodeGenAction.h"
16 #include "clang/Config/config.h"
17 #include "clang/Driver/Options.h"
18 #include "clang/ExtractAPI/FrontendActions.h"
19 #include "clang/Frontend/CompilerInstance.h"
20 #include "clang/Frontend/CompilerInvocation.h"
21 #include "clang/Frontend/FrontendActions.h"
22 #include "clang/Frontend/FrontendDiagnostic.h"
23 #include "clang/Frontend/FrontendPluginRegistry.h"
24 #include "clang/Frontend/Utils.h"
25 #include "clang/FrontendTool/Utils.h"
26 #include "clang/Rewrite/Frontend/FrontendActions.h"
27 #include "clang/StaticAnalyzer/Frontend/AnalyzerHelpFlags.h"
28 #include "clang/StaticAnalyzer/Frontend/FrontendActions.h"
34 using namespace clang;
37 namespace clang { namespace
41 using namespace clang::frontend; in CreateFrontendBaseAction()
57 llvm_unreachable("CIR suppport not built into clang"); in CreateFrontendBaseAction()
88 if ((P->getActionType() != PluginASTAction::ReplaceAction && in CreateFrontendBaseAction()
89 P->getActionType() != PluginASTAction::CmdlineAfterMainAction) || in CreateFrontendBaseAction()
90 !P->ParseArgs( in CreateFrontendBaseAction()
187 // --emit-symbol-graph option) in CreateFrontendAction()
206 bool ExecuteCompilerInvocation(CompilerInstance *Clang) { in ExecuteCompilerInvocation() argument
207 // Honor -help. in ExecuteCompilerInvocation()
208 if (Clang->getFrontendOpts().ShowHelp) { in ExecuteCompilerInvocation()
210 llvm::outs(), "clang -cc1 [options] file...", in ExecuteCompilerInvocation()
211 "LLVM 'Clang' Compiler: http://clang.llvm.org", in ExecuteCompilerInvocation()
217 // Honor -version. in ExecuteCompilerInvocation()
219 // FIXME: Use a better -version message? in ExecuteCompilerInvocation()
220 if (Clang->getFrontendOpts().ShowVersion) { in ExecuteCompilerInvocation()
225 Clang->LoadRequestedPlugins(); in ExecuteCompilerInvocation()
227 // Honor -mllvm. in ExecuteCompilerInvocation()
231 if (!Clang->getFrontendOpts().LLVMArgs.empty()) { in ExecuteCompilerInvocation()
232 unsigned NumArgs = Clang->getFrontendOpts().LLVMArgs.size(); in ExecuteCompilerInvocation()
234 Args[0] = "clang (LLVM option parsing)"; in ExecuteCompilerInvocation()
236 Args[i + 1] = Clang->getFrontendOpts().LLVMArgs[i].c_str(); in ExecuteCompilerInvocation()
244 AnalyzerOptions &AnOpts = Clang->getAnalyzerOpts(); in ExecuteCompilerInvocation()
246 // Honor -analyzer-checker-help and -analyzer-checker-help-hidden. in ExecuteCompilerInvocation()
249 ento::printCheckerHelp(llvm::outs(), *Clang); in ExecuteCompilerInvocation()
253 // Honor -analyzer-checker-option-help. in ExecuteCompilerInvocation()
256 ento::printCheckerConfigList(llvm::outs(), *Clang); in ExecuteCompilerInvocation()
260 // Honor -analyzer-list-enabled-checkers. in ExecuteCompilerInvocation()
262 ento::printEnabledCheckerList(llvm::outs(), *Clang); in ExecuteCompilerInvocation()
266 // Honor -analyzer-config-help. in ExecuteCompilerInvocation()
274 if (Clang->getDiagnostics().hasErrorOccurred()) in ExecuteCompilerInvocation()
277 std::unique_ptr<FrontendAction> Act(CreateFrontendAction(*Clang)); in ExecuteCompilerInvocation()
280 bool Success = Clang->ExecuteAction(*Act); in ExecuteCompilerInvocation()
281 if (Clang->getFrontendOpts().DisableFree) in ExecuteCompilerInvocation()
286 } // namespace clang