[PATCH] D38101: [Sema] Diagnose tautological comparison with type's min/max values

2017-10-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Forgot to add, i really noticed/though about it just now, in https://reviews.llvm.org/D38871, because i did not encountered any warnings in that code in stage-2 builds. Repository: rL LLVM https://reviews.llvm.org/D38101 ___

[PATCH] D36836: [clang-tidy] Implement readability-function-cognitive-complexity check

2017-10-15 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp:76 + // So either static out-of-line or non-static in-line. + const std::array Msgs = {{ + // FIXME: these messages somehow trigger an assertion: aaro

[PATCH] D36836: [clang-tidy] Implement readability-function-cognitive-complexity check

2017-10-15 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119091. lebedev.ri marked 9 inline comments as done and an inline comment as not done. lebedev.ri added a comment. @aaron.ballman, thank you for the review! Rebased, addressed most of review notes. Repository: rL LLVM https://reviews.llvm.org/D36836

[Diffusion] rL302247: Introduce Wzero-as-null-pointer-constant.

2017-10-16 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added an edge: D32914: Introduce Wzero-as-null-pointer-constant.. Users: lebedev.ri (Auditor) https://reviews.llvm.org/rL302247 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[PATCH] D38954: [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros.

2017-10-16 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added a project: clang. The warning was initially introduced in https://reviews.llvm.org/D32914 by @thakis, and the concerns were raised there, and later in https://reviews.llvm.org/rL302247 and PR33771. I do believe that it makes sense to relax the

