[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] D50163: [AST] Remove the static_assert check in ObjCMethodDecl::ObjCMethodDecl

2018-08-02 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. The static_assert itself cannot be in the bitfield since the whole point is to avoid including Basic/IdentifierTable.h just for this. I originally put the static_assert in ObjCMethodDecl and everything worked fine when tested with GCC but I then saw just after you

[PATCH] D50261: [AST] Remove unnecessary indirections in DeclarationNameTable

2018-08-03 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added reviewers: erichkeane, rsmith, rnk. bricci added a project: clang. Herald added a subscriber: cfe-commits. DeclarationNameTable currently hold 3 void * to FoldingSet, FoldingSet and FoldingSet. CXXSpecialName, CXXLiteralOperatorIdName and

[PATCH] D50261: [AST] Remove unnecessary indirections in DeclarationNameTable

2018-08-03 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. It seems to me that the increased size of DeclarationNameTable is irrelevant since it is only used as a member in ASTContext and never copied nor moved from. Also, at least for C++ it seems to me that this structure is never "rarely used" since it is used for every

[PATCH] D50261: [AST] Remove unnecessary indirections in DeclarationNameTable

2018-08-03 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 159044. bricci marked an inline comment as done. bricci added a comment. Added the deleted move ctors. (I think that they were already not declared because of the user-provided copy ctor/assignment) Will report the result about the build time but this will

[PATCH] D50261: [AST] Remove unnecessary indirections in DeclarationNameTable

2018-08-03 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. Additionally I have taken a quick look at the headers which includes DeclarationName.h and it seems that most of them already include Type.h (with the exception of DeclBase.h) If so then the build time shouldn't change much but I will report if there is any

[PATCH] D49790: [AST] Small doc update for DeclContext

2018-07-26 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157505. bricci edited the summary of this revision. bricci added a comment. Re-added the "friend class ASTWriter" after making hasNeedToReconcileExternalVisibleStorage, hasLazyLocalLexicalLookups and hasLazyExternalLexicalLookups in DeclContext private. This

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-26 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157522. bricci marked 2 inline comments as done. bricci added a comment. - Re-based: r337978 [ODRHash] Support hashing enums added an ODRHash to EnumDecl which conflicts with these changes. The corresponding flag HasODRHash has been put into

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-08-01 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 158498. bricci added a comment. rebased after the great whitespace trimming Repository: rC Clang https://reviews.llvm.org/D49729 Files: include/clang/AST/Decl.h include/clang/AST/DeclBase.h lib/AST/Decl.cpp lib/AST/DeclBase.cpp

[PATCH] D49734: [AST][4/4] Move the bit-fields from ObjCMethodDecl and ObjCContainerDecl into DeclContext

2018-08-01 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 158499. bricci added a comment. rebased after the great whitespace trimming Repository: rC Clang https://reviews.llvm.org/D49734 Files: include/clang/AST/DeclObjC.h lib/AST/DeclObjC.cpp lib/Sema/SemaDeclObjC.cpp

[PATCH] D49732: [AST][2/4] Move the bit-fields from FunctionDecl and CXXConstructorDecl into DeclContext

2018-08-01 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 158501. bricci added a comment. rebased after the great whitespace trimming Repository: rC Clang https://reviews.llvm.org/D49732 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h lib/AST/Decl.cpp lib/AST/DeclCXX.cpp

[PATCH] D49733: [AST][3/4] Move the bit-fields from BlockDecl, LinkageSpecDecl and OMPDeclareReductionDecl into DeclContext

2018-08-01 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 158500. bricci added a comment. rebased after the great whitespace trimming Repository: rC Clang https://reviews.llvm.org/D49733 Files: include/clang/AST/Decl.h include/clang/AST/DeclCXX.h include/clang/AST/DeclOpenMP.h lib/AST/Decl.cpp

[PATCH] D50261: [AST] Remove unnecessary indirections in DeclarationNameTable

2018-08-04 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. I did both a clean build and an incremental build with and without this patch and was not able to see any meaningful difference in the build time. Suspiciously the build time *with* the patch in both cases is a little less (~0.1% ) than without the patch but this is well

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-08-01 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. @erichkeane do you have any additional comments regarding this set of patches ? I retested them on top of trunk and did not find any problem. Repository: rC Clang https://reviews.llvm.org/D49729 ___ cfe-commits mailing

