[PATCH] D52795: [analyzer][PlistMacroExpansion] Part 3.: Macro arguments are expanded

2018-10-16 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:677 +/// need to expanded further when it is nested inside another macro. +class MacroArgMap : public std::map { +public: george.karpenkov wrote: > Please don't do this, inh

[PATCH] D52795: [analyzer][PlistMacroExpansion] Part 3.: Macro arguments are expanded

2018-10-16 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:677 +/// need to expanded further when it is nested inside another macro. +class MacroArgMap : public std::map { +public: Szelethus wrote: > george.karpenkov wrote: > > Plea

[PATCH] D53296: [analyzer] New flag to print all -analyzer-config options

2018-10-16 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 169925. Szelethus edited the summary of this revision. Szelethus added a comment. Herald added a subscriber: nhaehnle. Using `llvm::formatted_raw_ostream` to drastically simplify the previous solution. The actual output changed a little bit too, now I'm pr

[PATCH] D53296: [analyzer] New flag to print all -analyzer-config options

2018-10-16 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 169927. Szelethus edited the summary of this revision. Szelethus added a comment. Added a test. https://reviews.llvm.org/D53296 Files: include/clang/Driver/CC1Options.td include/clang/StaticAnalyzer/Core/AnalyzerOptions.h include/clang/StaticAnalyze

[PATCH] D52988: [analyzer][PlistMacroExpansion] Part 5.: Support for # and ##

2018-10-17 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. I verified this project on tmux, which uses the preprocessor very heavily. It works perfectly, and doesn't crash anywhere despite the **very** liberal use of asserts. In https://reviews.llvm.org/D52988#1267382, @whisperity wrote: > Looks good. > > What happens if the

[PATCH] D51866: [analyzer][UninitializedObjectChecker] New flag to ignore guarded uninitialized fields

2018-10-17 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Herald added subscribers: dkrupp, donat.nagy. Ping https://reviews.llvm.org/D51866 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52988: [analyzer][PlistMacroExpansion] Part 5.: Support for # and ##

2018-10-18 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170073. Szelethus added a comment. Fixed an issue where if `##` had spaces around it, those spaces weren't removed. https://reviews.llvm.org/D52988 Files: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp test/Analysis/Inputs/expected-plists/plist-macros-w

