[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-18 Thread Gabor Marton via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. martong marked an inline comment as done. Closed by commit rG56b9b97c1ef5: [clang][analyzer][ctu] Make CTU a two phase analysis (authored by martong). Changed prior

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-18 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/docs/ReleaseNotes.rst:352 + reports are lost compared to single-TU analysis, the lost reports are highly + likely to be false positives. xazax.hun wrote: > I wonder if

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/docs/ReleaseNotes.rst:352 + reports are lost compared to single-TU analysis, the lost reports are highly + likely to be false positives. I wonder if you also want to mention that this still finds most of the

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-17 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:446 +} +const bool BState = State->contains(D); +if (!BState) { // This is the first time we see this foreign function.

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-17 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 430047. martong added a comment. - Update ReleaseNotes.rst Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123773/new/ https://reviews.llvm.org/D123773 Files: clang/docs/ReleaseNotes.rst

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-17 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 430023. martong marked an inline comment as done. martong added a comment. - Change ctuBifurcate to use bool in GDM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123773/new/ https://reviews.llvm.org/D123773

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-17 Thread Gabor Marton via Phabricator via cfe-commits
martong marked an inline comment as done. martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:446 +} +const bool BState = State->contains(D); +if (!BState) { // This is the first time we see this foreign function.

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-13 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:446 +} +const bool BState = State->contains(D); +if (!BState) { // This is the first time we see this foreign function. martong wrote: > xazax.hun

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-13 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 429172. martong marked 7 inline comments as done. martong added a comment. - Change -mul to -pct - Change default values to ctu-max-nodes-pct = 50 and ctu-max-nodes-min = 1 - Rename isCTUInFirtstPhase to isSecondPhaseCTU and invert the condition - Check

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-13 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 15 inline comments as done. martong added inline comments. Comment at: clang/include/clang/AST/ASTImporterSharedState.h:83 + + void setNewDecl(Decl *ToD) { NewDecls.insert(ToD); } }; whisperity wrote: > (The naming of this function feels a bit

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-12 Thread Whisperity via Phabricator via cfe-commits
whisperity added inline comments. Comment at: clang/include/clang/AST/ASTImporterSharedState.h:83 + + void setNewDecl(Decl *ToD) { NewDecls.insert(ToD); } }; (The naming of this function feels a bit odd. `markAsNewDecl` or just `markNewDecl`?)

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-12 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 3 inline comments as done. martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:116 + const bool Foreign = false; // From CTU. + xazax.hun wrote: > martong wrote: > > martong wrote: > > >

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. This revision is now accepted and ready to land. Overall looks good to me. I wish some parts would be simpler but it looks like sometimes it is not easy to extend the current code and we might need to do some refactoring at some

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:116 + const bool Foreign = false; // From CTU. + martong wrote: > martong wrote: > > xazax.hun wrote: > > > I feel that we use different terms for

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:446 +} +const bool BState = State->contains(D); +if (!BState) { // This is the first time we see this foreign function. xazax.hun wrote: > martong

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-11 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp:446 +} +const bool BState = State->contains(D); +if (!BState) { // This is the first time we see this foreign function. martong wrote: > xazax.hun

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-09 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:116 + const bool Foreign = false; // From CTU. + martong wrote: > xazax.hun wrote: > > I feel that we use different terms for the imported

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-09 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 428055. martong marked 8 inline comments as done. martong added a comment. Herald added a reviewer: shafik. - Add explanatory comment to RuntimeDefinition::Foreign field - Changed the return value from bool to void in ctuBifurcate and in inlineCall - Add

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-06 Thread Gabor Marton via Phabricator via cfe-commits
martong marked 4 inline comments as done. martong added a comment. Thanks for the review Gabor, I'll update soon and hope I could answer your questions. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:116 + const bool Foreign = false; // From

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-05-06 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added inline comments. Comment at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h:116 + const bool Foreign = false; // From CTU. + I feel that we use different terms for the imported declarations. Sometimes we call them `new`,

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-04-29 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 426037. martong added a comment. - Add more explanatory comments to the values of ctu-phase1-inlining - Fix typo in comments in ctu-on-demand-parsing tests - Remove stale comment, config options are desribed elsewhere Repository: rG LLVM Github Monorepo

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/test/Analysis/ctu-on-demand-parsing.c:23 +// FIXME On-demand ctu should be tested in the very same file that we have for +// the PCH version, but with a different a different verify prefix (e.g. +// -verfiy=on-demanc-ctu)

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 425784. martong added a comment. - Chosing the correct baseline this time Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123773/new/ https://reviews.llvm.org/D123773 Files:

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-04-28 Thread Gabor Marton via Phabricator via cfe-commits
martong updated this revision to Diff 425782. martong added a comment. - Add an option to config the inlining mode during the first phase - Change the `ctu-main.c[pp]` tests to have a RUN line with this new config option that mimics the old ctu implementation's behavor. - Change the

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-04-14 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun added a comment. > Make CTU a two phase analysis At this point maybe it will be a three phase, as we might dump the ASTs/create index in phase 1 :) > During this phase, if we find a foreign function (that could be inlined from > another TU) then we don’t inline that immediately, we

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-04-14 Thread Gabor Marton via Phabricator via cfe-commits
martong added inline comments. Comment at: clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:167 + // Let CTU run as many steps we had in the single TU run. + // However, we need at least some minimal value to pass those lit tests that + // report a bug only in the CTU mode.

[PATCH] D123773: [clang][analyzer][ctu] Make CTU a two phase analysis

2022-04-14 Thread Gabor Marton via Phabricator via cfe-commits
martong created this revision. martong added reviewers: steakhal, NoQ. Herald added subscribers: manas, ASDenysPetrov, gamesh411, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun. Herald added a reviewer: Szelethus. Herald added a