[cfe-commits] r126306 - in /cfe/trunk: examples/wpa/clang-wpa.cpp include/clang/StaticAnalyzer/Core/CheckerManager.h include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Tue Feb 22 23:19:14 PST 2011
Author: akirtzidis
Date: Wed Feb 23 01:19:14 2011
New Revision: 126306
URL: http://llvm.org/viewvc/llvm-project?rev=126306&view=rev
Log:
[analyzer] Add LangOptions in CheckerManager.
Modified:
cfe/trunk/examples/wpa/clang-wpa.cpp
cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h
cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h
cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
Modified: cfe/trunk/examples/wpa/clang-wpa.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/wpa/clang-wpa.cpp?rev=126306&r1=126305&r2=126306&view=diff
==============================================================================
--- cfe/trunk/examples/wpa/clang-wpa.cpp (original)
+++ cfe/trunk/examples/wpa/clang-wpa.cpp Wed Feb 23 01:19:14 2011
@@ -155,7 +155,8 @@
Opts.CheckersControlList.push_back(std::make_pair("cocoa", true));
llvm::OwningPtr<ento::CheckerManager> checkerMgr;
- checkerMgr.reset(ento::registerCheckers(Opts, PP.getDiagnostics()));
+ checkerMgr.reset(ento::registerCheckers(Opts, PP.getLangOptions(),
+ PP.getDiagnostics()));
using namespace clang::ento;
AnalysisManager AMgr(TU->getASTContext(), PP.getDiagnostics(),
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h?rev=126306&r1=126305&r2=126306&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h Wed Feb 23 01:19:14 2011
@@ -14,6 +14,7 @@
#ifndef LLVM_CLANG_SA_CORE_CHECKERMANAGER_H
#define LLVM_CLANG_SA_CORE_CHECKERMANAGER_H
+#include "clang/Basic/LangOptions.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
@@ -77,9 +78,14 @@
};
class CheckerManager {
+ const LangOptions LangOpts;
+
public:
+ CheckerManager(const LangOptions &langOpts) : LangOpts(langOpts) { }
~CheckerManager();
+ const LangOptions &getLangOptions() const { return LangOpts; }
+
typedef void *CheckerRef;
typedef CheckerFn<> CheckerDtor;
Modified: cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h?rev=126306&r1=126305&r2=126306&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h Wed Feb 23 01:19:14 2011
@@ -12,12 +12,15 @@
namespace clang {
class AnalyzerOptions;
+ class LangOptions;
class Diagnostic;
namespace ento {
class CheckerManager;
-CheckerManager *registerCheckers(const AnalyzerOptions &opts,Diagnostic &diags);
+CheckerManager *registerCheckers(const AnalyzerOptions &opts,
+ const LangOptions &langOpts,
+ Diagnostic &diags);
} // end ento namespace
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp?rev=126306&r1=126305&r2=126306&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Wed Feb 23 01:19:14 2011
@@ -175,7 +175,8 @@
virtual void Initialize(ASTContext &Context) {
Ctx = &Context;
- checkerMgr.reset(registerCheckers(Opts, PP.getDiagnostics()));
+ checkerMgr.reset(registerCheckers(Opts, PP.getLangOptions(),
+ PP.getDiagnostics()));
Mgr.reset(new AnalysisManager(*Ctx, PP.getDiagnostics(),
PP.getLangOptions(), PD,
CreateStoreMgr, CreateConstraintMgr,
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp?rev=126306&r1=126305&r2=126306&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp Wed Feb 23 01:19:14 2011
@@ -25,8 +25,9 @@
using namespace ento;
CheckerManager *ento::registerCheckers(const AnalyzerOptions &opts,
+ const LangOptions &langOpts,
Diagnostic &diags) {
- llvm::OwningPtr<CheckerManager> checkerMgr(new CheckerManager());
+ llvm::OwningPtr<CheckerManager> checkerMgr(new CheckerManager(langOpts));
llvm::SmallVector<CheckerOptInfo, 8> checkerOpts;
for (unsigned i = 0, e = opts.CheckersControlList.size(); i != e; ++i) {
More information about the cfe-commits
mailing list