[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

2018-10-18 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 3 inline comments as done. Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Core/AnalyzerOptions.cpp:469 +DisplayMacroExpansions = +getBooleanOption("expand-macros", /*Default=*/false); + return DisplayMacroExpansions.getValue(); -

[PATCH] D53276: [analyzer][NFC] Fix some incorrect uses of -analyzer-config options

2018-10-20 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170315. Szelethus edited the summary of this revision. Szelethus added a comment. Herald added a subscriber: mgorny. Added two more fixes, and added this to the summary: - `lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp` and `lib/StaticAnalyzer/Chec

[PATCH] D53276: [analyzer][NFC] Fix some incorrect uses of -analyzer-config options

2018-10-20 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp:1401-1402 checker->IsAggressive = - mgr.getAnalyzerOptions().getBooleanOption("AggressiveReport", false); + mgr.getAnalyzerOptions().getBooleanOption("AggressiveReport",

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-10-20 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170318. Szelethus added a comment. Removed doxygen comments, rebased to `D53276`. Please don't mind me saying this, but damn that's one pretty .def file compared to the mess that `AnalyzerOptions` currently is :). https://reviews.llvm.org/D53277 Files:

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-10-20 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. In https://reviews.llvm.org/D53277#1269960, @NoQ wrote: > I think this is awesome o_o Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.def:386 + +ANALYZER_OPTION_WITH_FN(StringRef, ModelPath, "model-path", "", "", +

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170333. Szelethus added a comment. Split `ANALYZER_OPTION_WITH_FN` up to - `ANALYZER_OPTION_GEN_FN` - `ANALYZER_OPTION_GEN_FN_DEPENDS_ON_USER_MODE` and added some `#error` directives to make it harder to misuse the .def file. https://reviews.llvm.org/D53

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.def:386 + +ANALYZER_OPTION_WITH_FN(StringRef, ModelPath, "model-path", "", "", +getModelPath) Szelethus wrote: > Found the use for this here: >

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170343. Szelethus added a comment. Added default value to `ANALYZER_OPTION` and split it upto - `ANALYZER_OPTION` and - `ANALYZER_OPTION_DEPENDS_ON_USER_MODE`. The `TYPE` entry only holds `bool`, `unsigned` and `StringRef now. These things will make follo

[PATCH] D53274: [analyzer][NFC] Fix inconsistencies in AnalyzerOptions

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Szelethus marked 3 inline comments as done. Closed by commit rL344870: [analyzer][NFC] Fix inconsistencies in AnalyzerOptions (authored by Szelethus, committed by ). Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, george.karpenkov, rnkovacs, xazax.hun, MTC. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. Herald added a reviewer: teemperor. One of the reasons why `AnalyzerOptions` is s

[PATCH] D52969: [analyzer][www] Update alpha_checks.html

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344878: [analyzer][www] Update alpha_checks.html (authored by Szelethus, committed by ). Herald added subscribers: llvm-commits, dkrupp, donat.nagy. Changed prior to commit: https://reviews.llvm.org/D52

[PATCH] D51531: [analyzer][UninitializedObjectChecker] Uninit regions are only reported once

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Herald added a subscriber: dkrupp. Ping^5 :) https://reviews.llvm.org/D51531 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51531: [analyzer][UninitializedObjectChecker] Uninit regions are only reported once

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. As I understood it, your objection was that we could collect already reported regions in a global set stored in the checker objects, but I suspect it's impossible to implement (very difficult to see when a pointer is dangling etc). https://reviews.llvm.org/D51531

[PATCH] D51300: [analyzer][UninitializedObjectChecker] No longer using nonloc::LazyCompoundVal

2018-10-21 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL344879: [analyzer][UninitializedObjectChecker] No longer using nonloc::LazyCompoundVal (authored by Szelethus, committed by ). Herald added subscribers: llvm-commits, dkrupp, donat.nagy. Changed prior to

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-10-22 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170417. Szelethus added a comment. - Removed redundant information (like the type or default value of the command line argument), these are now auto-generated in followup patches - Added description for `"model-path"`. https://reviews.llvm.org/D53277 Fil

[PATCH] D53296: [analyzer] New flag to print all -analyzer-config options

2018-10-22 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170432. Szelethus edited the summary of this revision. Szelethus added a comment. Fixes according to inline comments, type and default value are generated now. https://reviews.llvm.org/D53296 Files: include/clang/Driver/CC1Options.td include/clang/Sta

[PATCH] D53296: [analyzer] New flag to print all -analyzer-config options

2018-10-22 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170438. https://reviews.llvm.org/D53296 Files: include/clang/Driver/CC1Options.td include/clang/StaticAnalyzer/Core/AnalyzerOptions.h include/clang/StaticAnalyzer/Frontend/FrontendActions.h lib/Frontend/CompilerInvocation.cpp lib/FrontendTool/Exec

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-10-22 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. > (though I would also prefer if even checkers could pre-register their options > somehow) Good news, I've also successfully modified the tblgen file `Checkers.td` to be able to register checker options (it took wy more effort and I thought it'd take), so a list

[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

2018-10-22 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170509. Szelethus added a comment. Added a new `macro_expansions` key on the same level at `path` and `notes`, under which the macro expansions are listed, as suggested by @NoQ. There were a couple ways to make this happen. I could've changed how macro pi

[PATCH] D53076: [analyzer] Enhance ConditionBRVisitor to write out more information

2018-10-23 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h:182 + /// constraint being changed. + bool isChanged(const Stmt *Cond, StringRef Message) { +ConstraintMap::iterator I = Constraints.find(Cond); ---

[PATCH] D53543: [analyzer] MallocChecker: pr39348: Realize that sized delete isn't a custom delete.

2018-10-24 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:727 - // Skip all operator new/delete methods. - if (isa(FD)) -return false; - - // Return true if tested operator is a standard placement nothrow operator. - if (FD->getNumParams

[PATCH] D53069: [analyzer][www] Update avaible_checks.html

2018-10-24 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 170920. Szelethus edited the summary of this revision. https://reviews.llvm.org/D53069 Files: www/analyzer/available_checks.html Index: www/analyzer/available_checks.html === --- www/analyze

[PATCH] D53069: [analyzer][www] Update avaible_checks.html

2018-10-24 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 14 inline comments as done. Szelethus added inline comments. Comment at: www/analyzer/available_checks.html:459 + george.karpenkov wrote: > Spurious newline Actually, in this section of the code, entries are separated with 2 newlines. But it

[PATCH] D53655: [ASTImporter] Fix redecl chain of classes and class templates

2018-10-24 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. I can't add anything meaningful to the conversation, but I spotted some nits, so here they are. Comment at: include/clang/ASTMatchers/ASTMatchers.h:1150 +/// \endcode +/// fieldDecl() +/// matches 'a'. Did you mean to write `indire

[PATCH] D53069: [analyzer][www] Update avaible_checks.html

2018-10-24 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 2 inline comments as done. Szelethus added inline comments. Comment at: www/analyzer/available_checks.html:1119 + + + george.karpenkov wrote: > Top of the checker file has a somewhat reasonable description: > > // A checker for detecting leaks r

[PATCH] D53280: [analyzer] Emit a warning for unknown -analyzer-config options

2018-10-24 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus planned changes to this revision. Szelethus added a comment. Since I've dug myself quite deep into the refactoring effort, I realized that there are more elegant ways of achieving this, should I hammer `AnalyzerOptions` for long enough. I'll probably change everything but the revision

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171060. Szelethus edited the summary of this revision. Szelethus added a comment. This diff has numerous changed to the last, but it's all "cosmetic", the actual logic is untouched. - Added documentation as @xazax.hun suggested - Removed `getIntegerOption`

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 3 inline comments as done. Szelethus added a comment. Changing asserts to warnings will be delivered in a followup patch. https://reviews.llvm.org/D53483 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/

[PATCH] D53692: [analyzer] Evaluate all non-checker config options before analysis

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: xazax.hun, NoQ, george.karpenkov, MTC, rnkovacs. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, mgrang, szepet, whisperity. Szelethus added a dependency: D53483: [analyzer] Restrict AnalyzerOptions'

[PATCH] D53692: [analyzer] Evaluate all non-checker config options before analysis

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. The reason why I removed the getter functions and went ahead with the gigantic refactor is that getter functions actually changed the state of `AnalyzerOptions`, as they were responsible with the initialization of each option. Now, in the .def file, not all options ha

[PATCH] D53692: [analyzer] Evaluate all non-checker config options before analysis

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171094. Szelethus edited the summary of this revision. https://reviews.llvm.org/D53692 Files: include/clang/StaticAnalyzer/Core/AnalyzerOptions.def include/clang/StaticAnalyzer/Core/AnalyzerOptions.h lib/Frontend/CompilerInvocation.cpp lib/StaticAna

[PATCH] D51866: [analyzer][UninitializedObjectChecker] New flag to ignore guarded uninitialized fields

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus planned changes to this revision. Szelethus added a comment. Hmm, I'll investigate the `assert` issue @NoQ mentioned before moving forward. Comment at: lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:502 + + auto AssertM = callExpr(cal

[PATCH] D53692: [analyzer] Evaluate all non-checker config options before analysis

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. What are the feelings on moving some functions to the header file? That's the one thing I'm unsure about regarding this patch. I could've moved them to `CompilerInvocation.cpp`, but I since I plan on making `ConfigTable` private, `CompilerInvocation` needs to be a fri

[PATCH] D53276: [analyzer][NFC] Fix some incorrect uses of -analyzer-config options

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171130. Szelethus added a comment. `RetainCountChecker` now gets it's option when registering, like every other checker. `RetainCountChecker` stored a reference to `AnalyzerOptions`, evaluated an option during construction, and one later down the line. Th

[PATCH] D53276: [analyzer][NFC] Fix some incorrect uses of -analyzer-config options

2018-10-25 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171141. Szelethus added a comment. - Added description as @george.karpenkov mentioned. Thanks! I guess it's up to @NoQ whether he and @dcoughlin are okay with making some options checker options. https://reviews.llvm.org/D53276 Files: include/clang/St

[PATCH] D53754: [Analyzer] Skip symbolic regions based on conjured symbols in comparison of the containers of iterators

2018-10-26 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. I wonder whether a method in `MemRegion` called `isSameRegion` or `isSurelySameRegion` would be better. I think it's likely that there are (or will be) checkers that would do similar things. Maybe something like this? bool MemRegion::isSurelySameRegion(const MemReg

[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

2018-10-26 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus planned changes to this revision. Szelethus added a comment. @xazax.hun observed that the way `diagnostics` looks like is this: diagnostics report 1 notes macro_expansions path executed_lines report 2 ... Bt, if I didn't insist on this struct

[PATCH] D52984: [analyzer] Checker reviewer's checklist

2018-10-28 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. One more thing. From what I've seen, new checkers are in an overwhelming majority (again, from what **I've** seen) made by beginners, so I'd propose to include comments in checkers that are at least in part understandable by a beginner. I don't mean to make make 60%

[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker

2018-10-28 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Please reupload with full context. (https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface) https://reviews.llvm.org/D33672 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.ll

[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. I think is good to go! Please wait on @xazax.hun or @NoQ to have the final say (it's been a while since this revision was accepted by them), but for a work-in-progress alpha checker, I like what I'm seeing. Comment at: lib/StaticAnalyzer/Checkers/En

[PATCH] D53810: [analyzer][NFC] Refactor PlistDiagnostics to use a class instead of passing 9 parameters around

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: xazax.hun, rnkovacs, george.karpenkov, NoQ. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, szepet, whisperity. This has been a long time coming. Note the usage of `AnalyzerOptions`: I'll need it f

[PATCH] D53701: [Analyzer] Record and process comparison of symbols instead of iterator positions in interator checkers

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Makes sense! Comment at: lib/StaticAnalyzer/Checkers/IteratorChecker.cpp:39 //currently treated as an lvalue. // * type-IIc, type-IIIc: compound values of iterator-typed objects, when the //iterator o

[PATCH] D53810: [analyzer][NFC] Refactor PlistDiagnostics to use a class instead of passing 9 parameters around

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171505. https://reviews.llvm.org/D53810 Files: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp Index: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp === --- lib/StaticAnalyzer/Core/PlistDiagnosti

[PATCH] D53810: [analyzer][NFC] Refactor PlistDiagnostics to use a class instead of passing 9 parameters around

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:82 -static void EmitRanges(raw_ostream &o, - const ArrayRef Ranges, - const FIDMap& FM, - const Preprocessor &PP, -

[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171532. Szelethus added a comment. This revision is now accepted and ready to land. Changes according to my last comment. https://reviews.llvm.org/D52742 Files: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h lib/StaticAnalyzer/Core/AnalyzerOption

[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171533. https://reviews.llvm.org/D52742 Files: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h lib/StaticAnalyzer/Core/AnalyzerOptions.cpp lib/StaticAnalyzer/Core/BugReporter.cpp lib/StaticAnalyzer/Core/PlistDiagnostics.cpp test/Analysis/Input

[PATCH] D53276: [analyzer][NFC] Fix some incorrect uses of -analyzer-config options

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. @NoQ did you have time to ping Devin about this? (Sorry for the early ping, but this patch is blocking a lot of my other patches.) https://reviews.llvm.org/D53276 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D52794: [analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:787-791 + // Acquire the macro's name. + Token TheTok; + RawLexer.LexFromRawLexer(TheTok); + + std::string MacroName = PP.getSpelling(TheTok); NoQ wrote: > Not sure, ran

[PATCH] D53810: [analyzer][NFC] Refactor PlistDiagnostics to use a class instead of passing 9 parameters around

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:82 -static void EmitRanges(raw_ostream &o, - const ArrayRef Ranges, - const FIDMap& FM, - const Preprocessor &PP, -

[PATCH] D53810: [analyzer][NFC] Refactor PlistDiagnostics to use a class instead of passing 9 parameters around

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus closed this revision. Szelethus added a comment. Commited in https://reviews.llvm.org/rC345531. Oops. https://reviews.llvm.org/D53810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp:36 + const ProgramStateRef PS; + SValBuilder &SVB; + NoQ wrote: > ZaMaZaN4iK wrote: > > Szelethus wrote: > > > You can acquire `SValBuilder` from `ProgramStat

[PATCH] D33672: [analyzer] INT50-CPP. Do not cast to an out-of-range enumeration checker

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. In https://reviews.llvm.org/D33672#1279520, @ZaMaZaN4iK wrote: > Thank you for the roadmap! Honestly I am not so familiar with Clang AST and > Clang Static Analyzer details (all my experience is writing some simple > checkers for clang-tidy and watching some videos ab

[PATCH] D53296: [analyzer] New flag to print all -analyzer-config options

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171611. Szelethus added a comment. Hardcoded the first entry as suggested by @george.karpenkov. https://reviews.llvm.org/D53296 Files: include/clang/Driver/CC1Options.td include/clang/StaticAnalyzer/Core/AnalyzerOptions.h include/clang/StaticAnalyze

[PATCH] D53296: [analyzer] New flag to print all -analyzer-config options

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 2 inline comments as done. Szelethus added a comment. Thanks! :) Comment at: lib/FrontendTool/ExecuteCompilerInvocation.cpp:255 +ento::printAnalyzerConfigList(llvm::outs()); +return true; + } george.karpenkov wrote: > Hm, should we ret

[PATCH] D53856: [analyzer] Put llvm.Conventions back in alpha

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: george.karpenkov, NoQ, xazax.hun, MTC. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, whisperity. Interestingly, this many year old (when I last looked I remember 2010ish) checke

[PATCH] D53856: [analyzer] Put llvm.Conventions back in alpha

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171623. Szelethus added a comment. Added an entry to the website. https://reviews.llvm.org/D53856 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp test/Analysis/llvm-conventions.cpp ww

[PATCH] D53069: [analyzer][www] Update avaible_checks.html

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171624. Szelethus added a comment. Excuse my informality, but `llvm.Conventions` fell flat on its face in my eyes (details: https://reviews.llvm.org/D53856), so I'm no longer insisting on including it on this page. https://reviews.llvm.org/D53069 Files:

[PATCH] D53856: [analyzer] Put llvm.Conventions back in alpha

2018-10-29 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp:193-195 static bool AllocatesMemory(QualType T) { return IsStdVector(T) || IsStdString(T) || IsSmallVector(T); } The `StringRef`part of this checker doesn't d

[PATCH] D53856: [analyzer] Put llvm.Conventions back in alpha

2018-10-30 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. In https://reviews.llvm.org/D53856#1279887, @NoQ wrote: > This might be also covered by @rnkovacs's string buffer escape checker - > either already or eventually, it'll become just yet another string view API > that the checker supports. I thought about that too, ad

[PATCH] D53488: [clang-tidy] Catching narrowing from double to float.

2018-10-30 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: clang-tidy/cppcoreguidelines/NarrowingConversionsCheck.cpp:14 #include "clang/ASTMatchers/ASTMatchFinder.h" +#include "llvm/ADT/APInt.h" +#include "llvm/ADT/APSInt.h" Is `APInt` used anywhere? Repository: rCTE Cl

[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 2 inline comments as done. Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Core/AnalyzerOptions.cpp:471 +DisplayMacroExpansions = +getBooleanOption("expand-macros", /*Default=*/false); + return DisplayMacroExpansions.getValue(); -

[PATCH] D52742: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345724: [analyzer][PlistMacroExpansion] Part 1.: New expand-macros flag (authored by Szelethus, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org

[PATCH] D52794: [analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus planned changes to this revision. Szelethus added a comment. I'll put this patch on hold while I'm investigating the issue @xazax.hun mentioned. Mind you, again, other patches don't depend strictly on this part, I'll only need to change the for loop. Hopefully. You never know.

[PATCH] D53940: [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added a reviewer: dblaikie. Herald added subscribers: cfe-commits, dkrupp. I'm currently working on including macro expansions in the Static Analyzer's plist output, where I can only access a `const SourceManager`. Repository: rC Clang https://revie

[PATCH] D53940: [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Thanks! That was super fast! Repository: rC Clang https://reviews.llvm.org/D53940 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53940: [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345741: [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager (authored by Szelethus, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.l

[PATCH] D52794: [analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 171962. Szelethus added a comment. Fixes according to @xazax.hun's remarks. Thanks for catching that, it was a non-trivial cornercase! - Now I'm acquiring the macro directive history, and choosing the appropriate macro definition in `getMacroNameAndInfo`

[PATCH] D52794: [analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus marked 10 inline comments as done. Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp:667 + +//===--===// +// Declarations of helper functions and data structures

[PATCH] D51866: [analyzer][UninitializedObjectChecker] New flag to ignore guarded uninitialized fields

2018-10-31 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:502 + + auto AssertM = callExpr(callee(functionDecl(hasName("assert"; + auto GuardM = Szelethus wrote: > NoQ wrote: > > In a lot of

[PATCH] D53979: [analyzer][CTU] Correctly signal in the function index generation tool if there was an error

2018-11-01 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus accepted this revision. Szelethus added a comment. Makes sense! https://reviews.llvm.org/D53979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53995: [analyzer] Drastically simplify the tblgen files used for checkers

2018-11-01 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus created this revision. Szelethus added reviewers: NoQ, george.karpenkov, xazax.hun, MTC. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, jfb, mikhail.ramalho, a.sidorin, rnkovacs, szepet, whisperity. TL;DR: Interestingly, only about the quarter of the emitter file is used, th

[PATCH] D52984: [analyzer] Checker reviewer's checklist

2018-11-01 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus requested changes to this revision. Szelethus added a comment. This revision now requires changes to proceed. I think @NoQ's list would be great to add! @dkrupp, as far as I'm aware, has some works in progress to avoid the usage of HTML, so let's put this on hold for a bit. Repositor

[PATCH] D52984: [analyzer] Checker reviewer's checklist

2018-11-01 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: www/analyzer/checker_dev_manual.html:720 +Are Checkers.td and the CMakeLists entry alphabetically ordered? + + aaron.ballman wrote: > Do we want to add an item for "Is the help text for the checker a useful > descript

[PATCH] D53856: [analyzer] Put llvm.Conventions back in alpha

2018-11-01 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus updated this revision to Diff 172253. Szelethus added a comment. - Moved `std::string` implementation from `InnerPointerChecker`'s testfile to the system header simulator header file. https://reviews.llvm.org/D53856 Files: include/clang/StaticAnalyzer/Checkers/Checkers.td lib/Sta

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-11-01 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. A polite ping :) https://reviews.llvm.org/D53483 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53692: [analyzer] Evaluate all non-checker config options before analysis

2018-11-01 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Polite ping. :) https://reviews.llvm.org/D53692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D53692: [analyzer] Evaluate all non-checker config options before analysis

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Also, thank you so much for the feedback on this, and almost every single other patch I made! https://reviews.llvm.org/D53692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/l

[PATCH] D53692: [analyzer] Evaluate all non-checker config options before analysis

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. In https://reviews.llvm.org/D53692#1285091, @NoQ wrote: > I guess i'm running out of steam for today :) > > > `Opts.shouldDoThat()` -> `Opts.ShouldDoThat.getValue()` > > Is this really unavoidable? Like, what makes them optional when they're > always non-optional? Mayb

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:146-149 +/// If you'd like to add a new -cc1 flag, add it to +/// include/clang/Driver/CC1Options.td, add a new field to store the value of +/// that flag in this class, and initializ

[PATCH] D53276: [analyzer][NFC] Fix some incorrect uses of -analyzer-config options

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rC345985: [analyzer][NFC] Fix some incorrect uses of -analyzer-config options (authored by Szelethus, committed by ). Chang

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345986: [analyzer][NFC] Collect all -analyzer-config options in a .def file (authored by Szelethus, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm

[PATCH] D53296: [analyzer] New flag to print all -analyzer-config options

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Szelethus marked an inline comment as done. Closed by commit rC345989: [analyzer] New flag to print all -analyzer-config options (authored by Szelethus, committed by ). Changed prior to commit: https://reviews.llvm.org/D5

[PATCH] D53296: [analyzer] New flag to print all -analyzer-config options

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345989: [analyzer] New flag to print all -analyzer-config options (authored by Szelethus, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D5329

[PATCH] D53856: [analyzer] Put llvm.Conventions back in alpha

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL345990: [analyzer] Put llvm.Conventions back in alpha (authored by Szelethus, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D53856?vs=172253&

[PATCH] D53856: [analyzer] Put llvm.Conventions back in alpha

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC345990: [analyzer] Put llvm.Conventions back in alpha (authored by Szelethus, committed by ). Changed prior to commit: https://reviews.llvm.org/D53856?vs=172253&id=172380#toc Repository: rC Clang ht

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. In https://reviews.llvm.org/D53277#1285777, @george.karpenkov wrote: > @NoQ @Szelethus Actually pushed a fix. Just saw this -- Thank you! :D Repository: rL LLVM https://reviews.llvm.org/D53277 ___ cfe-commits mailing

[PATCH] D53277: [analyzer][NFC] Collect all -analyzer-config options in a .def file

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus closed this revision. Szelethus added a comment. Interesting, I didn't get a mail about this :/ In any case, let's hope no more problems arise. Repository: rL LLVM https://reviews.llvm.org/D53277 ___ cfe-commits mailing list cfe-commit

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:146-149 +/// If you'd like to add a new -cc1 flag, add it to +/// include/clang/Driver/CC1Options.td, add a new field to store the value of +/// that flag in this class, and initializ

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:146-149 +/// If you'd like to add a new -cc1 flag, add it to +/// include/clang/Driver/CC1Options.td, add a new field to store the value of +/// that flag in this class, and initializ

[PATCH] D53483: [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added inline comments. Comment at: include/clang/StaticAnalyzer/Core/AnalyzerOptions.h:146-149 +/// If you'd like to add a new -cc1 flag, add it to +/// include/clang/Driver/CC1Options.td, add a new field to store the value of +/// that flag in this class, and initializ

[PATCH] D53974: [clang-tidy] new check: bugprone-too-small-loop-variable

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. In https://reviews.llvm.org/D53974#1283759, @ZaMaZaN4iK wrote: > Hmm, i thought Clang has some warning for this, but I was wrong... Did you > think to implement this check as Clang warning? That is an interesting point actually -- maybe it'd be worth doing that, and

[PATCH] D51531: [analyzer][UninitializedObjectChecker] Uninit regions are only reported once

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Sorry for the late reply. I'm not actually super confident about this idea, I don't think it would add much value, compared to how complicated it would make things. This patch reduces report by a significant amount when pointer chasing is enabled, but a global set mi

[PATCH] D51531: [analyzer][UninitializedObjectChecker] Uninit regions are only reported once

2018-11-02 Thread Umann Kristóf via Phabricator via cfe-commits
Szelethus added a comment. Oh, and the reason why I think it would add a lot of complication: since only `ExprEngine` is avaible in the `checkEndAnalysis` callback, which, from what I can see, doesn't have a handly `isDead` method, so I'm not even sure how I'd implement it. https://reviews.ll

<    1   2   3   4   5   6   >