Skip to content

Commit 244e745

Browse files
committed
fmt
1 parent 855abec commit 244e745

File tree

5 files changed

+44
-44
lines changed

5 files changed

+44
-44
lines changed

clang/include/clang/AST/DeclTemplate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,8 @@ class RedeclarableTemplateDecl : public TemplateDecl,
739739
bool IsPartial = false;
740740
LazySpecializationInfo(uint32_t ID, unsigned Hash = ~0U,
741741
bool Partial = false)
742-
: DeclID(ID), ODRHash(Hash), IsPartial(Partial) { }
743-
LazySpecializationInfo() { }
742+
: DeclID(ID), ODRHash(Hash), IsPartial(Partial) {}
743+
LazySpecializationInfo() {}
744744
bool operator<(const LazySpecializationInfo &Other) const {
745745
return DeclID < Other.DeclID;
746746
}

clang/lib/AST/DeclTemplate.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#include "clang/AST/DeclCXX.h"
1717
#include "clang/AST/DeclarationName.h"
1818
#include "clang/AST/Expr.h"
19+
#include "clang/AST/ExprCXX.h"
1920
#include "clang/AST/ExternalASTSource.h"
21+
#include "clang/AST/ODRHash.h"
2022
#include "clang/AST/TemplateBase.h"
2123
#include "clang/AST/TemplateName.h"
2224
#include "clang/AST/Type.h"
23-
#include "clang/AST/ODRHash.h"
24-
#include "clang/AST/ExprCXX.h"
2525
#include "clang/AST/TypeLoc.h"
2626
#include "clang/Basic/Builtins.h"
2727
#include "clang/Basic/LLVM.h"
@@ -334,7 +334,7 @@ RedeclarableTemplateDecl::CommonBase *RedeclarableTemplateDecl::getCommonPtr() c
334334
}
335335

336336
void RedeclarableTemplateDecl::loadLazySpecializationsImpl(
337-
bool OnlyPartial/*=false*/) const {
337+
bool OnlyPartial /*=false*/) const {
338338
// Grab the most recent declaration to ensure we've loaded any lazy
339339
// redeclarations of this template.
340340
CommonBase *CommonBasePtr = getMostRecentDecl()->getCommonPtr();
@@ -343,33 +343,31 @@ void RedeclarableTemplateDecl::loadLazySpecializationsImpl(
343343
CommonBasePtr->LazySpecializations = nullptr;
344344
for (uint32_t I = 0, N = Specs[0].DeclID; I != N; ++I) {
345345
// Skip over already loaded specializations.
346-
if (!Specs[I+1].ODRHash)
346+
if (!Specs[I + 1].ODRHash)
347347
continue;
348-
if (!OnlyPartial || Specs[I+1].IsPartial)
349-
(void)loadLazySpecializationImpl(Specs[I+1]);
348+
if (!OnlyPartial || Specs[I + 1].IsPartial)
349+
(void)loadLazySpecializationImpl(Specs[I + 1]);
350350
}
351351
}
352352
}
353353

354354
Decl *RedeclarableTemplateDecl::loadLazySpecializationImpl(
355-
LazySpecializationInfo &LazySpecInfo) const {
355+
LazySpecializationInfo &LazySpecInfo) const {
356356
uint32_t ID = LazySpecInfo.DeclID;
357357
assert(ID && "Loading already loaded specialization!");
358358
// Note that we loaded the specialization.
359359
LazySpecInfo.DeclID = LazySpecInfo.ODRHash = LazySpecInfo.IsPartial = 0;
360360
return getASTContext().getExternalSource()->GetExternalDecl(ID);
361361
}
362362

