[Analyzer] ScopeContext implementation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Analyzer] ScopeContext implementation

Дилян Палаузов via cfe-dev
Hello,
We have developed a static analyzer feature to handle scope enter/exit.
It may be useful to check variable lifetime. It may also solve some
issues pointed on "Lifetime checker" discussion
(http://lists.llvm.org/pipermail/cfe-dev/2015-December/046653.html). The
implementation of this feature is based on the patch that is currently
on the review (http://reviews.llvm.org/D16403).

In our implementation, local variables have ScopeLocalsSpaceRegion (a
special kind of MemorySpace) as their parent.

Before I'll put this on review, (it will take 2-3 weeks because I'm
going on a vacation), I want to ask some questions.

1. Should we eliminate StackLocalsSpaceRegion? As I understand, it
should be replaced by ScopeLocalsSpaceRegion.
2. Is there any activity on http://reviews.llvm.org/D16403? If no, I'm
going to fix the issues with this review since our patch strongly
depends on it.

--
Best regards,
Aleksei Sidorin
Software Engineer,
IMSWL-IMCG, SRR, Samsung Electronics

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Analyzer] ScopeContext implementation

Дилян Палаузов via cfe-dev
Hi Aleksei,

> On Apr 1, 2016, at 10:20 AM, Aleksei Sidorin via cfe-dev <[hidden email]> wrote:
>
> Hello,
> We have developed a static analyzer feature to handle scope enter/exit. It may be useful to check variable lifetime. It may also solve some issues pointed on "Lifetime checker" discussion (http://lists.llvm.org/pipermail/cfe-dev/2015-December/046653.html). The implementation of this feature is based on the patch that is currently on the review (http://reviews.llvm.org/D16403).

This is exciting!

> In our implementation, local variables have ScopeLocalsSpaceRegion (a special kind of MemorySpace) as their parent.
>
> Before I'll put this on review, (it will take 2-3 weeks because I'm going on a vacation), I want to ask some questions.
>
> 1. Should we eliminate StackLocalsSpaceRegion? As I understand, it should be replaced by ScopeLocalsSpaceRegion.

This seems reasonable to me as long as the checkers that query whether a variable is on the stack (StackAddrEscape checker, pthread_once checker) still work. I think Sean Eveson’s work on widening also relies on StackLocalsSpaceRegion to invalidate when widening a loop. I imagine these could be changed to use the new ScopeLocalsSpaceRegion.

> 2. Is there any activity on http://reviews.llvm.org/D16403? If no, I'm going to fix the issues with this review since our patch strongly depends on it.

To the best of my knowledge, no. It might be worth pinging Bhargava in D16403 just to make sure there is no duplication of effort.

Devin

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev