[PATCH] D12916: [Static Analyzer] Use generics related information to infer dynamic types.

Anna Zaks via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 17:38:17 PDT 2015


zaks.anna added inline comments.

================
Comment at: lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp:871
@@ +870,3 @@
+  if (RetRegion && !State->get<DynamicTypeMap>(RetRegion)) {
+    // TODO: we have duplicated information in DynamicTypeMap and
+    // MostSpecializedTypeArgsMap. We should only store anything in the later if
----------------
xazax.hun wrote:
> You are right, I am added the check and the comment.
> The dynamicTypePropagationOnCasts should not cause any trouble, it only updates the dynamic type map, when there is new and better information available. See getBetterObjCType function.
> 
> We do not need to call getBetterObjCType here, because if there were no information yet, we will populate the table, if a function was inlined and there is a cast before return getBetterObjCType was already called there, so it is safe to just skip updating the DynamicTypeMap.
> We do not need to call getBetterObjCType here, because if there were no information yet, we will populate the table, if a > function was inlined and there is a cast before return getBetterObjCType was already called there, so it is safe to just 
> skip updating the DynamicTypeMap.

You should explain this in the comment.


http://reviews.llvm.org/D12916





More information about the cfe-commits mailing list