Skip to content

Commit a06599e

Browse files
committed
fmt
1 parent 270cdac commit a06599e

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
@@ -738,8 +738,8 @@ class RedeclarableTemplateDecl : public TemplateDecl,
738738
bool IsPartial = false;
739739
LazySpecializationInfo(GlobalDeclID ID, unsigned Hash = ~0U,
740740
bool Partial = false)
741-
: DeclID(ID), ODRHash(Hash), IsPartial(Partial) { }
742-
LazySpecializationInfo() { }
741+
: DeclID(ID), ODRHash(Hash), IsPartial(Partial) {}
742+
LazySpecializationInfo() {}
743743
bool operator<(const LazySpecializationInfo &Other) const {
744744
return DeclID < Other.DeclID;
745745
}

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.getRawValue();
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.getRawValue();
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

@@ -1314,7 +1312,7 @@ VarTemplateDecl *VarTemplateDecl::CreateDeserialized(ASTContext &C,
13141312
}
13151313

13161314
void VarTemplateDecl::LoadLazySpecializations(
1317-
bool OnlyPartial/*=false*/) const {
1315+
bool OnlyPartial /*=false*/) const {
13181316
loadLazySpecializationsImpl(OnlyPartial);
13191317
}
13201318

clang/lib/Serialization/ASTReaderDecl.cpp

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

9191
using RecordData = ASTReader::RecordData;
92-
using LazySpecializationInfo
93-
= RedeclarableTemplateDecl::LazySpecializationInfo;
92+
using LazySpecializationInfo =
93+
RedeclarableTemplateDecl::LazySpecializationInfo;
9494

9595
TypeID DeferredTypeID = 0;
9696
unsigned AnonymousDeclNumber = 0;
@@ -271,9 +271,9 @@ namespace clang {
271271
: Reader(Reader), Record(Record), Loc(Loc), ThisDeclID(thisDeclID),
272272
ThisDeclLoc(ThisDeclLoc) {}
273273

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

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

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

327327
static void setNextObjCCategory(ObjCCategoryDecl *Cat,
328328
ObjCCategoryDecl *Next) {
@@ -4260,8 +4260,8 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) {
42604260
ProcessingUpdatesRAIIObj ProcessingUpdates(*this);
42614261
DeclUpdateOffsetsMap::iterator UpdI = DeclUpdateOffsets.find(ID);
42624262

4263-
using LazySpecializationInfo
4264-
= RedeclarableTemplateDecl::LazySpecializationInfo;
4263+
using LazySpecializationInfo =
4264+
RedeclarableTemplateDecl::LazySpecializationInfo;
42654265
llvm::SmallVector<LazySpecializationInfo, 8> PendingLazySpecializationIDs;
42664266

42674267
if (UpdI != DeclUpdateOffsets.end()) {
@@ -4527,8 +4527,9 @@ static void forAllLaterRedecls(DeclT *D, Fn F) {
45274527
}
45284528
}
45294529

4530-
void ASTDeclReader::UpdateDecl(Decl *D,
4531-
SmallVectorImpl<LazySpecializationInfo> &PendingLazySpecializationIDs) {
4530+
void ASTDeclReader::UpdateDecl(
4531+
Decl *D,
4532+
SmallVectorImpl<LazySpecializationInfo> &PendingLazySpecializationIDs) {
45324533
while (Record.getIdx() < Record.size()) {
45334534
switch ((DeclUpdateKind)Record.readInt()) {
45344535
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
@@ -5778,9 +5778,9 @@ void ASTWriter::WriteDeclUpdatesBlocks(RecordDataImpl &OffsetsRecord) {
57785778
Args = FD->getTemplateSpecializationArgs()->asArray();
57795779
assert(Args.size());
57805780
Record.push_back(TemplateArgumentList::ComputeODRHash(Args));
5781-
bool IsPartialSpecialization
5782-
= isa<ClassTemplatePartialSpecializationDecl>(Spec) ||
5783-
isa<VarTemplatePartialSpecializationDecl>(Spec);
5781+
bool IsPartialSpecialization =
5782+
isa<ClassTemplatePartialSpecializationDecl>(Spec) ||
5783+
isa<VarTemplatePartialSpecializationDecl>(Spec);
57845784
Record.push_back(IsPartialSpecialization);
57855785
break;
57865786
}

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.getRawValue());
@@ -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.getRawValue());
@@ -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)