[PATCH] D12889: [Static Analyzer] Generics Checker: When an ObjC method returns a specialized object, track it properly.

Anna Zaks via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 15 17:48:17 PDT 2015


zaks.anna added inline comments.

================
Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:680
@@ +679,3 @@
+    return nullptr;
+
+  QualType ResultType = Method->getReturnType().substObjCTypeArgs(
----------------
From above:
 QualType StaticResultType = Method->getReturnType();

You could do 
 QualType ResultType = StaticResultType.substObjCTypeArgs(
      C, TypeArgs, ObjCSubstitutionContext::Result);

================
Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:688
@@ -695,2 +687,3 @@
 /// Validate that the return type of a message expression is used correctly.
-void DynamicTypePropagation::checkReturnType(
+/// Returns true in case an error is detected.
+bool DynamicTypePropagation::checkReturnType(
----------------
Should the method be renamed to reflect this new behavior?

================
Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:807
@@ +806,3 @@
+/// This method is also used to infer the type information for the return
+/// types.
+// TODO: right now it only tracks generic types. Extend this to track every
----------------
and to diagnose..


http://reviews.llvm.org/D12889





More information about the cfe-commits mailing list