[PATCH] D50163: [AST] Remove the static_assert check in ObjCMethodDecl::ObjCMethodDecl

2018-08-01 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added a project: clang. Herald added a subscriber: cfe-commits. This check was introduced by r338641 but this broke some builds. For now remove it. Repository: rC Clang https://reviews.llvm.org/D50163 Files: lib/AST/DeclObjC.cpp Index:

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-08-06 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. Added some comments inline. However I have not looked at the logic too closely and have not looked at the tests at all. Comment at: cfe/trunk/include/clang/AST/ASTContext.h:1966 unsigned char getFixedPointIBits(QualType Ty) const; +

[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Also I don't understand to comment about the bit-fields of FunctionType fitting in the padding of Type: If we have something like struct Base { void *p1; void *p2; unsigned x; }; struct Der : Base { unsigned x; }; Then on my machine (64

[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. @rjmccall I would argue that we should make these bit-fields take 8 bytes for the following reasons: 1. On 64 bits archs, this is free since we have already 8 bytes of padding here. 2. On 32 bits archs, this a priori increase the size of each Type by 4 bytes.

[PATCH] D50643: [AST] Pack the bits of TemplateSpecializationType into Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. I don't like these bit-field abuses too much but this is used all over the place in clang and so if this breaks so many things are going to break. Repository: rC Clang https://reviews.llvm.org/D50643 ___ cfe-commits

[PATCH] D50643: [AST] Pack the bits of TemplateSpecializationType into Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. All of these bitfields (ab)use are already UB I think... I don't see what is special in this case... Repository: rC Clang https://reviews.llvm.org/D50643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D50713: [AST] Pack the unsigned of SubstTemplateTypeParmPackType into Type

2018-08-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: include/clang/AST/Type.h:1634 + +/// The number of template arguments in \c Arguments. +/// Intentionally not a bitfield since we have plenty of space left. erichkeane wrote: > I would love it if we commented

[PATCH] D50713: [AST] Pack the unsigned of SubstTemplateTypeParmPackType into Type

2018-08-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 160795. riccibruno added a comment. updated the comment in SubstTemplateTypeParmPackTypeBitfields Repository: rC Clang https://reviews.llvm.org/D50713 Files: include/clang/AST/Type.h lib/AST/Type.cpp Index: lib/AST/Type.cpp

[PATCH] D50713: [AST] Pack the unsigned of SubstTemplateTypeParmPackType into Type

2018-08-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. This comment seems fine. I will also add a similar comment to `TemplateSpecializationTypeBitfields`, `DependentTemplateSpecializationTypeBitfields` and `PackExpansionTypeBitfields` since they all 3 have a similar `unsigned`. Repository: rC Clang

[PATCH] D50711: [AST] Pack the unsigned of PackExpansionType into Type

2018-08-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 160804. riccibruno added a comment. update the comment in PackExpansionTypeBitfields Repository: rC Clang https://reviews.llvm.org/D50711 Files: include/clang/AST/Type.h Index: include/clang/AST/Type.h

[PATCH] D50713: [AST] Pack the unsigned of SubstTemplateTypeParmPackType into Type

2018-08-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. The thing is that I have no idea what is the minimum number of bits required. It was originally an unsigned but I suspect that 32 bits are not needed. Looking at [implimits] I see Template arguments in a template declaration [1 024]. Recursively nested template

[PATCH] D50712: [AST] Pack the unsigned of DependentTemplateSpecializationType into Type

2018-08-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 160800. riccibruno added a comment. updated the comment in DependentTemplateSpecializationTypeBitfields Repository: rC Clang https://reviews.llvm.org/D50712 Files: include/clang/AST/Type.h lib/AST/Type.cpp Index: lib/AST/Type.cpp

[PATCH] D50643: [AST] Pack the bits of TemplateSpecializationType into Type

2018-08-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 160805. riccibruno added a comment. update the comment in TemplateSpecializationTypeBitfields Repository: rC Clang https://reviews.llvm.org/D50643 Files: include/clang/AST/Type.h lib/AST/Type.cpp Index: lib/AST/Type.cpp

[PATCH] D50631: [AST] Stuff more data into FunctionTypeBitfields

2018-08-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. @rsmith Could you comment on whether limiting the number of types in a dynamic exception specification to 127 is acceptable ? I had to steal two bits from `NumExceptions` to make all the fields fit. If this is a bad idea then a possibility would be to put

[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In https://reviews.llvm.org/D50630#1197930, @rjmccall wrote: > In https://reviews.llvm.org/D50630#1197795, @riccibruno wrote: > > > @rjmccall > > > > I would argue that we should make these bit-fields take 8 bytes for the > > following reasons: > > > > 1. On 64 bits

[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

2018-08-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. I actually have patches for TemplateSpecializationType, PackExpansionType, DependentTemplateSpecializationType and SubstTemplateTypeParmPackType which move the unsigned to the bit-fields in Type. The same could be done for the others I suppose. This assume that the

[PATCH] D50631: [AST] Stuff more data into FunctionTypeBitfields

2018-08-16 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno planned changes to this revision. riccibruno added a comment. I Will put `NumExceptions` in a trailing object. However it seems that `FunctionProtoType` can be substantially cleaned up by converting it to use `llvm::TrailingObjects` instead of manually doing the casts+arithmetic.

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-08-07 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. Just to provide a bit of additional context: My comment about fsyntax-only is not specific to fsyntax-only. This is just an handy way to benchmark the frontend without noise from LLVM. It is important to keep all frequently used structures small (within reason) even if

[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: erichkeane, rjmccall. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. The current static_assert only checks that ObjCObjectTypeBitfields fits into an unsigned. However it turns out that FunctionTypeBitfields

[PATCH] D50631: [AST] Stuff more data into FunctionTypeBitfields

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: erichkeane, rjmccall. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Since FunctionTypeBitfields is already > 32 bits wide we might as well stuff the remaining bits from FunctionProtoType into it. The patch

[PATCH] D50631: [AST] Stuff more data into FunctionTypeBitfields

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: include/clang/AST/Type.h:1530 +/// The number of types in the exception spec, if any. +unsigned NumExceptions : 9; + erichkeane wrote: > IMO (and @rsmith should respond here instead), if we were looking to

[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added inline comments. Comment at: include/clang/AST/Type.h:1639 + +static_assert(sizeof(TypeBitfields) <= 4, + "TypeBitfields is larger than 4 bytes!"); erichkeane wrote: > I don't

[PATCH] D50630: [AST] Update/correct the static_asserts for the bit-fields in Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 160368. riccibruno marked an inline comment as done. Repository: rC Clang https://reviews.llvm.org/D50630 Files: include/clang/AST/Type.h Index: include/clang/AST/Type.h === ---

[PATCH] D50631: [AST] Stuff more data into FunctionTypeBitfields

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 160369. riccibruno marked 5 inline comments as done. riccibruno edited the summary of this revision. riccibruno added a comment. Bumped the number of bits for parameters from 12 to 14, stealing from NumExceptions. This means that now (unless limited by

[PATCH] D50643: [AST] Pack the bits of TemplateSpecializationType into Type

2018-08-13 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Type has enough space for two members of TemplateSpecializationType. Mechanical patch. Repository: rC Clang https://reviews.llvm.org/D50643

[PATCH] D50711: [AST] Pack the unsigned of PackExpansionType into Type

2018-08-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, rjmccall, erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. The bit-fields of Type have enough space for the `unsigned NumExpansions` of PackExpansionType Repository: rC Clang

[PATCH] D50712: [AST] Pack the unsigned of DependentTemplateSpecializationType into Type

2018-08-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, rjmccall, erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. The bit-fields of `Type` have enough space for the member `unsigned NumArgs` of DependentTemplateSpecializationType Repository:

[PATCH] D50713: [AST] Pack the unsigned of SubstTemplateTypeParmPackType into Type

2018-08-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, rjmccall, erichkeane. riccibruno added a project: clang. Herald added a reviewer: javed.absar. Herald added subscribers: cfe-commits, chrib, kristof.beyls. The bit-fields of `Type` have enough space for the member `unsigned

[PATCH] D50715: [AST] Store the OwnedTagDecl as a trailing object in ElaboratedType.

2018-08-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added reviewers: rsmith, rjmccall, erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. The `TagDecl *OwnedTagDecl` in `ElaboratedType` is quite commonly null (at least when parsing all of Boost, it is non-null for

[PATCH] D50532: Fix a wrong type bug in ParsedAttr::TypeTagForDatatypeData

2018-08-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: erichkeane. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. This patch fixes a wrong type bug inside `ParsedAttr::TypeTagForDatatypeData`. The details to the best of my knowledge are as follow. The

[PATCH] D50531: [NFC] Convert ParsedAttr to use llvm::TrailingObjects

2018-08-09 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Some inline comments. Since you already committed it I don't think it is worth bothering with them. Comment at: cfe/trunk/include/clang/Sema/ParsedAttr.h:124 + detail::TypeTagForDatatypeData, ParsedType, detail::PropertyData>; + + size_t

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-08-06 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. Just a nit but could you please add new-lines to your commit messages. Also the 3 bools in FixedPointSemantics are a little bit wasteful. Repository: rL LLVM https://reviews.llvm.org/D48661 ___ cfe-commits mailing list

[PATCH] D48661: [Fixed Point Arithmetic] Fixed Point Constant

2018-08-06 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. And using the name Sema is a bad idea IMHO since this has a totally different meaning in clang. Repository: rL LLVM https://reviews.llvm.org/D48661 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D50261: [AST] Remove unnecessary indirections in DeclarationNameTable

2018-08-06 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. Yes it would be nice indeed. IIRC it is only needed for QualType in one of the moved class. This patch is especially nice since it both cleanup the code and speed up clang :) Repository: rL LLVM https://reviews.llvm.org/D50261

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

2018-07-20 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. @bkramer Thanks for the review! Can you commit it for my since I can not do it myself? Repository: rC Clang https://reviews.llvm.org/D49302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[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] 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] D49790: [AST] Small doc update for DeclContext

2018-07-25 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added a project: clang. Herald added a subscriber: cfe-commits. Factored out from https://reviews.llvm.org/D49729 following @erichkeane comments. - Add missing classes in the list of classes deriving directly from DeclContext. - Move the friend declarations

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-25 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157231. bricci marked 10 inline comments as done. bricci added a comment. address @erichkeane comments: - ran clang-format on changed parts - made the setters setNumPositiveBits, setNumPositiveBits, setScoped, setScopedUsingClassTag and setFixed in EnumDecl

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-25 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. It might be better to wait just after the upcoming release branch in any case since even though it is all NFC this causes a bit of churn. Repository: rC Clang https://reviews.llvm.org/D49729 ___ cfe-commits mailing list

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-25 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157288. bricci added a comment. - clang-format on the changes in the .cpp files Repository: rC Clang https://reviews.llvm.org/D49729 Files: include/clang/AST/Decl.h include/clang/AST/DeclBase.h lib/AST/Decl.cpp lib/AST/DeclBase.cpp

[PATCH] D49733: [AST][3/4] Move the bit-fields from BlockDecl, LinkageSpecDecl and OMPDeclareReductionDecl into DeclContext

2018-07-25 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157291. bricci marked an inline comment as done. bricci added a comment. - clang-format on the changes - removed the unnecessary hasBracesImpl and setBracesImpl Repository: rC Clang https://reviews.llvm.org/D49733 Files: include/clang/AST/Decl.h

[PATCH] D49732: [AST][2/4] Move the bit-fields from FunctionDecl and CXXConstructorDecl into DeclContext

2018-07-25 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157289. bricci marked 2 inline comments as done. bricci added a comment. - ran clang-format on the changes - removed the unnecessary setPureImpl, isMultiVersionImpl and setMultiVersionImpl. However unfortunately I think that isDeletedImpl has to stay because

[PATCH] D49734: [AST][4/4] Move the bit-fields from ObjCMethodDecl and ObjCContainerDecl into DeclContext

2018-07-25 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157293. bricci marked an inline comment as done. bricci added a comment. - clang-format on the changes - remove the unnecessary getFamilyImpl and setFamilyImpl Repository: rC Clang https://reviews.llvm.org/D49734 Files: include/clang/AST/DeclObjC.h

[PATCH] D49728: diff space

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D49728 Files: stat Index: stat === --- stat +++ stat @@ -66,54 +66,54 @@ 665/34195 implicit move assignment

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157052. bricci added a comment. updated some some comments in DeclContext Repository: rC Clang https://reviews.llvm.org/D49729 Files: include/clang/AST/Decl.h include/clang/AST/DeclBase.h lib/AST/Decl.cpp lib/AST/DeclBase.cpp

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci added a comment. added some inline comments Comment at: include/clang/AST/DeclBase.h:1662 + enum { NumBlockDeclBits = 5 }; /// Pointer to the data structure used to lookup declarations uint64_t is used here because we will always store more than

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added a project: clang. Herald added a subscriber: cfe-commits. DeclContext has a little less than 8 bytes free due to the alignment requirements on 64 bits archs. This set of patches moves the bit-fields from classes deriving from DeclContext into

[PATCH] D49733: [AST][3/4] Move the bit-fields from BlockDecl, LinkageSpecDecl and OMPDeclareReductionDecl into DeclContext

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added a project: clang. Herald added a subscriber: cfe-commits. This patch follows https://reviews.llvm.org/D49729 and https://reviews.llvm.org/D49732, Move the bits from BlockDecl, LinkageSpecDecl and OMPDeclareReductionDecl into DeclContext. Repository:

[PATCH] D49732: [AST][2/4] Move the bit-fields from FunctionDecl and CXXConstructorDecl into DeclContext

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added a project: clang. Herald added a subscriber: cfe-commits. This patch follows https://reviews.llvm.org/D49729 and moves the bits from FunctionDecl and CXXConstructorDecl into DeclContext. Repository: rC Clang https://reviews.llvm.org/D49732 Files:

[PATCH] D49734: [AST][4/4] Move the bit-fields from ObjCMethodDecl and ObjCContainerDecl into DeclContext

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci created this revision. bricci added a project: clang. Herald added a subscriber: cfe-commits. This patch follows https://reviews.llvm.org/D49729, https://reviews.llvm.org/D49732 and https://reviews.llvm.org/D49733. Move the bits from ObjCMethodDecl and ObjCContainerDecl into DeclContext.

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci marked an inline comment as done. bricci added a comment. remove the inline comment about uint64_t. Repository: rC Clang https://reviews.llvm.org/D49729 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D49729: [AST][1/4] Move the bit-fields from TagDecl, EnumDecl and RecordDecl into DeclContext

2018-07-24 Thread Bruno Ricci via Phabricator via cfe-commits
bricci updated this revision to Diff 157063. bricci added a comment. - removed some unrelated change - add a comment about why uint64_t instead of unsigned Repository: rC Clang https://reviews.llvm.org/D49729 Files: include/clang/AST/Decl.h include/clang/AST/DeclBase.h

[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.

[PATCH] D53607: [AST] Only store the needed data in IfStmt.

2018-10-24 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. To add on the issue of changing the order of the children. The more I think about it the less it seems to be a good idea. Every test passes but I strongly suspect that a lot of code subtly rely on this. Repository: rC Clang https://reviews.llvm.org/D53607

[PATCH] D53604: [AST] Widen the bit-fields of Stmt to 8 bytes

2018-10-23 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. Although some classes are using the tail padding of Stmt, most of them are not. In particular the expression classes are not using it since there is

[PATCH] D53605: [AST] Pack PredefinedExpr

2018-10-23 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. riccibruno added a dependency: D53604: [AST] Widen the bit-fields of Stmt to 8 bytes. This patch does 3 things: 1. Move PredefinedExpr below

[PATCH] D53607: [AST] Only store the needed data in IfStmt.

2018-10-23 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: rjmccall. riccibruno added a project: clang. Herald added subscribers: cfe-commits, javed.absar. riccibruno added a dependency: D53605: [AST] Pack PredefinedExpr. Only store the needed data in `IfStmt`. The various `Stmt *` are put in

[PATCH] D53609: [AST] Don't store data for GNU range case statement if not needed.

2018-10-23 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. Don't store the data for case statements of the form `LHS ... RHS` if not needed. This cuts the size of `CaseStmt` by 1 pointer + 1 `SourceLocation`

[PATCH] D53610: [AST] Check that GNU range case statements are correctly imported.

2018-10-23 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. The test for case statements did not cover GNU range case statements. Repository: rC Clang https://reviews.llvm.org/D53610 Files:

[PATCH] D53717: [AST] Only store the needed data in ForStmt.

2018-10-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In https://reviews.llvm.org/D53717#1276388, @rsmith wrote: > In https://reviews.llvm.org/D53717#1276245, @rsmith wrote: > > > Do you have evidence that this complexity is worthwhile? (I wouldn't > > imagine we have very many `ForStmt`s per translation unit, so saving

[PATCH] D53605: [AST] Refactor PredefinedExpr

2018-10-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171326. riccibruno marked 4 inline comments as done. riccibruno retitled this revision from "[AST] Pack PredefinedExpr" to "[AST] Refactor PredefinedExpr". riccibruno edited the summary of this revision. riccibruno added a comment. Address rjmcall's

[PATCH] D53607: [AST] Only store the needed data in IfStmt.

2018-10-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171332. riccibruno added a reviewer: rsmith. riccibruno added a comment. Add a flag to the output of -ast-dump indicating which sub-statement `IfStmt` is storing. This removes the ambiguity in the output of -ast-dump and addresses rsmith's comment in

[PATCH] D53609: [AST] Don't store data for GNU range case statement if not needed.

2018-10-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171336. riccibruno added a reviewer: rsmith. riccibruno added a comment. Add a flag in the output of -ast-dump to indicate that a `CaseStmt` is a GNU range case statement, following rsmith's comment in https://reviews.llvm.org/D53717 Repository: rC

[PATCH] D53607: [AST] Only store the needed data in IfStmt.

2018-10-25 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171121. riccibruno edited the summary of this revision. riccibruno added a comment. Reworked so that the order of the children is kept the same. Repository: rC Clang https://reviews.llvm.org/D53607 Files: include/clang/AST/Stmt.h

[PATCH] D53609: [AST] Don't store data for GNU range case statement if not needed.

2018-10-25 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171124. riccibruno added a comment. Reworked so that the order of the children is kept the same. Repository: rC Clang https://reviews.llvm.org/D53609 Files: include/clang/AST/Stmt.h lib/AST/ASTImporter.cpp lib/AST/Stmt.cpp

[PATCH] D53715: [AST] Only store the needed data in WhileStmt.

2018-10-25 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. Don't store the data for the condition variable if not needed. This cuts the size of `WhileStmt` by up to a pointer. The order of the children is

[PATCH] D53716: [AST] Only store data for the NRVO candidate in ReturnStmt if needed.

2018-10-25 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: rjmccall. riccibruno added a project: clang. Herald added subscribers: cfe-commits, javed.absar. Only store the NRVO candidate if needed in `ReturnStmt`. A good chuck of all of the `ReturnStmt` have no NRVO candidate. For all of them

[PATCH] D53610: [AST] Check that GNU range case statements are correctly imported.

2018-10-25 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171125. riccibruno added a comment. rebased Repository: rC Clang https://reviews.llvm.org/D53610 Files: test/Import/switch-stmt/Inputs/F.cpp test/Import/switch-stmt/test.cpp Index: test/Import/switch-stmt/test.cpp

[PATCH] D53717: [AST] Only store the needed data in ForStmt.

2018-10-25 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. riccibruno added a dependency: D53716: [AST] Only store data for the NRVO candidate in ReturnStmt if needed.. Don't store the init statement and

[PATCH] D53714: [AST] Only store the needed data in SwitchStmt.

2018-10-25 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. Don't store the data for the init statement and condition variable if not needed. This cuts the size of `SwitchStmt` by up to 2 pointers. The order

[PATCH] D53715: [AST] Only store the needed data in WhileStmt.

2018-10-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171338. riccibruno added a reviewer: rsmith. riccibruno added a comment. Add a flag to the output of -ast-dump indicating which sub-statement a `WhileStmt` is storing. Repository: rC Clang https://reviews.llvm.org/D53715 Files:

[PATCH] D53714: [AST] Only store the needed data in SwitchStmt.

2018-10-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171337. riccibruno added a reviewer: rsmith. riccibruno added a comment. Add a flag to the output of -ast-dump indicating which sub-statement a `SwitchStmt` is storing. This removes the ambiguity in the output of -ast-dump as per rsmith's comment in

[PATCH] D53717: [AST] Only store the needed data in ForStmt.

2018-10-26 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 171340. riccibruno marked 6 inline comments as done. riccibruno added a comment. Add a flag in the output of -ast-dump indicating which sub-statement the `ForStmt` is storing. This removes the ambiguity in the output of -ast-dump. Repository: rC Clang

[PATCH] D54161: [AST] Pack DeclRefExpr, UnaryOperator, MemberExpr and BinaryOperator

2018-11-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. Move some data to the newly available space in the bit-fields of `Stmt`. This cuts the size of `DeclRefExpr`, `UnaryOperator`, `MemberExpr` and

[PATCH] D54166: [AST] Store the string data in StringLiteral in a trailing array of chars

2018-11-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. Use the newly available space in the bit-fields of `Stmt` and store the string data in a trailing array of `char`s after the trailing array of

[PATCH] D54326: [AST] Pack CXXThrowExpr, CXXDefaultArgExpr and CXXDefaultInitExpr

2018-11-12 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno updated this revision to Diff 173652. Repository: rC Clang https://reviews.llvm.org/D54326 Files: include/clang/AST/ExprCXX.h include/clang/AST/Stmt.h lib/AST/ExprCXX.cpp lib/Serialization/ASTReaderStmt.cpp Index: lib/Serialization/ASTReaderStmt.cpp

[PATCH] D54526: [AST] Pack BinaryOperator

2018-11-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 6 inline comments as done. riccibruno added a comment. Marked the inline comments as done since I believe I answered each of them. If not I can fix it in a subsequent commit. Repository: rC Clang https://reviews.llvm.org/D54526

[PATCH] D54547: PTH-- Remove feature entirely-

2018-11-15 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In https://reviews.llvm.org/D54547#1299883, @erichkeane wrote: > Added to the release notes. Also, an email was sent out to cfe-dev. > > @riccibruno and I are separately looking into IdentifierInfo, because it > seems that there are some pretty massive optimization

[PATCH] D54172: [AST] Pack ArraySubscriptExpr and CallExpr

2018-11-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. Use the newly available space in the bit-fields of `Stmt` to store some data from `ArraySubscriptExpr` and `CallExpr`. This saves a pointer for each of

[PATCH] D54166: [AST] Store the string data in StringLiteral in a trailing array of chars

2018-11-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked 2 inline comments as done. riccibruno added a comment. In https://reviews.llvm.org/D54166#1298889, @rjmccall wrote: > IIRC, abbreviations just silently don't take effect if the record doesn't > conform; so things will appear to work, but the size on disk will be bigger. I

[PATCH] D54526: [AST] Pack BinaryOperator

2018-11-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno marked an inline comment as done. riccibruno added a comment. Added some inline comments. Comment at: include/clang/AST/Expr.h:3220 - SourceLocation getExprLoc() const LLVM_READONLY { return OpLoc; } - SourceLocation getOperatorLoc() const { return OpLoc; } -

[PATCH] D54525: [AST] Pack MemberExpr

2018-11-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added inline comments. Comment at: include/clang/AST/Expr.h:2802 - friend class ASTReader; - friend class ASTStmtWriter; }; Having this at the bottom is so painful for the reader, and people seems to put them at the top of the class usually. But

[PATCH] D54166: [AST] Store the string data in StringLiteral in a trailing array of chars

2018-11-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno added a comment. In https://reviews.llvm.org/D54166#1299230, @rjmccall wrote: > In https://reviews.llvm.org/D54166#1299149, @riccibruno wrote: > > > In https://reviews.llvm.org/D54166#1298889, @rjmccall wrote: > > > > > IIRC, abbreviations just silently don't take effect if the record

[PATCH] D54161: [AST] Pack DeclRefExpr, UnaryOperator, MemberExpr and BinaryOperator

2018-11-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno abandoned this revision. riccibruno added a comment. Broken into pieces and sent individually for review. Repository: rC Clang https://reviews.llvm.org/D54161 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D54525: [AST] Pack MemberExpr

2018-11-14 Thread Bruno Ricci via Phabricator via cfe-commits
riccibruno created this revision. riccibruno added a reviewer: dblaikie. riccibruno added a project: clang. Herald added a subscriber: cfe-commits. Use the newly available space in the bit-fields of `Stmt` to store some data from `MemberExpr`. This saves one pointer per `MemberExpr`.

  1   2   3   4   5   6   7   >