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

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 12:51:35 PDT 2015


xazax.hun marked an inline comment as done.

================
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
----------------
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.


http://reviews.llvm.org/D12916





More information about the cfe-commits mailing list