Skip to content

Commit 672fde1

Browse files
committed
fmt
1 parent 0d257f1 commit 672fde1

File tree

5 files changed

+43
-43
lines changed

5 files changed

+43
-43
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(GlobalDeclID 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: 12 additions & 14 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();
@@ -344,16 +344,16 @@ void RedeclarableTemplateDecl::loadLazySpecializationsImpl(
344344
unsigned N = Specs[0].DeclID.get();
345345
for (unsigned I = 0; I != N; ++I) {
346346
// Skip over already loaded specializations.
347-
if (!Specs[I+1].ODRHash)
347+
if (!Specs[I + 1].ODRHash)
348348
continue;
349-
if (!OnlyPartial || Specs[I+1].IsPartial)
350-
(void)loadLazySpecializationImpl(Specs[I+1]);
349+
if (!OnlyPartial || Specs[I + 1].IsPartial)
350+
(void)loadLazySpecializationImpl(Specs[I + 1]);
351351
}
352352
}
353353
}
354354

355355
Decl *RedeclarableTemplateDecl::loadLazySpecializationImpl(
356-
LazySpecializationInfo &LazySpecInfo) const {
356+
LazySpecializationInfo &LazySpecInfo) const {
357357
GlobalDeclID ID = LazySpecInfo.DeclID;
358358
assert(ID.isValid() && "Loading already loaded specialization!");
359359
// Note that we loaded the specialization.
@@ -362,15 +362,13 @@ Decl *RedeclarableTemplateDecl::loadLazySpecializationImpl(
362362
return getASTContext().getExternalSource()->GetExternalDecl(ID);
363363
}
364364

365-
void
366-
RedeclarableTemplateDecl::loadLazySpecializationsImpl(ArrayRef<TemplateArgument>
367-
Args,
368-
TemplateParameterList *TPL) const {
365+
void RedeclarableTemplateDecl::loadLazySpecializationsImpl(
366+
ArrayRef<TemplateArgument> Args, TemplateParameterList *TPL) const {
369367
CommonBase *CommonBasePtr = getMostRecentDecl()->getCommonPtr();
370368
if (auto *Specs = CommonBasePtr->LazySpecializations) {
371369
unsigned Hash = TemplateArgumentList::ComputeODRHash(Args);
372370
unsigned N = Specs[0].DeclID.get();
373-
for (uint32_t I = 0; I != N; ++I)
371+
for (unsigned I = 0; I != N; ++I)
374372
if (Specs[I+1].ODRHash && Specs[I+1].ODRHash == Hash)
375373
(void)loadLazySpecializationImpl(Specs[I+1]);
376374
}
@@ -549,7 +547,7 @@ ClassTemplateDecl *ClassTemplateDecl::CreateDeserialized(ASTContext &C,
549547
}
550548

551549
void ClassTemplateDecl::LoadLazySpecializations(
552-
bool OnlyPartial/*=false*/) const {
550+
bool OnlyPartial /*=false*/) const {
553551
loadLazySpecializationsImpl(OnlyPartial);
554552
}
555553

@@ -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;
@@ -270,9 +270,9 @@ namespace clang {
270270
: Reader(Reader), Record(Record), Loc(Loc), ThisDeclID(thisDeclID),
271271
ThisDeclLoc(ThisDeclLoc) {}
272272

273-
template <typename T> static
274-
void AddLazySpecializations(T *D,
275-
SmallVectorImpl<LazySpecializationInfo>& IDs) {
273+
template <typename T>
274+
static void
275+
AddLazySpecializations(T *D, SmallVectorImpl<LazySpecializationInfo> &IDs) {
276276
if (IDs.empty())
277277
return;
278278

@@ -321,7 +321,7 @@ namespace clang {
321321
void ReadFunctionDefinition(FunctionDecl *FD);
322322
void Visit(Decl *D);
323323

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

326326
static void setNextObjCCategory(ObjCCategoryDecl *Cat,
327327
ObjCCategoryDecl *Next) {
@@ -4213,8 +4213,8 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) {
42134213
ProcessingUpdatesRAIIObj ProcessingUpdates(*this);
42144214
DeclUpdateOffsetsMap::iterator UpdI = DeclUpdateOffsets.find(ID);
42154215

4216-
using LazySpecializationInfo
4217-
= RedeclarableTemplateDecl::LazySpecializationInfo;
4216+
using LazySpecializationInfo =
4217+
RedeclarableTemplateDecl::LazySpecializationInfo;
42184218
llvm::SmallVector<LazySpecializationInfo, 8> PendingLazySpecializationIDs;
42194219

42204220
if (UpdI != DeclUpdateOffsets.end()) {
@@ -4480,8 +4480,9 @@ static void forAllLaterRedecls(DeclT *D, Fn F) {
44804480
}
44814481
}
44824482

4483-
void ASTDeclReader::UpdateDecl(Decl *D,
4484-
SmallVectorImpl<LazySpecializationInfo> &PendingLazySpecializationIDs) {
4483+
void ASTDeclReader::UpdateDecl(
4484+
Decl *D,
4485+
SmallVectorImpl<LazySpecializationInfo> &PendingLazySpecializationIDs) {
44854486
while (Record.getIdx() < Record.size()) {
44864487
switch ((DeclUpdateKind)Record.readInt()) {
44874488
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
@@ -5585,9 +5585,9 @@ void ASTWriter::WriteDeclUpdatesBlocks(RecordDataImpl &OffsetsRecord) {
55855585
Args = FD->getTemplateSpecializationArgs()->asArray();
55865586
assert(Args.size());
55875587
Record.push_back(TemplateArgumentList::ComputeODRHash(Args));
5588-
bool IsPartialSpecialization
5589-
= isa<ClassTemplatePartialSpecializationDecl>(Spec) ||
5590-
isa<VarTemplatePartialSpecializationDecl>(Spec);
5588+
bool IsPartialSpecialization =
5589+
isa<ClassTemplatePartialSpecializationDecl>(Spec) ||
5590+
isa<VarTemplatePartialSpecializationDecl>(Spec);
55915591
Record.push_back(IsPartialSpecialization);
55925592
break;
55935593
}

clang/lib/Serialization/ASTWriterDecl.cpp

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

181181
/// Collect the first declaration from each module file that provides a
182182
/// declaration of D.
183-
void CollectFirstDeclFromEachModule(const Decl *D, bool IncludeLocal,
184-
llvm::MapVector<ModuleFile*, const Decl*> &Firsts) {
183+
void CollectFirstDeclFromEachModule(
184+
const Decl *D, bool IncludeLocal,
185+
llvm::MapVector<ModuleFile *, const Decl *> &Firsts) {
185186

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

202203
for (const auto &F : Firsts)
@@ -210,9 +211,9 @@ namespace clang {
210211
void AddFirstSpecializationDeclFromEachModule(const Decl *D,
211212
bool IncludeLocal) {
212213
assert(isa<ClassTemplateSpecializationDecl>(D) ||
213-
isa<VarTemplateSpecializationDecl>(D) || isa<FunctionDecl>(D) &&
214-
"Must not be called with other decls");
215-
llvm::MapVector<ModuleFile*, const Decl*> Firsts;
214+
isa<VarTemplateSpecializationDecl>(D) ||
215+
isa<FunctionDecl>(D) && "Must not be called with other decls");
216+
llvm::MapVector<ModuleFile *, const Decl *> Firsts;
216217
CollectFirstDeclFromEachModule(D, IncludeLocal, Firsts);
217218

218219
for (const auto &F : Firsts) {
@@ -226,9 +227,9 @@ namespace clang {
226227
Args = FD->getTemplateSpecializationArgs()->asArray();
227228
assert(Args.size());
228229
Record.push_back(TemplateArgumentList::ComputeODRHash(Args));
229-
bool IsPartialSpecialization
230-
= isa<ClassTemplatePartialSpecializationDecl>(D) ||
231-
isa<VarTemplatePartialSpecializationDecl>(D);
230+
bool IsPartialSpecialization =
231+
isa<ClassTemplatePartialSpecializationDecl>(D) ||
232+
isa<VarTemplatePartialSpecializationDecl>(D);
232233
Record.push_back(IsPartialSpecialization);
233234
}
234235
}
@@ -263,8 +264,8 @@ namespace clang {
263264
assert(!Common->LazySpecializations);
264265
}
265266

266-
using LazySpecializationInfo
267-
= RedeclarableTemplateDecl::LazySpecializationInfo;
267+
using LazySpecializationInfo =
268+
RedeclarableTemplateDecl::LazySpecializationInfo;
268269
ArrayRef<LazySpecializationInfo> LazySpecializations;
269270
if (auto *LS = Common->LazySpecializations)
270271
LazySpecializations = llvm::ArrayRef(LS + 1, LS[0].DeclID.get());
@@ -283,7 +284,7 @@ namespace clang {
283284

284285
for (auto *D : Specs) {
285286
assert(D->isCanonicalDecl() && "non-canonical decl in set");
286-
AddFirstSpecializationDeclFromEachModule(D, /*IncludeLocal*/true);
287+
AddFirstSpecializationDeclFromEachModule(D, /*IncludeLocal*/ true);
287288
}
288289
for (auto &SpecInfo : LazySpecializations) {
289290
Record.push_back(SpecInfo.DeclID.get());
@@ -294,8 +295,8 @@ namespace clang {
294295
// Update the size entry we added earlier. We linerized the
295296
// LazySpecializationInfo members and we need to adjust the size as we
296297
// will read them always together.
297-
assert ((Record.size() - I - 1) % 3 == 0
298-
&& "Must be divisible by LazySpecializationInfo count!");
298+
assert((Record.size() - I - 1) % 3 == 0 &&
299+
"Must be divisible by LazySpecializationInfo count!");
299300
Record[I] = (Record.size() - I - 1) / 3;
300301
}
301302

0 commit comments

Comments
 (0)