[PATCH] D16403: Add scope information to CFG

2018-03-06 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. Now, the cfg for this example: void test_for_implicit_scope() { for (A a; A b = a;) A c; } looks like this: F5874197: CFG-implicit-for.dot Repository: rL LLVM https://reviews.llvm.org/D16403 __

[PATCH] D16403: Add scope information to CFG

2018-03-06 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 137150. m.ostapenko added a comment. Rebased and updated. Fix the issue with ordering between ScopeEnds and implicit destructors. Repository: rL LLVM https://reviews.llvm.org/D16403 Files: include/clang/Analysis/AnalysisDeclContext.h include/cla

[PATCH] D16403: Add scope information to CFG

2018-02-20 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. In https://reviews.llvm.org/D16403#1001466, @NoQ wrote: > I poked Devin offline and we agreed that the overall approach is good to go. > Maxim, thank you for picking it up! > > We still don't have scopes for segments of code that don't have any variables > in them,

[PATCH] D16403: Add scope information to CFG

2018-02-20 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. In https://reviews.llvm.org/D16403#1011218, @NoQ wrote: > In https://reviews.llvm.org/D16403#1010096, @szepet wrote: > > > In https://reviews.llvm.org/D16403#992454, @NoQ wrote: > > > > > @szepet: so i see that `LoopExit` goes in the beginning of the cleanup > > > bl

[PATCH] D16403: Add scope information to CFG

2018-02-01 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 132393. m.ostapenko added a comment. Fix scope ends order (as discussed above) and adjust a testcase. Repository: rL LLVM https://reviews.llvm.org/D16403 Files: include/clang/Analysis/AnalysisDeclContext.h include/clang/Analysis/CFG.h include/c

[PATCH] D16403: Add scope information to CFG

2018-01-31 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. In https://reviews.llvm.org/D16403#992452, @NoQ wrote: > Thank you, this explanation looks very reasonable. > > All right, so right after the termination of the loop we have > > [B1] > 1: ForStmt (LoopExit) > 2: [B4.5].~A() (Implicit destructor) > 3: [B5.3].~A

[PATCH] D16403: Add scope information to CFG

2018-01-29 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. Actually upload the files. F5792949: CFG-scopes-destructors-loopexit.dot F5792948: CFG-scopes-loopexit-lifetime.dot Repository: rL LLVM https://reviews.llvm.org/D16403 ___

[PATCH] D16403: Add scope information to CFG

2018-01-29 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. Hi Artem, In https://reviews.llvm.org/D16403#989451, @NoQ wrote: > Hmm. @m.ostapenko @szepet @mgehre - I think it might be a good time to figure > out if `ScopeBegin`/`ScopeEnd`, `LoopEntrance`/`LoopExit`, `LifetimeEnds`, > `AutomaticObjectDtor` elements work nicel

[PATCH] D16403: Add scope information to CFG

2018-01-23 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 131091. m.ostapenko added a comment. Herald added a subscriber: llvm-commits. Rebased and ping. Repository: rL LLVM https://reviews.llvm.org/D16403 Files: include/clang/Analysis/AnalysisDeclContext.h include/clang/Analysis/CFG.h include/clang/S

[PATCH] D16403: Add scope information to CFG

2018-01-17 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 130183. m.ostapenko retitled this revision from "Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements" to "Add scope information to CFG". m.ostapenko added a comment. Some code cleanup + updated test case. https://reviews.ll

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2018-01-16 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 129985. m.ostapenko added a comment. Hi Devin, now I'm very sorry for a such long delay. Now I have a bunch of time to proceed development of this patch (if scope contexts are still needed, of course). Regarding to approach you suggested (reuse LocalScop

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2017-08-24 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 112547. m.ostapenko added a comment. Ping^4 Repository: rL LLVM https://reviews.llvm.org/D16403 Files: include/clang/Analysis/AnalysisContext.h include/clang/Analysis/CFG.h include/clang/StaticAnalyzer/Core/AnalyzerOptions.h lib/Analysis/Anal

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2017-08-16 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 111322. m.ostapenko added a comment. Ping^3 Repository: rL LLVM https://reviews.llvm.org/D16403 Files: include/clang/Analysis/AnalysisContext.h include/clang/Analysis/CFG.h include/clang/StaticAnalyzer/Core/AnalyzerOptions.h lib/Analysis/Anal

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2017-08-09 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 110329. m.ostapenko added a comment. Rebased and ping. Repository: rL LLVM https://reviews.llvm.org/D16403 Files: include/clang/Analysis/AnalysisContext.h include/clang/Analysis/CFG.h include/clang/StaticAnalyzer/Core/AnalyzerOptions.h lib/An

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2017-07-28 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 108644. m.ostapenko added a comment. Updated some comments. Could someone take a look please? Repository: rL LLVM https://reviews.llvm.org/D16403 Files: include/clang/Analysis/AnalysisContext.h include/clang/Analysis/CFG.h include/clang/StaticA

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2017-07-24 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 107894. m.ostapenko added a comment. Rebased and removed a bunch of stale changes. Also added a check for goto's: if we see GotoStmt and have cfg-scopes == true, make badCFG = true and retry without scopes enabled. This check will be removed once GotoStm

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2017-07-13 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. In https://reviews.llvm.org/D16403#808104, @NoQ wrote: > I think the remaining switch-related code seems to be about C++17 switch > condition variables, i.e. `switch (int x = ...)`(?) Yeah, exactly. I can remove it from this patch if it looks confusing. Repositor

