Skip to content

Commit f44d7f8

Browse files
committed
fmt
1 parent 718f1ed commit f44d7f8

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) {
@@ -4203,8 +4203,8 @@ void ASTReader::loadDeclUpdateRecords(PendingUpdateRecord &Record) {
42034203
ProcessingUpdatesRAIIObj ProcessingUpdates(*this);
42044204
DeclUpdateOffsetsMap::iterator UpdI = DeclUpdateOffsets.find(ID);
42054205

4206-
using LazySpecializationInfo
4207-
= RedeclarableTemplateDecl::LazySpecializationInfo;
4206+
using LazySpecializationInfo =
4207+
RedeclarableTemplateDecl::LazySpecializationInfo;
42084208
llvm::SmallVector<LazySpecializationInfo, 8> PendingLazySpecializationIDs;
42094209

42104210
if (UpdI != DeclUpdateOffsets.end()) {
@@ -4474,8 +4474,9 @@ static void forAllLaterRedecls(DeclT *D, Fn F) {
44744474
}
44754475
}
44764476

4477-
void ASTDeclReader::UpdateDecl(Decl *D,
4478-
SmallVectorImpl<LazySpecializationInfo> &PendingLazySpecializationIDs) {
4477+
void ASTDeclReader::UpdateDecl(
4478+
Decl *D,
4479+
SmallVectorImpl<LazySpecializationInfo> &PendingLazySpecializationIDs) {
44794480
while (Record.getIdx() < Record.size()) {
44804481
switch ((DeclUpdateKind)Record.readInt()) {
44814482
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
@@ -5370,9 +5370,9 @@ void ASTWriter::WriteDeclUpdatesBlocks(RecordDataImpl &OffsetsRecord) {
53705370
Args = FD->getTemplateSpecializationArgs()->asArray();
53715371
assert(Args.size());
53725372
Record.push_back(TemplateArgumentList::ComputeODRHash(Args));
5373-
bool IsPartialSpecialization
5374-
= isa<ClassTemplatePartialSpecializationDecl>(Spec) ||
5375-
isa<VarTemplatePartialSpecializationDecl>(Spec);
5373+
bool IsPartialSpecialization =
5374+
isa<ClassTemplatePartialSpecializationDecl>(Spec) ||
5375+
isa<VarTemplatePartialSpecializationDecl>(Spec);
53765376
Record.push_back(IsPartialSpecialization);
53775377
break;
53785378
}

clang/lib/Serialization/ASTWriterDecl.cpp

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

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

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

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

219220
for (const auto &F : Firsts) {
@@ -227,9 +228,9 @@ namespace clang {
227228
Args = FD->getTemplateSpecializationArgs()->asArray();
228229
assert(Args.size());
229230
Record.push_back(TemplateArgumentList::ComputeODRHash(Args));
230-
bool IsPartialSpecialization
231-
= isa<ClassTemplatePartialSpecializationDecl>(D) ||
232-
isa<VarTemplatePartialSpecializationDecl>(D);
231+
bool IsPartialSpecialization =
232+
isa<ClassTemplatePartialSpecializationDecl>(D) ||
233+
isa<VarTemplatePartialSpecializationDecl>(D);
233234
Record.push_back(IsPartialSpecialization);
234235
}
235236
}
@@ -264,8 +265,8 @@ namespace clang {
264265
assert(!Common->LazySpecializations);
265266
}
266267

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

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

0 commit comments

Comments
 (0)