[PATCH] D38954: [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros.

2017-10-16 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D38954#898586, @thakis wrote: > As said on the bug, this matches gcc's behavior, https://bugs.llvm.org/show_bug.cgi?id=33771#c3 > and with this you won't see this warning for NULL. Finally, an argument that can actually be addressed. >

[PATCH] D38954: [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros.

2017-10-16 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119159. lebedev.ri added a comment. Address @thakis review notes: do make sure that we still warn on `NULL`. Any other special macros/cases? Repository: rL LLVM https://reviews.llvm.org/D38954 Files: lib/Sema/Sema.cpp test/SemaCXX/Inputs/warn-zero

[PATCH] D38101: [Sema] Diagnose tautological comparison with type's min/max values

2017-10-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D38101#901709, @materi wrote: > Hi! Hi. > After this patch I started to see warnings: Thank you for the report! > e.c:8:23: warning: integer constant not in range of enumerated type 'enum > E' [-Wassign-enum] > enum E {a = 7,} e

[PATCH] D39122: [Sema] Fixes for enum handling for tautological comparison diagnostics

2017-10-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added a project: clang. As Mattias Eriksson has reported in PR35009, in C, for enums, the underlying type should be used when checking for the tautological comparison, unlike C++, where the enumerator values define the value range. So if not in CPlus

[PATCH] D39122: [Sema] Fixes for enum handling for tautological comparison diagnostics

2017-10-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119705. lebedev.ri marked 5 inline comments as done. lebedev.ri added a comment. Addressed review notes. For C++, enum handling clearly needs more work, because not all tautological comparisons are actually diagnosed, so there is no `clang/test/Sema/outo

[PATCH] D39122: [Sema] Fixes for enum handling for tautological comparison diagnostics

2017-10-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119757. lebedev.ri marked 2 inline comments as done. lebedev.ri added a comment. Address review notes. Repository: rL LLVM https://reviews.llvm.org/D39122 Files: lib/Sema/SemaChecking.cpp test/Sema/outof-range-enum-constant-compare.c test/Sema/t

[PATCH] D39122: [Sema] Fixes for enum handling for tautological comparison diagnostics

2017-10-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/SemaChecking.cpp:8186 + // For enum types, for C code, use underlying data type. + if (const EnumType *ET = dyn_cast(T)) +T = ET->getDecl()->getIntegerType().getDesugaredType(C).getTypePtr(); ---

[PATCH] D36892: [clang-tidy] check_clang_tidy.py: support CHECK-NOTES prefix

2017-10-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119758. lebedev.ri added a comment. Rebased. Repository: rL LLVM https://reviews.llvm.org/D36892 Files: test/clang-tidy/check_clang_tidy.py Index: test/clang-tidy/check_clang_tidy.py

[PATCH] D39122: [Sema] Fixes for enum handling for tautological comparison diagnostics

2017-10-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119759. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. Address review notes. Repository: rL LLVM https://reviews.llvm.org/D39122 Files: lib/Sema/SemaChecking.cpp test/Sema/outof-range-enum-constant-compare.c test/Sema/t

[PATCH] D39122: [Sema] Fixes for enum handling for tautological comparison diagnostics

2017-10-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/SemaChecking.cpp:8619 + if (OtherRange.Width == 0) +return Value == 0 ? LimitType::Both : llvm::Optional(); + aaron.ballman wrote: > Instead of default constructing the Optional, you should use `llvm::No

[PATCH] D36836: [clang-tidy] Implement readability-function-cognitive-complexity check

2017-10-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp:102 +const unsigned short Nesting; /// How deeply nested is Loc located? +const Criteria C : 3; /// The criteria of the increment + aaron.bal

[PATCH] D36836: [clang-tidy] Implement readability-function-cognitive-complexity check

2017-10-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119766. lebedev.ri marked 28 inline comments as done. lebedev.ri added a comment. Rebased. Addressed @aaron.ballman review notes (mainly stylistic) Repository: rL LLVM https://reviews.llvm.org/D36836 Files: LICENSE.TXT clang-tidy/readability/CMake

[PATCH] D38954: [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL.

2017-10-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119833. lebedev.ri retitled this revision from "[Sema] -Wzero-as-null-pointer-constant: don't warn for system macros." to "[Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL.". lebedev.ri edited the summary of this revisio

[PATCH] D38954: [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL.

2017-10-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 119892. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. Use `MaybeMacroLoc` variable in the other place too. Repository: rL LLVM https://reviews.llvm.org/D38954 Files: docs/ReleaseNotes.rst lib/Sema/Sema.cpp test/SemaCXX

[PATCH] D38954: [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL.

2017-10-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/Sema.cpp:445 + // If it is a macro from system header, and if the macro name is not "NULL", + // do not warn. + SourceLocation MaybeMacroLoc = E->getLocStart(); Rakete wrote: > That comment doesn't rea

[PATCH] D39079: New clang option -fno-plt to avoid PLT for external calls

2017-10-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. No tests? https://reviews.llvm.org/D39079 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51220: [clang-tidy] run-clang-tidy fails using python 3.7

2018-08-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Have you seen https://reviews.llvm.org/D36624 / https://reviews.llvm.org/D38289 ? Please test how it behaves with both the python2 and python3 when the clang-tidy output contains non-ASCII symbols. https://reviews.llvm.org/D51220 _

[PATCH] D50901: [clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed checks

2018-08-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. ping. Repository: rC Clang https://reviews.llvm.org/D50901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50250: [clang][ubsan] Implicit Conversion Sanitizer - integer sign change - clang part

2018-08-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. ping. Repository: rC Clang https://reviews.llvm.org/D50250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51381: [clang-tidy] fix check_clang_tidy to properly mix CHECK-NOTES and CHECK-MESSAGES

2018-08-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. You would still have to duplicate the check-lines for `error:` though. As it was discussed in https://reviews.llvm.org/D36892 i would think the current behavior is correct: the `CHECK-MESSAGES` vs `CHECK-NOTES` denotes the severity of the output msg that is ok to be

[PATCH] D48714: [clang-tidy] fix PR37913, templated exception factory diagnosed correctly

2018-08-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D48714#1216537, @JonasToth wrote: > I had to revert the `CHECK-NOTES` change that @lebedev.ri introduced with his > revision. It fails the test, i think there is an inconsistency or so in the > check-clang-tidy script. I will try to figure

[PATCH] D51440: [ToolChains] Link to compiler-rt with -L + -l when possible

2018-08-29 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Since the libraries will no longer be specified with their full path, how will you know that the **right** library will be picked, the one compiler intended? Repository: rC Clang https://reviews.llvm.org/D51440 ___ cf

[PATCH] D51381: [clang-tidy] fix check_clang_tidy to properly mix CHECK-NOTES and CHECK-MESSAGES

2018-08-29 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D51381#1217047, @JonasToth wrote: > @lebedev.ri lets do it in the the other patch, to not split discussions. Let's do it here instead, since that differential requires some changes to this script. In https://reviews.llvm.org/D51381#12170

[PATCH] D51381: [clang-tidy] fix check_clang_tidy to forbid mixing of CHECK-NOTES and CHECK-MESSAGES

2018-08-30 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri accepted this revision. lebedev.ri added a comment. This revision is now accepted and ready to land. LG, thank you! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51381 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D51545: Enable -Wtautological-unsigned-zero-compare under -Wextra

2018-08-31 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added reviewers: thakis, vsk, phosek. lebedev.ri added a comment. In https://reviews.llvm.org/D51545#1220967, @eandrews wrote: > @lebedev.ri is there a specific reason -Wtautological-unsigned-zero-compare > was removed? All the issues I am aware of talks about comparisons with > min/

[PATCH] D51605: [clangd] SymbolOccurrences -> Refs and cleanup

2018-09-04 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clangd/index/Index.cpp:158 +auto &SymRefs = Sym.second; +std::sort(SymRefs.begin(), SymRefs.end()); +// TODO: do we really need to dedup? I noticed this by accident, but i'm pretty sure `std::sort()` shoul

[PATCH] D50250: [clang][ubsan] Implicit Conversion Sanitizer - integer sign change - clang part

2018-09-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Ping. Repository: rC Clang https://reviews.llvm.org/D50250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50901: [clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed checks

2018-09-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Ping. Repository: rC Clang https://reviews.llvm.org/D50901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45679: [clang-tidy] Add ExprMutationAnalyzer, that analyzes whether an expression is mutated within a statement.

2018-09-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Herald added a subscriber: Szelethus. Comment at: clang-tidy/utils/ExprMutationAnalyzer.h:38 + const Stmt *findDeclMutation(ArrayRef Matches); + const Stmt *findDeclMutation(const Decl *Dec); + @shuaiwang, @JonasToth hi. Is it

[PATCH] D45679: [clang-tidy] Add ExprMutationAnalyzer, that analyzes whether an expression is mutated within a statement.

2018-09-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/utils/ExprMutationAnalyzer.h:38 + const Stmt *findDeclMutation(ArrayRef Matches); + const Stmt *findDeclMutation(const Decl *Dec); + lebedev.ri wrote: > @shuaiwang, @JonasToth hi. > Is it very intentional

[PATCH] D45679: [clang-tidy] Add ExprMutationAnalyzer, that analyzes whether an expression is mutated within a statement.

2018-09-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/utils/ExprMutationAnalyzer.h:38 + const Stmt *findDeclMutation(ArrayRef Matches); + const Stmt *findDeclMutation(const Decl *Dec); + lebedev.ri wrote: > lebedev.ri wrote: > > @shuaiwang, @JonasToth hi. >

[PATCH] D50246: [RISCV] Add support for computing sysroot for riscv32-unknown-elf

2018-09-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D50246#1229177, @kristina wrote: > In https://reviews.llvm.org/D50246#1229152, @rogfer01 wrote: > > > Hi @kristina . > > > > Sure, I didn't mean to do that broader change here. Apologies if it read > > that way. > > > > Would it be acceptab

[PATCH] D51884: [clang-tidy] ExprMutationAnalyzer: construct from references. Fixes PR38888

2018-09-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: JonasToth, shuaiwang, alexfh. lebedev.ri added a project: clang-tools-extra. Herald added subscribers: Szelethus, a.sidorin, xazax.hun. Herald added a reviewer: george.karpenkov. I have hit this the rough way, while trying to use this i

[PATCH] D51884: [clang-tidy] ExprMutationAnalyzer: construct from references. Fixes PR38888

2018-09-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/utils/ExprMutationAnalyzer.cpp:209-214 - const auto MemberExprs = - match(findAll(expr(anyOf(memberExpr(hasObjectExpression(equalsNode(Exp))), - cxxDependentScopeMemberExpr( -

[PATCH] D51884: [clang-tidy] ExprMutationAnalyzer: construct from references. Fixes PR38888

2018-09-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 164730. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. Fixed diff. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51884 Files: clang-tidy/performance/ForRangeCopyCheck.cpp clang-tidy/performance/UnnecessaryV

[PATCH] D51884: [clang-tidy] ExprMutationAnalyzer: construct from references. Fixes PR38888

2018-09-10 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D51884#1229460, @shuaiwang wrote: > LGTM :) Thank you for the review! In https://reviews.llvm.org/D51884#1229463, @JonasToth wrote: > I feel that the `findMutation...` functions that take raw pointers should get > the assertions though,

[PATCH] D51090: [clangd] Add index benchmarks

2018-09-11 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D51090#1230579, @kbobyrev wrote: > The only problem left is that I'm not sure how to run binary which is not > under bin (`IndexBenchmark`) using llvm-lit. But it's a //benchmark//.. What use could be from running it as part of the _test

[PATCH] D51090: [clangd] Add index benchmarks

2018-09-11 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D51090#1230629, @sammccall wrote: > In https://reviews.llvm.org/D51090#1230582, @lebedev.ri wrote: > > > In https://reviews.llvm.org/D51090#1230579, @kbobyrev wrote: > > > > > The only problem left is that I'm not sure how to run binary whic

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-11 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thank you for working on this! I really miss this check. To be noted, there is preexisting, almost finished version - https://reviews.llvm.org/D27621. I'm not sure in what state it really is, but it might be simpler to take that over and finish it. Repository: rCT

[PATCH] D51090: [clangd] Add index benchmarks

2018-09-11 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri accepted this revision. lebedev.ri added a comment. In https://reviews.llvm.org/D51090#1230659, @kbobyrev wrote: > Add `--benchmark_min_time=0.01` to prevent testing time increase. Thanks! https://reviews.llvm.org/D51090 ___ cfe-commit

[PATCH] D50901: [clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and signed checks

2018-09-12 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Ping once again :) Repository: rC Clang https://reviews.llvm.org/D50901 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50250: [clang][ubsan] Implicit Conversion Sanitizer - integer sign change - clang part

2018-09-12 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Ping once again :) Repository: rC Clang https://reviews.llvm.org/D50250 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50359: Add a new library, libclang-cxx

2018-09-12 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. > The motivation for this library is to > be used by Clang tools that use Clang's C++ api. They no longer need to > link against the individual static libraries. I would personally consider that to be a regression. It hides layering violations. Of course, in downstre

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-12 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D51949#1232443, @kbobyrev wrote: > I've been thinking about corner-cases (e.g. don't split `DeclStmt`s within > init-statement declaration) a while and it seems that there might be many of > them. It should at least diagnose these cases.

[PATCH] D52008: [analyzer] Handle forwarding reference better in ExprMutationAnalyzer.

2018-09-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Thanks for working on this! I tried, and it appears to not fix the issue at hand. - struct C1 { C1(const C1* c, int num); }; int x = 0; auto y = std::make_unique(nullptr, x); // <- still considered a mutation? - struct C3 {}; // some class str

[PATCH] D52008: [analyzer] Handle forwarding reference better in ExprMutationAnalyzer.

2018-09-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D52008#1233667, @shuaiwang wrote: > Just some quick comments, I'll take a deeper look into other comments later. > > This diff along unfortunately won't be able to handle `emplace_back` just yet My apologies, for some reason i though it wa

[PATCH] D51333: Diagnose likely typos in include statements

2018-09-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. The tests seem to have disappeared form the diff. https://reviews.llvm.org/D51333 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: clang-tidy/readability/IsolateDeclCheck.cpp:200 + + diag(WholeDecl->getBeginLoc(), "make only one declaration per statement") + << FixItHint::CreateReplacement(WholeDecl->getSourceRange(), Replacement); I think

[PATCH] D51949: [WIP][clang-tidy] initial ideas to isolate variable declarations

2018-09-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D51949#1233951, @JonasToth wrote: > Yes, do you think it should be included in the diag? Yes, please :) Else, the message seems a bit too empty. I **don't** think it should point (via `NOTE:`) at the each decl though. > Am 13.09.2018 um 2

[PATCH] D52066: [Driver] Fix missing MultiArch include dir on powerpcspe

2018-09-14 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: cfe/trunk/lib/Driver/ToolChains/Linux.cpp:701 "/usr/include/mips64el-linux-gnuabi64"}; const StringRef PPCMultiarchIncludeDirs[] = { + "/usr/include/powerpc-linux-gnu", This is probably missing test cov

[PATCH] D52120: [analyzer] Treat std::{move, forward} as casts in ExprMutationAnalyzer.

2018-09-14 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D52120#1235479, @shuaiwang wrote: > @lebedev.ri could you help test whether this fully resolves PR38891? Thanks! That is what i'm trying to do here :) Still waiting for the build to finish... Repository: rC Clang https://reviews.llvm.

[PATCH] D52120: [analyzer] Treat std::{move, forward} as casts in ExprMutationAnalyzer.

2018-09-14 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri accepted this revision. lebedev.ri added a comment. This revision is now accepted and ready to land. Thank you for working on this! In https://reviews.llvm.org/D52120#1235480, @lebedev.ri wrote: > In https://reviews.llvm.org/D52120#1235479, @shuaiwang wrote: > > > @lebedev.ri could yo

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 156237. lebedev.ri added a comment. Breakthrough: no more false-positives due to the `MaterializeTemporaryExpr` skipping over NoOp casts. (https://reviews.llvm.org/D49508) Slight docs update. Ping, please review! We are so close :) Repository: rC Clan

[PATCH] D49508: [Sema] Expr::skipRValueSubobjectAdjustments(): record skipped NoOp casts.

2018-07-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D49508#1168584, @rjmccall wrote: > Hmm. I think the approach of flagging ICEs that are semantically part of an > explicit cast is probably a better representation for tools across the board. I could do that, but i couldn't find where it

[PATCH] D49508: [Sema] Expr::skipRValueSubobjectAdjustments(): record skipped NoOp casts.

2018-07-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D49508#1168620, @rjmccall wrote: > In https://reviews.llvm.org/D49508#1168599, @lebedev.ri wrote: > > > In https://reviews.llvm.org/D49508#1168584, @rjmccall wrote: > > > > > Hmm. I think the approach of flagging ICEs that are semantically

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 156465. lebedev.ri retitled this revision from "[Sema] Expr::skipRValueSubobjectAdjustments(): record skipped NoOp casts." to "[Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)". lebedev.ri edited the summary of this revision.

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 156470. lebedev.ri marked 6 inline comments as done. lebedev.ri added a comment. Rebased ontop of yet-again rewritten https://reviews.llvm.org/D49508. Addressed all @vsk's review notes. More review notes wanted :) Repository: rC Clang https://reviews.

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: docs/UndefinedBehaviorSanitizer.rst:134 + integer promotions, as those may result in an unexpected computation + results, even though no overflow happens (signed or unsigned). - ``-fsanitize=unreachable``: If control flow

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/AST/Stmt.h:206 +bool PartOfExplicitCast : 1; +unsigned BasePathSize : 32 - 6 - 1 - NumExprBits; }; rjmccall wrote: > This needs to be serialized. Uhm, could you please explain what do you mean

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 156568. lebedev.ri marked 4 inline comments as done. lebedev.ri added a comment. - Use `unsigned`, not bool. - Serialization, although without tests, and likely incompatible with previous versions. Repository: rC Clang https://reviews.llvm.org/D49508

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/AST/Stmt.h:206 +bool PartOfExplicitCast : 1; +unsigned BasePathSize : 32 - 6 - 1 - NumExprBits; }; rjmccall wrote: > lebedev.ri wrote: > > rjmccall wrote: > > > This needs to be serialized. >

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/SemaCast.cpp:94-101 +void updatePartOfExplicitCastFlags(CastExpr *CE) { + // Walk down from the CE to the OrigSrcExpr, and mark all immediate + // ImplicitCastExpr's as being part of ExplicitCastExpr. The origin

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/AST/Stmt.h:206 +bool PartOfExplicitCast : 1; +unsigned BasePathSize : 32 - 6 - 1 - NumExprBits; }; rsmith wrote: > lebedev.ri wrote: > > rjmccall wrote: > > > lebedev.ri wrote: > > > > rjmccal

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-21 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 156670. lebedev.ri marked an inline comment as done. lebedev.ri added a comment. Partially address some of @rsmith's review notes, see reply notes for issues. Repository: rC Clang https://reviews.llvm.org/D49508 Files: include/clang/AST/Expr.h inc

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-22 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 156705. lebedev.ri marked 3 inline comments as done. lebedev.ri added a comment. Hurray, got the PCH test working! I'm still unsure about marking *all* the immediate implicit casts as part of the group. Repository: rC Clang https://reviews.llvm.org/D4

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/CodeGen/CodeGenFunction.h:383 + // This stack is used/maintained exclusively by the implicit cast sanitizer. + llvm::SmallVector CastExprStack; + vsk wrote: > lebedev.ri wrote: > > vsk wrote: > > > Why not 0 ins

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/CodeGen/CodeGenFunction.h:383 + // This stack is used/maintained exclusively by the implicit cast sanitizer. + llvm::SmallVector CastExprStack; + vsk wrote: > lebedev.ri wrote: > > vsk wrote: > > > lebedev.ri wr

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 156583. lebedev.ri marked 11 inline comments as done. lebedev.ri added a comment. Address @vsk's review notes. Repository: rC Clang https://reviews.llvm.org/D48958 Files: docs/ReleaseNotes.rst docs/UndefinedBehaviorSanitizer.rst include/clang/Ba

[PATCH] D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)

2018-07-23 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri marked 3 inline comments as done. lebedev.ri added a comment. Thank you for the review! Comment at: lib/Sema/SemaCast.cpp:94-101 +void updatePartOfExplicitCastFlags(CastExpr *CE) { + // Walk down from the CE to the OrigSrcExpr, and mark all immediate +

[PATCH] D46230: For x86_64, gcc 7.2 under Amazon Linux AMI sets its paths to x86_64-amazon-linux

2018-07-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. The test fails here: FAIL: Clang :: Driver/linux-ld.c (4670 of 12944) TEST 'Clang :: Driver/linux-ld.c' FAILED Script: -- : 'RUN: at line 4'; /build/llvm-build-GCC-release/bin/clang -no-canonical-prefixes /build/c

[PATCH] D46230: For x86_64, gcc 7.2 under Amazon Linux AMI sets its paths to x86_64-amazon-linux

2018-07-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D46230#1173074, @gaijiading wrote: > Hi Roman, > > The cause of it was that, during committing the patch (r337811), svn skipped > over an empty directory that was required for my test case. I've submitted a > fix in a follow-up commit (r33

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 156983. lebedev.ri added a comment. Rebased on top of svn tip / git master, now that https://reviews.llvm.org/D49508 has landed, which means there shouldn't be any more false-positives (and it's a bit faster to detect that the check shouldn't be emitted,

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-24 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D48958#1173860, @vsk wrote: > LGTM, although I think it'd be helpful to have another +1 just to be safe. Thank you for the review! It would indeed be great if someone else could take a look, especially since we are **so** close to the bra

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/CodeGen/CGExprScalar.cpp:979-1003 +bool ScalarExprEmitter::IsTopCastPartOfExplictCast() { + assert(!CastExprStack.empty()); + // Walk the current stack of CastExprs in reverse order. + // That is, the current CastExpr, which is

[PATCH] D49838: [AST] Sink 'part of explicit cast' down into ImplicitCastExpr

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: rsmith, rjmccall, erichkeane, aaron.ballman. lebedev.ri added a project: clang. lebedev.ri added a dependency: D49508: [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166). As discussed in IRC with @rsmith, it

[PATCH] D49844: [AST] Add a isActuallyImplicitCast() helper to the CastExpr class.

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri created this revision. lebedev.ri added reviewers: rsmith, erichkeane, rjmccall, aaron.ballman. Herald added a subscriber: cfe-commits. lebedev.ri added a dependency: D49838: [AST] Sink 'part of explicit cast' down into ImplicitCastExpr. This is mostly factored out of https://reviews.l

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 157458. lebedev.ri marked an inline comment as done. lebedev.ri added a reviewer: erichkeane. lebedev.ri added a subscriber: erichkeane. lebedev.ri added a comment. Address @rsmith & @erichkeane [IRC] review notes: - https://reviews.llvm.org/D49838 - [AST]

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/CodeGenCXX/catch-implicit-integer-truncations.cpp:8-33 +// == // +// Check that explicit cast does not interfere with implicit cast +//

[PATCH] D49838: [AST] Sink 'part of explicit cast' down into ImplicitCastExpr

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D49838#1176622, @erichkeane wrote: > 2 small items, otherwise looks good. Thank you for taking a look! Comment at: include/clang/AST/Expr.h:2824 CastExprBits.Kind = kind; -CastExprBits.PartOfExplicitCast = fals

[PATCH] D49838: [AST] Sink 'part of explicit cast' down into ImplicitCastExpr

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/SemaCast.cpp:97 while ((CE = dyn_cast(CE->getSubExpr( -CE->setIsPartOfExplicitCast(true); +dyn_cast(CE)->setIsPartOfExplicitCast(true); } lebedev.ri wrote: > erichkeane wrote:

[PATCH] D49838: [AST] Sink 'part of explicit cast' down into ImplicitCastExpr

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 157483. lebedev.ri marked 5 inline comments as done. lebedev.ri added a comment. Address @erichkeane review notes. Repository: rC Clang https://reviews.llvm.org/D49838 Files: include/clang/AST/Expr.h include/clang/AST/Stmt.h lib/AST/ASTDumper.cp

[PATCH] D49844: [AST] Add a isActuallyImplicitCast() helper to the CastExpr class.

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 157484. lebedev.ri marked 2 inline comments as done. lebedev.ri added a comment. Comment fine-tuning. In https://reviews.llvm.org/D49844#1176639, @erichkeane wrote: > I'm not sure that this logic requires a separate function. Since you've > fixed the ge

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 157498. lebedev.ri marked 2 inline comments as done. lebedev.ri added a comment. Small rewording in `docs/UndefinedBehaviorSanitizer.rst` thanks to @erichkeane & @aaron.ballman! Repository: rC Clang https://reviews.llvm.org/D48958 Files: docs/Relea

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: docs/UndefinedBehaviorSanitizer.rst:93-97 + - ``-fsanitize=implicit-integer-truncation``: Implicit cast from integer + of bigger bit width to smaller bit width, if that results in data loss. + That is, if the demoted value,

[PATCH] D49844: [AST] Add a isActuallyImplicitCast() helper to the CastExpr class.

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri abandoned this revision. lebedev.ri added a comment. In https://reviews.llvm.org/D49844#1177273, @rsmith wrote: > What I requested was that either we make `CastExpr::isPartOfExplicitCast()` > return `true` for `CastExpr`s that are not `ImplicitCastExpr`s, or that we > move `isPartOfE

[PATCH] D49838: [AST] Sink 'part of explicit cast' down into ImplicitCastExpr

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 157576. lebedev.ri marked 3 inline comments as done. lebedev.ri added a comment. Address @rsmith review notes. Repository: rC Clang https://reviews.llvm.org/D49838 Files: include/clang/AST/Expr.h include/clang/AST/Stmt.h lib/AST/ASTDumper.cpp

[PATCH] D49838: [AST] Sink 'part of explicit cast' down into ImplicitCastExpr

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/AST/Expr.h:2928 + bool getIsPartOfExplicitCast() const { +return CastExprBits.PartOfExplicitCast; rsmith wrote: > Please also rename this to`isPartOfExplicitCast` as requested on IRC. Right, sorry

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 157585. lebedev.ri added a comment. Rebase, Address @rsmith review notes - just inline https://reviews.llvm.org/D49844. Repository: rC Clang https://reviews.llvm.org/D48958 Files: docs/ReleaseNotes.rst docs/UndefinedBehaviorSanitizer.rst include

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri updated this revision to Diff 157665. lebedev.ri marked 9 inline comments as done and 2 inline comments as done. lebedev.ri edited the summary of this revision. lebedev.ri added a comment. Hopefully address @rsmith review notes: - s/cast/conversion/ where appropriate - Some wording in

[PATCH] D49890: Clang-Tidy Export Problem

2018-07-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. I'm not sure what this differential *actually* does. That being said https://clang.llvm.org/docs/JSONCompilationDatabase.html#format > directory: The working directory of the compilation. All paths specified in > the command or file fields must be either absolute or

[PATCH] D49890: Clang-Tidy Export Problem

2018-07-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Also, please upload the patches with full context (`-U9`), and the patch is misformed, the `ClangTidy.cpp` isn't in the root directory. Also, tests. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49890 _

[PATCH] D49862: [clang-tidy] Fix a crash in fuchsia-multiple-inheritance

2018-07-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. (Duplicates https://reviews.llvm.org/D49158) Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49862 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe

[PATCH] D49890: Clang-Tidy Export Problem

2018-07-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In https://reviews.llvm.org/D49890#1178211, @JonasToth wrote: > In https://reviews.llvm.org/D49890#1178103, @lebedev.ri wrote: > > > I'm not sure what this differential *actually* does. > > > This is a follow up from this discussion on the mailing list: > http://clang

[PATCH] D48958: [clang][ubsan] Implicit Cast Sanitizer - integer truncation - clang part

2018-07-27 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Oops, forgot to submit the inline comments. (It is inconvenient that they aren't submitted with the rest.) Comment at: docs/ReleaseNotes.rst:292 + store = store + 768; // before addition, 'store' was promoted to int. +(void)consume((

[PATCH] D49114: [clang-tidy] Add a check for "magic numbers"

2018-07-28 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: docs/clang-tidy/checks/readability-magic-numbers.rst:61-63 +configuration for accepted floating point values, primarily because most +floating point comparisons are not exact, and some of the exact ones are not +portable.

<    1   2   3   4   5   6   7   8   9   10   >