[PATCH] D56632: [analyzer] Track region liveness only through base regions.

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 16 03:59:22 PST 2019


xazax.hun accepted this revision.
xazax.hun added a comment.

Thanks, LGTM! It is interesting to see if we need to traverse all the super regions in `scanReachableSymbols`, but if we need to change something there, I would prefer that to be in a separate patch. 
If visiting the whole super region chain proved to be redundant I would recommend removing it for clarity regardless of having a performance impact.

If you find out the reason why we need `markElementIndicesLive`, documenting that would also be useful. But it is also independent of this change. 
Maybe something like we could learn new information regarding the indices after they are dead?
Like:

  void f(int i, char *c) {
      char e = c[i];
      if (strlen(c) == 5) {
           // The value of `i` is no longer used, could be dead
           // but we did learn something new. Assuming no UB, `i <= 5` (if null terminated).
           // So maybe having symbols for indices around for representing the info above is useful?
      }
  }

One fundamental question is, do we have one property here or two?
Maybe the liveness analysis we use for leaks (and other purposes?),
and the garbage collection of symbols are inherently two different kind of things that are only slightly related?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56632/new/

https://reviews.llvm.org/D56632





More information about the cfe-commits mailing list