[PATCH] D55862: [Sema] Don't try to account for the size of an incomplete type in CheckArrayAccess

2018-12-18 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: bkramer, efriedma. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. It is possible that the base type in CheckArrayAccess is incomplete even though the effective type is complete. In this case don't try to acco

[PATCH] D55862: [Sema] Don't try to account for the size of an incomplete type in CheckArrayAccess

2018-12-19 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 178848. riccibruno marked 4 inline comments as done. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55862/new/ https://reviews.llvm.org/D55862 Files: lib/Sema/SemaChecking.cpp test/SemaCXX/array-bounds.cpp Index: test/

[PATCH] D55862: [Sema] Don't try to account for the size of an incomplete type in CheckArrayAccess

2018-12-19 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: test/SemaCXX/array-bounds.cpp:294 + C &f() { return reinterpret_cast(xxx)[1]; } // no-warning + C &g() { return reinterpret_cast(xxx)[2]; } // expected-warning {{array index 2 is past the end of the array (which contains 2 elements

[PATCH] D55793: [clang-tidy] Add duplicated access specifier readability check (PR25403)

2018-12-19 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > Yes, I was thinking about the same thing! However, I believe that some people > may find this kind of "redundant" access specs actually more readable, so > maybe it makes sense to add a check option for this > to allow users to > disable it? Perhaps ? I will leave

[PATCH] D55862: [Sema] Don't try to account for the size of an incomplete type in CheckArrayAccess

2018-12-20 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 179035. riccibruno added a comment. Used `ArrayTy->getElementType()` Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55862/new/ https://reviews.llvm.org/D55862 Files: lib/Sema/SemaChecking.cpp test/SemaCXX/array-bounds.

[PATCH] D42043: c-index: CXString: fix MSAN read-past-end bug

2018-12-20 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Is anyone working on this ? This is the only persistent msan failure when doing `check-clang` on my machine. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D42043/new/ https://reviews.llvm.org/D42043 _

[PATCH] D56006: [AST] Fix a -Wimplicit-fallthrough warning in ScanfFormatString.cpp