[PATCH] D16403: Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements

2017-07-13 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 106408. m.ostapenko retitled this revision from "Add scope information to CFG" to "Add scope information to CFG for If/While/For/Do/Compound/CXXRangeFor statements". m.ostapenko added a comment. Updating the diff. I've dropped SwitchStmt support, let's im

[PATCH] D16403: Add scope information to CFG

2017-07-10 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. Hi Artem, I'm sorry for a long delay (nasty corporate issues). In https://reviews.llvm.org/D16403#789957, @NoQ wrote: > Maxim, totally thanks for picking this up! > > Could you explain the idea behind `shouldDeferScopeEnd`, maybe in a code > comment before the funct

[PATCH] D16403: Add scope information to CFG

2017-06-23 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 103719. m.ostapenko set the repository for this revision to rL LLVM. m.ostapenko added a project: clang. m.ostapenko added a comment. So, updating the diff. This is still a very experimental version and any feedback would be greatly appreciated. Current p

[PATCH] D34210: Add __has_feature(leak_sanitizer)

2017-06-14 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko added a comment. In https://reviews.llvm.org/D34210#780520, @fjricci wrote: > Currently, the way that we tell users to gate on sanitizer-specific behavior > is with `__has_feature(foo_sanitizer)`, as far as I know, it's the only way > to do so. LSan provides several API functions fo

[PATCH] D33941: [Driver] Add test to cover case when LSan is not supported

2017-06-06 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko created this revision. This commit adds a testcase for uncovered code paths in LSan options parsing logic in driver. Repository: rL LLVM https://reviews.llvm.org/D33941 Files: test/Driver/fsanitize.c Index: test/Driver/fsanitize.c

[PATCH] D31760: [lsan] Enable LSan on arm Linux, clang part

2017-04-10 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 94708. m.ostapenko added a project: Sanitizers. m.ostapenko added a comment. Add armeb and thumbeb for completeness. Just curious, does anyone use sanitizers in these targets? I see no public buildbots for armeb and thumbeb. Anyway, not a big deal of cour

[PATCH] D31760: [lsan] Enable LSan on arm Linux, clang part

2017-04-07 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 94489. m.ostapenko added a comment. Also check for thumb. Repository: rL LLVM https://reviews.llvm.org/D31760 Files: lib/Driver/ToolChains/Linux.cpp test/Driver/fsanitize.c Index: test/Driver/fsanitize.c

[PATCH] D31760: [lsan] Enable LSan on arm Linux, clang part

2017-04-06 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko created this revision. Herald added subscribers: rengolin, aemerson. This is a compiler part of https://reviews.llvm.org/D29586. Enable LSan on arm Linux. Repository: rL LLVM https://reviews.llvm.org/D31760 Files: lib/Driver/ToolChains/Linux.cpp test/Driver/fsanitize.c Ind

[PATCH] D29077: [lsan] Enable LSan for x86 Linux.

2017-01-25 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko updated this revision to Diff 85756. m.ostapenko added a comment. Add a test case. Repository: rL LLVM https://reviews.llvm.org/D29077 Files: lib/Driver/ToolChains.cpp test/Driver/fsanitize.c Index: test/Driver/fsanitize.c ===

[PATCH] D29077: [lsan] Enable LSan for x86 Linux.

2017-01-24 Thread Maxim Ostapenko via Phabricator via cfe-commits
m.ostapenko created this revision. m.ostapenko added a project: Sanitizers. This is a missed part of https://reviews.llvm.org/D28609. Enable LSan for x86 Linux in clang driver. Repository: rL LLVM https://reviews.llvm.org/D29077 Files: lib/Driver/ToolChains.cpp Index: lib/Driver/ToolCha