From 12dcbf43701c142e8313d322c14b53a6c2957826 Mon Sep 17 00:00:00 2001 From: Alexander Shaposhnikov Date: Sat, 24 Sep 2016 04:21:53 +0000 Subject: [PATCH] Remove excessive padding from RedeclarableResult This diff reorders the fields of the class RedeclarableResult to remove excessive padding. Test plan: make -j8 check-clang Differential revision: https://reviews.llvm.org/D24754 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282322 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Serialization/ASTReaderDecl.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 6272e1bf1c..bef161dbb5 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -146,13 +146,13 @@ namespace clang { /// Results from loading a RedeclarableDecl. class RedeclarableResult { - GlobalDeclID FirstID; Decl *MergeWith; + GlobalDeclID FirstID; bool IsKeyDecl; public: - RedeclarableResult(GlobalDeclID FirstID, Decl *MergeWith, bool IsKeyDecl) - : FirstID(FirstID), MergeWith(MergeWith), IsKeyDecl(IsKeyDecl) {} + RedeclarableResult(Decl *MergeWith, GlobalDeclID FirstID, bool IsKeyDecl) + : MergeWith(MergeWith), FirstID(FirstID), IsKeyDecl(IsKeyDecl) {} /// \brief Retrieve the first ID. GlobalDeclID getFirstID() const { return FirstID; } @@ -2311,7 +2311,7 @@ ASTDeclReader::VisitRedeclarable(Redeclarable *D) { if (IsFirstLocalDecl) Reader.PendingDeclChains.push_back(std::make_pair(DAsT, RedeclOffset)); - return RedeclarableResult(FirstDeclID, MergeWith, IsKeyDecl); + return RedeclarableResult(MergeWith, FirstDeclID, IsKeyDecl); } /// \brief Attempts to merge the given declaration (D) with another declaration @@ -2353,9 +2353,10 @@ void ASTDeclReader::mergeTemplatePattern(RedeclarableTemplateDecl *D, DeclID DsID, bool IsKeyDecl) { auto *DPattern = D->getTemplatedDecl(); auto *ExistingPattern = Existing->getTemplatedDecl(); - RedeclarableResult Result(DPattern->getCanonicalDecl()->getGlobalID(), - /*MergeWith*/ ExistingPattern, IsKeyDecl); - + RedeclarableResult Result(/*MergeWith*/ ExistingPattern, + DPattern->getCanonicalDecl()->getGlobalID(), + IsKeyDecl); + if (auto *DClass = dyn_cast(DPattern)) { // Merge with any existing definition. // FIXME: This is duplicated in several places. Refactor. -- 2.40.0