2018-12-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: hans. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. This is showing up with some bots (eg http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/19061/steps/build%20stage%201/logs/warnings%20%

[PATCH] D56022: [AST] Store the arguments of CXXConstructExpr in a trailing array

2018-12-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: rjmccall. riccibruno added a project: clang. Herald added a reviewer: shafik. Herald added a subscriber: cfe-commits. Store the arguments of `CXXConstructExpr` in a trailing array. This is very similar to the `CallExpr` case in D55771

[PATCH] D56022: [AST] Store the arguments of CXXConstructExpr in a trailing array

2018-12-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added inline comments. Comment at: include/clang/AST/ExprCXX.h:1295 + /// A pointer to the constructor which will be ultimately called. + CXXConstructorDecl *Constructor; + Removed the default member initi

[PATCH] D56050: [Sema] Diagnose array access preceding the array bounds even when the base type is incomplete.

2018-12-22 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: efriedma. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. When the type of the base expression after `IgnoreParenCasts` is incomplete, it is still possible to diagnose an array access which precedes the array

[PATCH] D56134: [AST] Store some data of CXXNewExpr as trailing objects

2018-12-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: rjmccall. riccibruno added a project: clang. Herald added a reviewer: shafik. Herald added a subscriber: cfe-commits. Store the optional array size expression, optional initialization expression and optional placement new arguments in

[PATCH] D56358: [AST] Move back BasePathSize to the bit-fields of CastExpr

2019-01-05 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: lebedev.ri. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Background: The number of trailing `CXXBaseSpecifiers` in `CastExpr` was moved from `CastExprBitfields` to a trailing object in r338489 (D50050

[PATCH] D56358: [AST] Move back BasePathSize to the bit-fields of CastExpr

2019-01-05 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added inline comments. Comment at: include/clang/AST/Expr.h:3029 +assert((CastExprBits.BasePathSize == BasePathSize) && + "BasePathSize overflow!"); assert(CastConsistency()); It cannot ov

[PATCH] D56358: [AST] Move back BasePathSize to the bit-fields of CastExpr

2019-01-05 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: include/clang/AST/Expr.h:3029 +assert((CastExprBits.BasePathSize == BasePathSize) && + "BasePathSize overflow!"); assert(CastConsistency()); lebedev.ri w

[PATCH] D56303: [clang-tidy] Handle case/default statements when simplifying boolean expressions

2019-01-05 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang-tidy/readability/SimplifyBooleanExprCheck.cpp:719 +bool Negated, const SwitchCase *SwitchCase) { + assert(SwitchCase != nullptr); + LegalizeAdulthood wrote: > aaron.ballman wrote: > > Add a message to the a

[PATCH] D56050: [Sema] Diagnose array access preceding the array bounds even when the base type is incomplete.

2019-01-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Friendly ping ? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56050/new/ https://reviews.llvm.org/D56050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-b

[PATCH] D37035: Implement __builtin_LINE() et. al. to support source location capture.

2019-01-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: include/clang/AST/Expr.h:4108 +public: + enum IdentType { Function, File, Line, Column }; + `IdentType` -> `IdentKind` ? Comment at: include/clang/AST/Expr.h:4147 + SourceLocation getBeginLoc() co

[PATCH] D56134: [AST] Store some data of CXXNewExpr as trailing objects

2019-01-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: include/clang/AST/ExprCXX.h:1950 /// The allocated type-source information, as written in the source. TypeSourceInfo *AllocatedTypeInfo; rjmccall wrote: > If you ev

[PATCH] D56368: [AST] Store the results in OverloadExpr in a trailing array

2019-01-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: rjmccall. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Use the newly available space in the bit-fields of `Stmt` to pack `OverloadExpr`, `UnresolvedLookupExpr` and `UnresolvedMemberExpr`. Additionally sto

[PATCH] D56367: [AST] Pack CXXDependentScopeMemberExpr

2019-01-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: rjmccall. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Use the newly available space in the bit-fields of `Stmt`. Additionally store `FirstQualifierFoundInScope` as a trailing object since it is most of t

[PATCH] D56358: [AST] Move back BasePathSize to the bit-fields of CastExpr

2019-01-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: include/clang/AST/Expr.h:3029 +assert((CastExprBits.BasePathSize == BasePathSize) && + "BasePathSize overflow!"); assert(CastConsistency()); lebedev.ri w

[PATCH] D56367: [AST] Pack CXXDependentScopeMemberExpr

2019-01-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D56367#1347845 , @rjmccall wrote: > Does the regression disappear if you make the scope specifier the first > trailing object? Later trailing objects are more expensive to access, and I > would imagine that the scope speci

[PATCH] D56358: [AST] Move back BasePathSize to the bit-fields of CastExpr

2019-01-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: include/clang/AST/Expr.h:3029 +assert((CastExprBits.BasePathSize == BasePathSize) && + "BasePathSize overflow!"); assert(CastConsistency()); lebedev.ri w

[PATCH] D56358: [AST] Move back BasePathSize to the bit-fields of CastExpr

2019-01-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: include/clang/AST/Expr.h:3029 +assert((CastExprBits.BasePathSize == BasePathSize) && + "BasePathSize overflow!"); assert(CastConsistency()); riccibruno w

[PATCH] D56367: [AST] Pack CXXDependentScopeMemberExpr

2019-01-07 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > Okay. That comment seems reasonable. Glad to hear you're on top of it. :) I guess that means I can land this as is ? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56367/new/ https://reviews.llvm.org/D56367 ___

[PATCH] D37035: Implement __builtin_LINE() et. al. to support source location capture.

2019-01-08 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added a comment. I have no more remark, but since I am just a new contributor to clang I am sure people will have more to say about this patch. Thanks ! Comment at: lib/AST/Expr.cpp:2091 +

[PATCH] D48873: [AST] Use llvm::TrailingObjects in clang::CXXTryStmt

2018-07-03 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added a reviewer: rsmith. bricci added a project: clang. Herald added a subscriber: cfe-commits. Use TrailingObjects for CXXTryStmt instead of hand-rolling it. This hides the reinterpret_casts and make it more consistent with the other classes. Repository:

[PATCH] D49302: [AST] Various micro-optimizations in CXXInheritance

2018-07-13 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added reviewers: arphaman, bkramer, rsmith. bricci added a project: clang. Herald added a subscriber: cfe-commits. 1. Pack std::pair in CXXBasePaths::ClassSubobjects. 2. Use a SmallPtrSet instead of a SmallDenseSet for CXXBasePaths::VisitedDependentRecords. 3.

[PATCH] D48873: [AST] Use llvm::TrailingObjects in CXXTryStmt

2018-07-14 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 155563. bricci retitled this revision from "[AST] Use llvm::TrailingObjects in clang::CXXTryStmt" to "[AST] Use llvm::TrailingObjects in CXXTryStmt". bricci edited the summary of this revision. bricci added reviewers: arphaman, bkramer. bricci added a comment.

[PATCH] D48873: [AST] Use llvm::TrailingObjects in CXXTryStmt

2018-07-14 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 155564. bricci added a comment. wrong diff Repository: rC Clang https://reviews.llvm.org/D48873 Files: include/clang/AST/StmtCXX.h lib/AST/StmtCXX.cpp Index: lib/AST/StmtCXX.cpp === ---

[PATCH] D58579: [Sema] SequenceChecker: C++17 sequencing rule for call expressions.

2020-06-02 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 267865. riccibruno added a comment. Updated with the test case from PR20819. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58579/new/ https://reviews.llvm.org/D58579 Files: clang/lib/Sema/SemaChecking.cpp

[PATCH] D81003: [clang][Sema] SequenceChecker: Also visit default arguments.

2020-06-02 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: rsmith. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. `SequenceChecker` is currently not visiting default arguments and therefore missing cases like: int a; int foo(int x = a++, int y = a); void tes

[PATCH] D58579: [Sema] SequenceChecker: C++17 sequencing rule for call expressions.

2020-06-03 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Great! thanks for the review @rsmith . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58579/new/ https://reviews.llvm.org/D58579 ___ cfe-commits mailing list cfe-commits@list

[PATCH] D58579: [Sema] SequenceChecker: C++17 sequencing rule for call expressions.

2020-06-03 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa2f32bfcc7cd: [clang][Sema] SequenceChecker: C++17 sequencing rule for call expressions. (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D83901: [clang] Disable a few formatting options for test/

2020-07-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D83901#2155127 , @MyDeveloperDay wrote: > clang-format -n warnings before this change in clang/test/Analysis/*.cpp > (clang-format -n *.cpp |& grep warning | wc -l) > > before = 6903 vs after=6595, if it helps I'd say thi

[PATCH] D83681: [clang] Provide a more specific diagnostic for a misplaced lambda capture-default.

2020-07-18 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG32db24a7f242: [clang] Provide a more specific diagnostic for a misplaced lambda capture… (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D82880: Fix PR35677: UB on __int128_t or __uint128_t template parameters.

2020-07-18 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In addition to Aaron's suggestion, can you also change the diff's title to something a little bit more informative. Suggestion: "[clang] Handle 128-bits IntegerLiterals in StmtPrinter", and say in the description that this addresses PR35677. Repository: rG LLVM G

[PATCH] D83901: [clang] Disable a few formatting options for test/

2020-07-19 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG13316a770535: [clang] Disable a few formatting options for test/ (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83901/new/ https://

[PATCH] D84090: [clang-format] Add BitFieldColonSpacing option

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84090#2162389 , @MyDeveloperDay wrote: > Nit:clang-format the patch > > Here is a Tip as to what I do (In case it helps other): > > 1. I generate the diff off the staged items so I've already git added all the > files I'm

[PATCH] D84048: DR2303: Prefer 'nearer' base classes during template deduction.

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > Also make sure to update the the cxx_dr_status.html document. It is auto-generated. You need to tag the test case: `dr2303: 12`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84048/new/ https://reviews.llvm.org/D84048 ___

[PATCH] D84048: DR2303: Prefer 'nearer' base classes during template deduction.

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84048#2165026 , @erichkeane wrote: > In D84048#2165023 , @riccibruno > wrote: > > > > Also make sure to update the the cxx_dr_status.html document. > > > > It is auto-generated. You

[PATCH] D84048: DR2303: Prefer 'nearer' base classes during template deduction.

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > Ah, doh, I see a few now. Is that number the compiler version number? Yup CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84048/new/ https://reviews.llvm.org/D84048 ___ cfe-commits mailing list cfe-commits@lists

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-07-21 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Friendly ping. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81003/new/ https://reviews.llvm.org/D81003 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-22 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: MyDeveloperDay. riccibruno added a project: clang-format. Herald added a project: clang. Herald added a subscriber: cfe-commits. The underlying ABI forces `FormatToken` to have a lot of padding. Currently (on x86-64 linux) `sizeof(For

[PATCH] D84343: [AST] Keep FP options in trailing storage of CallExpr

2020-07-22 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/AST/ast-dump-fpfeatures.cpp:1 +// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 -ast-dump | FileCheck %s + Can you also test the serialization by round-tripping through a PCH (see the other AST dump tests fo

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-23 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 3 inline comments as done. riccibruno added inline comments. Comment at: clang/lib/Format/ContinuationIndenter.cpp:652 + (Current.isNot(TT_LineComment) || + Previous.getBlockKind() == BK_BracedInit)) { State.Stack.back().Indent = State.Column + S

[PATCH] D84005: Introduce ns_error_domain attribute.

2020-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:5344 + if (!S.LookupName(lookupResult, S.TUScope) || + !lookupResult.getAsSingle()) { +S.Diag(IdentLoc->Loc, diag::err_nserrordomain_invalid_decl) Just a note that `LookupResu

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 280730. riccibruno added a comment. Use `is` and `isNot`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84306/new/ https://reviews.llvm.org/D84306 Files: clang/lib/Format/ContinuationIndenter.cpp clang/

[PATCH] D84599: [clang-index] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-07-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: akyrtzi, jkorous, sammccall, hokein. riccibruno added a project: clang. Herald added subscribers: cfe-commits, arphaman, dexonsmith. `NamedDecl::printName` is used as a customisation point for `getNameForDiagnostic`. The default implem

[PATCH] D84599: [clang-index] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-07-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 280734. riccibruno added a comment. Update a comment I originally missed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84599/new/ https://reviews.llvm.org/D84599 Files: clang/lib/Index/USRGeneration.cpp

[PATCH] D84136: [clang] Fix visitation of ConceptSpecializationExpr in constrained-parameter

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. > Will do. By the way, is there something more tailored than ninja check-clang > to run these ast-dump tests? ninja check-clang takes quite a while to run... You can use `check-clang-ast` for the lit tests in `AST/`, `check-clang-sema` for the lit tests in `Sema/` an

[PATCH] D84461: [Concepts] Fix ast dump for immediately declared constraint.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/AST/ast-dump-concepts.cpp:1 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++2a -ast-dump -ast-dump-filter Foo %s | FileCheck -strict-whitespace %s + Can you also test for serialization by round-

[PATCH] D84656: [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, aaron.ballman, erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Background: --- There are two related argument types which can be sent into a diagnostic to display the name of an e

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, aaron.ballman, erichkeane. riccibruno added a project: clang. Herald added subscribers: cfe-commits, arphaman, dexonsmith. See D84656 for the background on `NamedDecl::printName`. This patch o

[PATCH] D84656: [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84656#2175813 , @erichkeane wrote: > I looked through the code changes, and they all seem quite mechanical. I > believe they are all correct. > > After reading through the test changes, I believe that this change is > str

[PATCH] D81865: use string tables for static diagnostic descriptions

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Add some reviewers based on `git diff --name-only | xargs -n 1 git blame --porcelain | grep "^author " | sort | uniq -c | sort -nr | head -30`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81865/new/ https://reviews.l

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added inline comments. Comment at: clang/lib/AST/Decl.cpp:2032 + // additional complexity needed to prevent this is not worthwhile. + OS << (Policy.MSVCFormatting ? '`' : '(') + << (IsAnonymousStructOrUnion ? "anonymou

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: clang/lib/AST/Decl.cpp:2032 + // additional complexity needed to prevent this is not worthwhile. + OS << (Policy.MSVCFormatting ? '`' : '(') + << (IsAnonymousStructOrUnion ? "anonymou

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281019. riccibruno marked 2 inline comments as done. riccibruno added a comment. Remove a few missed `getPackingKind`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84306/new/ https://reviews.llvm.org/D84306

[PATCH] D84656: [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84656#2176139 , @aaron.ballman wrote: > The changes LGTM but it seems like there may be some formatting issues with > the patch (or the lint tool is acting up). Looks like the bot is right this time. Thanks! Repository

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281044. riccibruno marked 3 inline comments as done. riccibruno added a comment. Address Erich's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84658/new/ https://reviews.llvm.org/D84658 Files: c

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: clang/lib/AST/Decl.cpp:2032 + // additional complexity needed to prevent this is not worthwhile. + OS << (Policy.MSVCFormatting ? '`' : '(') + << (IsAnonymousStructOrUnion ? "anonymou

[PATCH] D84678: [clang] False line number in a function definition with "void" parameter

2020-07-27 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/Sema/void-argument.cpp:1 +// RUN: not %clang_cc1 %s 2>&1 | FileCheck %s + These kinds of tests are typically done with a `-verify` test. See the other tests in `Sema/` for examples. Repository: rG LLVM

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D84306#2177985 , @MyDeveloperDay wrote: > Thank you for the patch, this LGTM, I think this kind of change should help > reduce memory usage and I feel improves the readability. Thanks for your review! Repository: rG LL

[PATCH] D84678: [clang] False line number in a function definition with "void" parameter

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/test/Sema/void-argument.cpp:1 +// RUN: not %clang_cc1 %s 2>&1 | FileCheck %s + Jac1494 wrote: > riccibruno wrote: > > These kinds of tests are typically done with a `-verify` test. See the > > other tests in `S

[PATCH] D84656: [clang] Pass the NamedDecl* instead of the DeclarationName into many diagnostics.

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGeb10b065f2a8: [clang] Pass the NamedDecl* instead of the DeclarationName into many… (authored by riccibruno). Changed prior to commit: https://rev

[PATCH] D84306: [clang-format][NFC] Be more careful about the layout of FormatToken.

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf5acd11d2c0e: [clang-format][NFC] Be more careful about the layout of FormatToken. (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84

[PATCH] D84599: [clang-index] Use NamedDecl::getDeclName() instead of NamedDecl::printName in USRGenerator::EmitDeclName

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. The overloads of `NamedDecl::printName` are in D84658 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84599/new/ https://reviews.llvm.org/D84599

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Note that I am planning two improvements as a follow-up to this patch: - For a parameter `(unnamed variable at {{.*}}:: of type )` -> `(unnamed parameter at {{.*}}:: of type )` - For a lambda: - `(unnamed class at {{.*}}::)` -> `(lambda at {{.*}}::)` - For a capt

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281371. riccibruno edited the summary of this revision. riccibruno added a comment. Use a less generic name instead of `get{Open,Close}Delimiter`. I went with `get{Open,Close}DelimiterForUnnamedEntity` but I am happy to change it. Repository: rG LLVM G

[PATCH] D84658: [clang] Overload NamedDecl::printName to provide a user-friendly name for unnamed entities

2020-07-28 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 281373. riccibruno added a comment. Add the forgotten context. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84658/new/ https://reviews.llvm.org/D84658 Files: clang/include/clang/AST/Decl.h clang/includ

[PATCH] D84005: Introduce ns_error_domain attribute.

2020-07-29 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:5342 +S.Diag(Loc, diag::err_nserrordomain_invalid_decl) +<< 1 << DRE->getNameInfo().getName(); +return; Just send the declaration into the diagnostic. See the recent D84

[PATCH] D84005: Introduce ns_error_domain attribute.

2020-07-29 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:3650 S.Diag(Field->getLocation(), diag::warn_transparent_union_attribute_field_size_align) << isSize << *Field << FieldBits; gribozavr2 wrote: > Please u

[PATCH] D81330: [clang][Sema] SequenceChecker: C++17 sequencing rule for overloaded operators.

2020-06-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: rsmith. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. riccibruno added a parent revision: D81003: [clang][Sema] SequenceChecker: Also visit default arguments.. In C++17 the operand(s) of an overloaded oper

[PATCH] D57660: [Sema] SequenceChecker: Handle references, members and structured bindings.

2020-06-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:2031-2033 + "%select{|member |static member }0%2" + "%select{| of %3| of struct %4| of union %4| of class %4" + "| of structured binding

[PATCH] D81455: [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits enumerations from TokenKinds.def...

2020-06-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: aaron.ballman. riccibruno added a project: clang. Herald added subscribers: sstefan1, mgorny. Herald added a reviewer: jdoerfert. riccibruno marked an inline comment as done. riccibruno added inline comments. riccibruno marked 2 inline

[PATCH] D81455: [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits enumerations from TokenKinds.def...

2020-06-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: clang/include/clang/Basic/TokenKinds.def:65 +#endif #ifndef ALIAS #define ALIAS(X,Y,Z) It is slightly unfortunate to have to use both `UNARY_EXPR_OR_TYPE_TRAIT` and `CXX

[PATCH] D81455: [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits enumerations from TokenKinds.def...

2020-06-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6008 def ext_sizeof_alignof_void_type : Extension< - "invalid application of '%sub{select_unary_expr_or_type_trait_kind}0' " - "to a void

[PATCH] D80366: [Analyzer] Add `getReturnValueUnderConstruction()` to `CallEvent`

2020-06-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Warning (from eg: http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/32043): /home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:1102:23: warning: 'getDecl' overrides a m

[PATCH] D81455: [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits enumerations from TokenKinds.def...

2020-06-10 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added a comment. Thanks for the review Aaron! I have added some comments inline. Comment at: clang/lib/Basic/ExpressionTraits.cpp:29-34 + assert(T <= ET_Last && "invalid enum value!"); + return ExpressionTraitNames[T]; +

[PATCH] D81615: [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local variables in default arguments.

2020-06-10 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: bkramer, rjmccall, rsmith, erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. This patch implements the resolution of CWG 2082 and CWG 2346. The resolution of CWG 2082 changed [dcl.fct.default]p7 an

[PATCH] D81616: [clang] Convert a default argument expression to the parameter type before checking that the default argument is valid with CheckDefaultArgumentVisitor.

2020-06-10 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: bkramer, rjmccall, rsmith, erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. riccibruno added a parent revision: D81615: [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local var

[PATCH] D81615: [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local variables in default arguments.

2020-06-11 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 270100. riccibruno marked an inline comment as done. riccibruno added a comment. Add the example in `clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p9.cpp` as requested. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D81615: [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local variables in default arguments.

2020-06-11 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5951ff451233: [clang] CWG 2082 and 2346: loosen the restrictions on parameters and local… (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D81455: [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits enumerations from TokenKinds.def...

2020-06-11 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 6 inline comments as done. riccibruno added a comment. In D81455#2087286 , @aaron.ballman wrote: > LGTM, your choice on hiding in TokenKinds.def. > Oh! I see now what's going on and that's clever; I was misunderstanding the > second

[PATCH] D81616: [clang] Convert a default argument expression to the parameter type before checking that the default argument is valid with CheckDefaultArgumentVisitor.

2020-06-11 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG40ea01f6543d: [clang] Convert a default argument expression to the parameter type... (authored by riccibruno). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D81641: [SYCL] Implement thread-local storage restriction

2020-06-11 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:216 + if (getLangOpts().SYCLIsDevice) +if (auto VD = dyn_cast(D)) + if (VD->getTLSKind() != VarDecl::TLS_None) Nit: The convention is `auto *VD`. Repository: rG LLVM Github Mo

[PATCH] D81455: [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits enumerations from TokenKinds.def...

2020-06-11 Thread Bruno Ricci via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG78e636b3f2f0: [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits... (authored by riccibruno). Changed prior to commit: https://reviews.llvm.org/D81455?vs=269467&id=270121#toc R

[PATCH] D81786: [clang][utils] Modify make-ast-dump-check.sh to generate AST serialization dump tests

2020-06-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Example of a test: F12153075: ast-dump-lambda.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81786/new/ https://reviews.llvm.org/D81786

[PATCH] D81786: [clang][utils] Modify make-ast-dump-check.sh to generate AST serialization dump tests

2020-06-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: aaron.ballman, stephenkelly. riccibruno added a project: clang. Herald added a reviewer: jdoerfert. Herald added subscribers: cfe-commits, sstefan1. riccibruno added a comment. Example of a test: F12153075: ast-dump-lambda.cpp

[PATCH] D81787: [clang] Fix the serialization of LambdaExpr and the bogus mutation in LambdaExpr::getBody

2020-06-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: jyknight, GorNishanov, aaron.ballman. riccibruno added a project: clang. Herald added subscribers: cfe-commits, modocache. The body of `LambdaExpr` is currently not properly serialized. Instead `LambdaExpr::getBody` checks if the body

[PATCH] D81786: [clang][utils] Modify make-ast-dump-check.sh to generate AST serialization dump tests

2020-06-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In D81786#2091387 , @lebedev.ri wrote: > +1, thank you for looking into this! > I suspect there's a few issues to be discovered with this :) Indeed; I already got one in D81787 . Repository:

[PATCH] D81786: [clang][utils] Modify make-ast-dump-check.sh to generate AST serialization dump tests

2020-06-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a reviewer: lebedev.ri. riccibruno added a comment. Summarising a quick discussion with @lebedev.ri on IRC yesterday: this is not necessarily the best way to test the serialization of AST nodes, in that we could instead perform some kind of structural equivalence test. However

[PATCH] D81330: [clang] SequenceChecker: C++17 sequencing rule for overloaded operators.

2020-06-16 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. @rsmith Friendly ping on this patch and D81003 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81330/new/ https://reviews.llvm.org/D81330 _

[PATCH] D81787: [clang] Fix the serialization of LambdaExpr and the bogus mutation in LambdaExpr::getBody

2020-06-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 4 inline comments as done. riccibruno added inline comments. Comment at: clang/include/clang/AST/ExprCXX.h:2012-2017 + Stmt *getBody() const { return getStoredStmts()[capture_size()]; } + + /// Retrieve the \p CompoundStmt representing the body of the lambda.

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-06-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 3 inline comments as done. riccibruno added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:2126 + "in default initializer used here">; def select_initialized_entity_kind : TextSubstitution< I should just use `%

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-06-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 271464. riccibruno retitled this revision from "[clang] SequenceChecker: Also visit default arguments." to "[clang] SequenceChecker: Also visit default arguments and default initializers.". riccibruno edited the summary of this revision. riccibruno added a

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-06-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: clang/test/SemaCXX/warn-unsequenced.cpp:313 +// +// However SequenceChecker::VisitCXXConstructExpr only visit the arguments +// of the CXXConstructExpr and is not visiting the a

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-06-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: clang/test/SemaCXX/warn-unsequenced.cpp:313 +// +// However SequenceChecker::VisitCXXConstructExpr only visit the arguments +// of the CXXConstructExpr and is not visiting the a

[PATCH] D81003: [clang] SequenceChecker: Also visit default arguments and default initializers.

2020-06-17 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 271480. riccibruno added a comment. Remove the FIXME comment in the `default_init` test. The behavior is actually fine since `struct S { int b = ++a; };` is not an aggregate in C++11 but is an aggregate in C++17. Repository: rG LLVM Github Monorepo C

<    1   2   3   4   5   6   7   >