//
//===----------------------------------------------------------------------===//
+#ifndef LLVM_CLANG_FRONTEND_ANALYSISCONSUMER_H
+#define LLVM_CLANG_FRONTEND_ANALYSISCONSUMER_H
+
#include <string>
#include <vector>
const AnalyzerOptions& Opts);
}
+
+#endif
#define LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H_
#include "clang/Basic/LangOptions.h"
+#include "clang/Frontend/AnalysisConsumer.h"
#include "clang/Frontend/CompileOptions.h"
#include "clang/Frontend/DependencyOutputOptions.h"
#include "clang/Frontend/DiagnosticOptions.h"
/// compiler, including data such as the include paths, the code generation
/// options, the warning flags, and so on.
class CompilerInvocation {
+ /// Options controlling the static analyzer.
+ AnalyzerOptions AnalyzerOpts;
+
/// Options controlling IRgen and the backend.
CompileOptions CompileOpts;
/// @name Option Subgroups
/// @{
+ AnalyzerOptions &getAnalyzerOpts() { return AnalyzerOpts; }
+ const AnalyzerOptions &getAnalyzerOpts() const {
+ return AnalyzerOpts;
+ }
+
CompileOptions &getCompileOpts() { return CompileOpts; }
const CompileOptions &getCompileOpts() const {
return CompileOpts;
Consumer.reset(CreateHTMLPrinter(OS.get(), PP));
break;
- case RunAnalysis: {
- AnalyzerOptions AnalyzerOpts;
- // FIXME: Move into CompilerInvocation.
- InitializeAnalyzerOptions(AnalyzerOpts);
+ case RunAnalysis:
Consumer.reset(CreateAnalysisConsumer(PP, CompOpts.getOutputFile(),
- AnalyzerOpts));
+ CompOpts.getAnalyzerOpts()));
break;
- }
case GeneratePCH: {
const std::string &Sysroot = CompOpts.getHeaderSearchOpts().Sysroot;
InitializeCompileOptions(Opts.getCompileOpts(), Target);
// Initialize language options.
- LangOptions LangInfo;
-
+ //
// FIXME: These aren't used during operations on ASTs. Split onto a separate
// code path to make this obvious.
if (LK != langkind_ast)
InitializeLangOptions(Opts.getLangOpts(), LK, Target,
Opts.getCompileOpts());
+ // Initialize the static analyzer options.
+ InitializeAnalyzerOptions(Opts.getAnalyzerOpts());
+
// Initialize the dependency output options (-M...).
InitializeDependencyOutputOptions(Opts.getDependencyOutputOpts());