363-
void
364-
RedeclarableTemplateDecl::loadLazySpecializationsImpl(ArrayRef<TemplateArgument>
365-
Args,
366-
TemplateParameterList *TPL) const {
363+
void RedeclarableTemplateDecl::loadLazySpecializationsImpl(
364+
ArrayRef<TemplateArgument> Args, TemplateParameterList *TPL) const {
367365
CommonBase *CommonBasePtr = getMostRecentDecl()->getCommonPtr();
368366
if (auto *Specs = CommonBasePtr->LazySpecializations) {
369367
unsigned Hash = TemplateArgumentList::ComputeODRHash(Args);
370368
for (uint32_t I = 0, N = Specs[0].DeclID; I != N; ++I)
371-
if (Specs[I+1].ODRHash && Specs[I+1].ODRHash == Hash)
372-
(void)loadLazySpecializationImpl(Specs[I+1]);
369+
if (Specs[I + 1].ODRHash && Specs[I + 1].ODRHash == Hash)
370+
(void)loadLazySpecializationImpl(Specs[I + 1]);
373371
}
374372
}
375373

@@ -546,7 +544,7 @@ ClassTemplateDecl *ClassTemplateDecl::CreateDeserialized(ASTContext &C,
546544
}
547545

548546
void ClassTemplateDecl::LoadLazySpecializations(
549-
bool OnlyPartial/*=false*/) const {
547+
bool OnlyPartial /*=false*/) const {
550548
loadLazySpecializationsImpl(OnlyPartial);
551549
}
552550

@@ -1275,7 +1273,7 @@ VarTemplateDecl *VarTemplateDecl::CreateDeserialized(ASTContext &C,
12751273
}
12761274

12771275
void VarTemplateDecl::LoadLazySpecializations(
1278-
bool OnlyPartial/*=false*/) const {
1276+
bool OnlyPartial /*=false*/) const {
12791277
loadLazySpecializationsImpl(OnlyPartial);
12801278
}
12811279

clang/lib/Serialization/ASTReaderDecl.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ namespace clang {
8888
const SourceLocation ThisDeclLoc;
8989

9090
using RecordData = ASTReader::RecordData;
91-
using LazySpecializationInfo
92-
= RedeclarableTemplateDecl::LazySpecializationInfo;
91+
using LazySpecializationInfo =
92+
RedeclarableTemplateDecl::LazySpecializationInfo;
9393

9494
TypeID DeferredTypeID = 0;
9595
unsigned AnonymousDeclNumber = 0;
@@ -274,9 +274,9 @@ namespace clang {
274274
: Reader(Reader), Record(Record), Loc(Loc), ThisDeclID(thisDeclID),
275275
ThisDeclLoc(ThisDeclLoc) {}
276276

277-
template <typename T> static
278-
void AddLazySpecializations(T *D,
279-
SmallVectorImpl<LazySpecializationInfo>& IDs) {
277+
template <typename T>
278+
static void
279+
AddLazySpecializations(T *D, SmallVectorImpl<LazySpecializationInfo> &IDs) {
280280
if (IDs.empty())
281281
return;
282282

@@ -328,7 +328,7 @@ namespace clang {
328328
void ReadFunctionDefinition(FunctionDecl *FD);
329329
void Visit(Decl *D);
330330

331-
void UpdateDecl(Decl *D, llvm::SmallVectorImpl<LazySpecializationInfo>&);
331+
void UpdateDecl(Decl *D, llvm::SmallVectorImpl<LazySpecializationInfo> &);
332332

333333
static void setNextObjCCategory(ObjCCategoryDecl *Cat,
334334
ObjCCategoryDecl *Next) {
@@ -4199,8 +4199,8 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) {
41994199
ProcessingUpdatesRAIIObj ProcessingUpdates(*this);
42004200
DeclUpdateOffsetsMap::iterator UpdI = DeclUpdateOffsets.find(ID);
42014201

4202-
using LazySpecializationInfo
4203-
= RedeclarableTemplateDecl::LazySpecializationInfo;
4202+
using LazySpecializationInfo =
4203+
RedeclarableTemplateDecl::LazySpecializationInfo;
42044204
llvm::SmallVector<LazySpecializationInfo, 8> PendingLazySpecializationIDs;
42054205

42064206
if (UpdI != DeclUpdateOffsets.end()) {
@@ -4470,8 +4470,9 @@ static void forAllLaterRedecls(DeclT *D, Fn F) {
44704470
}
44714471
}
44724472

4473-
void ASTDeclReader::UpdateDecl(Decl *D,
4474-
SmallVectorImpl<LazySpecializationInfo> &PendingLazySpecializationIDs) {
4473+
void ASTDeclReader::UpdateDecl(
4474+
Decl *D,
4475+
SmallVectorImpl<LazySpecializationInfo> &PendingLazySpecializationIDs) {
44754476
while (Record.getIdx() < Record.size()) {
44764477
switch ((DeclUpdateKind)Record.readInt()) {
44774478
case UPD_CXX_ADDED_IMPLICIT_MEMBER: {

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5346,9 +5346,9 @@ void ASTWriter::WriteDeclUpdatesBlocks(RecordDataImpl &OffsetsRecord) {
53465346
Args = FD->getTemplateSpecializationArgs()->asArray();
53475347
assert(Args.size());
53485348
Record.push_back(TemplateArgumentList::ComputeODRHash(Args));
5349-
bool IsPartialSpecialization
5350-
= isa<ClassTemplatePartialSpecializationDecl>(Spec) ||
5351-
isa<VarTemplatePartialSpecializationDecl>(Spec);
5349+
bool IsPartialSpecialization =
5350+
isa<ClassTemplatePartialSpecializationDecl>(Spec) ||
5351+
isa<VarTemplatePartialSpecializationDecl>(Spec);
53525352
Record.push_back(IsPartialSpecialization);
53535353
break;
53545354
}

clang/lib/Serialization/ASTWriterDecl.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ namespace clang {
177177

178178
/// Collect the first declaration from each module file that provides a
179179
/// declaration of D.
180-
void CollectFirstDeclFromEachModule(const Decl *D, bool IncludeLocal,
181-
llvm::MapVector<ModuleFile*, const Decl*> &Firsts) {
180+
void CollectFirstDeclFromEachModule(
181+
const Decl *D, bool IncludeLocal,
182+
llvm::MapVector<ModuleFile *, const Decl *> &Firsts) {
182183

183184
// FIXME: We can skip entries that we know are implied by others.
184185
for (const Decl *R = D->getMostRecentDecl(); R; R = R->getPreviousDecl()) {
@@ -193,7 +194,7 @@ namespace clang {
193194
/// provides a declaration of D. The intent is to provide a sufficient
194195
/// set such that reloading this set will load all current redeclarations.
195196
void AddFirstDeclFromEachModule(const Decl *D, bool IncludeLocal) {
196-
llvm::MapVector<ModuleFile*, const Decl*> Firsts;
197+
llvm::MapVector<ModuleFile *, const Decl *> Firsts;
197198
CollectFirstDeclFromEachModule(D, IncludeLocal, Firsts);
198199

199200
for (const auto &F : Firsts)
@@ -207,9 +208,9 @@ namespace clang {
207208
void AddFirstSpecializationDeclFromEachModule(const Decl *D,
208209
bool IncludeLocal) {
209210
assert(isa<ClassTemplateSpecializationDecl>(D) ||
210-
isa<VarTemplateSpecializationDecl>(D) || isa<FunctionDecl>(D) &&
211-
"Must not be called with other decls");
212-
llvm::MapVector<ModuleFile*, const Decl*> Firsts;
211+
isa<VarTemplateSpecializationDecl>(D) ||
212+
isa<FunctionDecl>(D) && "Must not be called with other decls");
213+
llvm::MapVector<ModuleFile *, const Decl *> Firsts;
213214
CollectFirstDeclFromEachModule(D, IncludeLocal, Firsts);
214215

215216
for (const auto &F : Firsts) {
@@ -223,9 +224,9 @@ namespace clang {
223224
Args = FD->getTemplateSpecializationArgs()->asArray();
224225
assert(Args.size());
225226
Record.push_back(TemplateArgumentList::ComputeODRHash(Args));
226-
bool IsPartialSpecialization
227-
= isa<ClassTemplatePartialSpecializationDecl>(D) ||
228-
isa<VarTemplatePartialSpecializationDecl>(D);
227+
bool IsPartialSpecialization =
228+
isa<ClassTemplatePartialSpecializationDecl>(D) ||
229+
isa<VarTemplatePartialSpecializationDecl>(D);
229230
Record.push_back(IsPartialSpecialization);
230231
}
231232
}
@@ -260,8 +261,8 @@ namespace clang {
260261
assert(!Common->LazySpecializations);
261262
}
262263

263-
using LazySpecializationInfo
264-
= RedeclarableTemplateDecl::LazySpecializationInfo;
264+
using LazySpecializationInfo =
265+
RedeclarableTemplateDecl::LazySpecializationInfo;
265266
ArrayRef<LazySpecializationInfo> LazySpecializations;
266267
if (auto *LS = Common->LazySpecializations)
267268
LazySpecializations = llvm::ArrayRef(LS + 1, LS[0].DeclID);
@@ -280,7 +281,7 @@ namespace clang {
280281

281282
for (auto *D : Specs) {
282283
assert(D->isCanonicalDecl() && "non-canonical decl in set");
283-
AddFirstSpecializationDeclFromEachModule(D, /*IncludeLocal*/true);
284+
AddFirstSpecializationDeclFromEachModule(D, /*IncludeLocal*/ true);
284285
}
285286
for (auto &SpecInfo : LazySpecializations) {
286287
Record.push_back(SpecInfo.DeclID);
@@ -291,8 +292,8 @@ namespace clang {
291292
// Update the size entry we added earlier. We linerized the
292293
// LazySpecializationInfo members and we need to adjust the size as we
293294
// will read them always together.
294-
assert ((Record.size() - I - 1) % 3 == 0
295-
&& "Must be divisible by LazySpecializationInfo count!");
295+
assert((Record.size() - I - 1) % 3 == 0 &&
296+
"Must be divisible by LazySpecializationInfo count!");
296297
Record[I] = (Record.size() - I - 1) / 3;
297298
}
298299

0 commit comments

Comments
 (0)