Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-06-13 Thread Gábor Horváth via cfe-commits
xazax.hun closed this revision. xazax.hun added a comment. This was committad as the part of http://reviews.llvm.org/rL272529 http://reviews.llvm.org/D16044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailma

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-16 Thread Alexander Droste via cfe-commits
Alexander_Droste marked 18 inline comments as done. Alexander_Droste added a comment. http://reviews.llvm.org/D16044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-16 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. > The memory region for the va_list that was obtained from the analyzer in same > case was indeed an element region in the va_list checker. I fixed this issue, > and now it works properly. Then this patch might be ready to commit. :) http://reviews.llvm.org/

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-15 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D16044#401130, @Alexander_Droste wrote: > Might the problem be in the va_list checker? > Obviously the va_list variable is identified as an ElementRegion what seems > not to be correct. > Only if the passed region is an ElementRegion indic

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-14 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. I will look into it tomorrow. http://reviews.llvm.org/D16044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-14 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. Might the problem be in the va_list checker? Obviously the va_list variable is identified as an ElementRegion what seems not to be correct. Only if the passed region is an ElementRegion indices get appended. http://reviews.llvm.org/D16044 __

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-14 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. > Looking at the code it seems that this data structure: > typedef SmallVector RegionVector; > tricks the function into rating the MemRegion as an ElementRegion. That's not the problem. I'm using the same data structure in the MPI-Checker patch. http://revi

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-14 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. Looking at the code it seems that this data structure: `typedef SmallVector RegionVector;` tricks the function into rating the MemRegion as an ElementRegion. http://reviews.llvm.org/D16044 ___ cfe-commits mailing li

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-14 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. Sure, the test case of http://reviews.llvm.org/D15227 is faiing because of this. In test/Analysis/valist-unterminated.c, line 10 Initialized va_list 'va[0]' is leaked is emitted instead of Initialized va_list 'va' is leaked http://reviews.llvm.org/D16044 __

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-14 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. > I tested this patch using http://reviews.llvm.org/D15227 > Unfortunately for non-array variables the getDescriptiveName returned > var_name[0]. Note the spurious [0] part. > Could you look into that? Could you provide a code example where this effect turns

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-14 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. I tested this patch using http://reviews.llvm.org/D15227 Unfortunately for non-array variables the getDescriptiveName returned var_name[0]. Note the spurious [0] part. Could you look into that? http://reviews.llvm.org/D16044 __

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-12 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. In http://reviews.llvm.org/D16044#398463, @zaks.anna wrote: > Can other checkers use this function? I am Ok with this being committed with > limited coverage. Once I rebase http://reviews.llvm.org/D15227, it will provide us with the limited coverage. In case that pa

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-12 Thread Anna Zaks via cfe-commits
zaks.anna added a comment. Gabor, Can other checkers use this function? I am Ok with this being committed with limited coverage. http://reviews.llvm.org/D16044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/m

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-12 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. > What is the status of this? > As far as I understand it is blocked on that there is no checker that we > could use to test this function with unknown variables as indexes? Yes, this is blocked due to the MPI-Checker dependency. The best thing I can offer at

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-04-12 Thread Gábor Horváth via cfe-commits
xazax.hun added a comment. What is the status of this? As far as I understand it is blocked on that there is no checker that we could use to test this function with unknown variables as indexes? http://reviews.llvm.org/D16044 ___ cfe-commits maili

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-30 Thread Alexander Droste via cfe-commits
Alexander_Droste added inline comments. Comment at: lib/StaticAnalyzer/Core/MemRegion.cpp:653 @@ +652,3 @@ +// name by calling 'getDescriptiveName' recursively. +else { + std::string Idx = ER->getDescriptiveName(false); Alexander_Droste wrote: > zaks.

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-30 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. > It's a bug in the checker. dyn_cast should not be called on a null pointer. > You could either check for nun or call dyn_cast_or_null. Thanks for pointing this out! Adding guards that check for `nullptr` fixed the problem. http://reviews.llvm.org/D16044

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-30 Thread Anna Zaks via cfe-commits
zaks.anna added a comment. It's a bug in the checker. dyn_cast should not be called on a null pointer. You could either check for nun or call dyn_cast_or_null. http://reviews.llvm.org/D16044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org h

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-30 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. Here's the crash report that appears in case of the unknown function body: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 clang 0x000105f544b7 abort + 39 (Signals.inc:440) 1 clang

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-30 Thread Alexander Droste via cfe-commits
Alexander_Droste added inline comments. Comment at: lib/StaticAnalyzer/Core/MemRegion.cpp:653 @@ +652,3 @@ +// name by calling 'getDescriptiveName' recursively. +else { + std::string Idx = ER->getDescriptiveName(false); zaks.anna wrote: > xazax.hun wr

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-30 Thread Anna Zaks via cfe-commits
zaks.anna added inline comments. Comment at: lib/StaticAnalyzer/Core/MemRegion.cpp:653 @@ +652,3 @@ +// name by calling 'getDescriptiveName' recursively. +else { + std::string Idx = ER->getDescriptiveName(false); xazax.hun wrote: > Alexander_Droste wr

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-30 Thread Gábor Horváth via cfe-commits
xazax.hun added inline comments. Comment at: lib/StaticAnalyzer/Core/MemRegion.cpp:653 @@ +652,3 @@ +// name by calling 'getDescriptiveName' recursively. +else { + std::string Idx = ER->getDescriptiveName(false); Alexander_Droste wrote: > I wasn't abl

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-30 Thread Alexander Droste via cfe-commits
Alexander_Droste added inline comments. Comment at: lib/StaticAnalyzer/Core/MemRegion.cpp:653 @@ +652,3 @@ +// name by calling 'getDescriptiveName' recursively. +else { + std::string Idx = ER->getDescriptiveName(false); I wasn't able to build a test c

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-21 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. I submitted the sourceRange patch here: http://reviews.llvm.org/D18309 If also this patch would get committed as part of the package, there would be no need for an incremental commit procedure. http://reviews.llvm.org/D16044 _

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-13 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. > I'd be fine if we test this function with the usual regression tests by > observing the output of the MPI checker. We could update that test with more > checks once the function is updated. > With that approach, you'd be committing both patches at the same ti

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-13 Thread Anna Zaks via cfe-commits
zaks.anna added a comment. I'd be fine if we test this function with the usual regression tests by observing the output of the MPI checker. We could update that test with more checks once the function is updated. With that approach, you'd be committing both patches at the same time. http://re

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-13 Thread Alexander Droste via cfe-commits
Alexander_Droste added inline comments. Comment at: test/Analysis/MemRegion.cpp:3 @@ +2,3 @@ + +#include "MPIMock.h" + The problem about these tests is that they introduce a cyclic commit dependency. MPI-Checker depends on `getDescriptiveName`. `getDescriptiveNam

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-13 Thread Alexander Droste via cfe-commits
Alexander_Droste updated this revision to Diff 50551. Alexander_Droste added a comment. - create `MemRegion.cpp`, in order to set up test cases for `getDescriptiveName` http://reviews.llvm.org/D16044 Files: include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h lib/StaticAnalyzer/Core/

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-09 Thread Alexander Droste via cfe-commits
Alexander_Droste added a comment. Thanks for pointing this out. What's actually the best way to test the function? If I test this function with an integration test, I need to rely on a checker which uses the function to output diagnostics. Is it possible to test this with a unit test? My assump

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-09 Thread Anna Zaks via cfe-commits
zaks.anna added a comment. I thunk the closest we have is region-store* tests, which is not quite the same. Feel free to add a new test. http://reviews.llvm.org/D16044 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cg

Re: [PATCH] D16044: getDescriptiveName() for MemRegion

2016-03-09 Thread Alexander Droste via cfe-commits
Alexander_Droste retitled this revision from "getVariableName() for MemRegion" to "getDescriptiveName() for MemRegion". Alexander_Droste updated the summary for this revision. Alexander_Droste updated this revision to Diff 50114. Alexander_Droste added a comment. Looking at the `printPretty` impl