r336755 - [analyzer] Partial revert of https://reviews.llvm.org/D49050

George Karpenkov via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 10 18:58:08 PDT 2018


Author: george.karpenkov
Date: Tue Jul 10 18:58:08 2018
New Revision: 336755

URL: http://llvm.org/viewvc/llvm-project?rev=336755&view=rev
Log:
[analyzer] Partial revert of https://reviews.llvm.org/D49050

Modified:
    cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp?rev=336755&r1=336754&r2=336755&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp Tue Jul 10 18:58:08 2018
@@ -56,12 +56,6 @@ class DynamicTypePropagation:
                     check::PostStmt<CXXNewExpr>,
                     check::PreObjCMessage,
                     check::PostObjCMessage > {
-private:
-  /// This value is set to true, when the Generics checker is turned on.
-  bool CheckGenerics;
-public:
-  DynamicTypePropagation(bool CheckGenerics)
-      : CheckGenerics(CheckGenerics) {}
   const ObjCObjectType *getObjectTypeForAllocAndNew(const ObjCMessageExpr *MsgE,
                                                     CheckerContext &C) const;
 
@@ -113,6 +107,9 @@ public:
   void checkDeadSymbols(SymbolReaper &SR, CheckerContext &C) const;
   void checkPreObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const;
   void checkPostObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const;
+
+  /// This value is set to true, when the Generics checker is turned on.
+  DefaultBool CheckGenerics;
 };
 } // end anonymous namespace
 
@@ -998,9 +995,11 @@ DynamicTypePropagation::GenericsBugVisit
 
 /// Register checkers.
 void ento::registerObjCGenericsChecker(CheckerManager &mgr) {
-  mgr.registerChecker<DynamicTypePropagation>(/*CheckGenerics=*/true);
+  DynamicTypePropagation *checker =
+      mgr.registerChecker<DynamicTypePropagation>();
+  checker->CheckGenerics = true;
 }
 
 void ento::registerDynamicTypePropagation(CheckerManager &mgr) {
-  mgr.registerChecker<DynamicTypePropagation>(/*CheckGenerics=*/false);
+  mgr.registerChecker<DynamicTypePropagation>();
 }




More information about the cfe-commits mailing list