Skip to content

Commit 370e4ca

Browse files
committed
clang-format
1 parent 87a9245 commit 370e4ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+184
-243
lines changed

clang/include/clang/AST/ExprCXX.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4306,11 +4306,11 @@ class SizeOfPackExpr final
43064306
: Expr(SizeOfPackExprClass, Empty), Length(NumPartialArgs) {}
43074307

43084308
public:
4309-
static SizeOfPackExpr *
4310-
Create(ASTContext &Context, SourceLocation OperatorLoc, NamedDecl *Pack,
4311-
SourceLocation PackLoc, SourceLocation RParenLoc,
4312-
std::optional<unsigned> Length = std::nullopt,
4313-
ArrayRef<TemplateArgument> PartialArgs = {});
4309+
static SizeOfPackExpr *Create(ASTContext &Context, SourceLocation OperatorLoc,
4310+
NamedDecl *Pack, SourceLocation PackLoc,
4311+
SourceLocation RParenLoc,
4312+
std::optional<unsigned> Length = std::nullopt,
4313+
ArrayRef<TemplateArgument> PartialArgs = {});
43144314
static SizeOfPackExpr *CreateDeserialized(ASTContext &Context,
43154315
unsigned NumPartialArgs);
43164316

clang/include/clang/Basic/TargetInfo.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,11 +1852,9 @@ class TargetInfo : public TransferrableTargetInfo,
18521852
}
18531853
virtual ArrayRef<const char *> getGCCRegNames() const = 0;
18541854
virtual ArrayRef<GCCRegAlias> getGCCRegAliases() const = 0;
1855-
virtual ArrayRef<AddlRegName> getGCCAddlRegNames() const {
1856-
return {};
1857-
}
1855+
virtual ArrayRef<AddlRegName> getGCCAddlRegNames() const { return {}; }
18581856

1859-
private:
1857+
private:
18601858
// Assert the values for the fractional and integral bits for each fixed point
18611859
// type follow the restrictions given in clause 6.2.6.3 of N1169.
18621860
void CheckFixedPointBits() const;

clang/include/clang/Driver/Job.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ class Command {
172172
Command(const Action &Source, const Tool &Creator,
173173
ResponseFileSupport ResponseSupport, const char *Executable,
174174
const llvm::opt::ArgStringList &Arguments, ArrayRef<InputInfo> Inputs,
175-
ArrayRef<InputInfo> Outputs = {},
176-
const char *PrependArg = nullptr);
175+
ArrayRef<InputInfo> Outputs = {}, const char *PrependArg = nullptr);
177176
// FIXME: This really shouldn't be copyable, but is currently copied in some
178177
// error handling in Driver::generateCompilationDiagnostics.
179178
Command(const Command &) = default;
@@ -245,8 +244,7 @@ class CC1Command : public Command {
245244
CC1Command(const Action &Source, const Tool &Creator,
246245
ResponseFileSupport ResponseSupport, const char *Executable,
247246
const llvm::opt::ArgStringList &Arguments,
248-
ArrayRef<InputInfo> Inputs,
249-
ArrayRef<InputInfo> Outputs = {},
247+
ArrayRef<InputInfo> Inputs, ArrayRef<InputInfo> Outputs = {},
250248
const char *PrependArg = nullptr);
251249

252250
void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote,

clang/include/clang/Sema/CodeCompleteConsumer.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,8 @@ class CodeCompletionContext {
378378
: CCKind(CCKind), IsUsingDeclaration(false), SelIdents() {}
379379

380380
/// Construct a new code-completion context of the given kind.
381-
CodeCompletionContext(
382-
Kind CCKind, QualType T,
383-
ArrayRef<const IdentifierInfo *> SelIdents = {})
381+
CodeCompletionContext(Kind CCKind, QualType T,
382+
ArrayRef<const IdentifierInfo *> SelIdents = {})
384383
: CCKind(CCKind), IsUsingDeclaration(false), SelIdents(SelIdents) {
385384
if (CCKind == CCC_DotMemberAccess || CCKind == CCC_ArrowMemberAccess ||
386385
CCKind == CCC_ObjCPropertyAccess || CCKind == CCC_ObjCClassMessage ||

clang/include/clang/Sema/Overload.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,9 +1206,8 @@ class Sema;
12061206

12071207
/// Add a new candidate with NumConversions conversion sequence slots
12081208
/// to the overload set.
1209-
OverloadCandidate &
1210-
addCandidate(unsigned NumConversions = 0,
1211-
ConversionSequenceList Conversions = {}) {
1209+
OverloadCandidate &addCandidate(unsigned NumConversions = 0,
1210+
ConversionSequenceList Conversions = {}) {
12121211
assert((Conversions.empty() || Conversions.size() == NumConversions) &&
12131212
"preallocated conversion sequence has wrong length");
12141213

clang/include/clang/Sema/Sema.h

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3546,10 +3546,12 @@ class Sema final : public SemaBase {
35463546
/// a C++0x [dcl.typedef]p2 alias-declaration: 'using T = A;'.
35473547
NamedDecl *ActOnTypedefNameDecl(Scope *S, DeclContext *DC, TypedefNameDecl *D,
35483548
LookupResult &Previous, bool &Redeclaration);
3549-
NamedDecl *ActOnVariableDeclarator(
3550-
Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo,
3551-
LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists,
3552-
bool &AddToScope, ArrayRef<BindingDecl *> Bindings = {});
3549+
NamedDecl *ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
3550+
TypeSourceInfo *TInfo,
3551+
LookupResult &Previous,
3552+
MultiTemplateParamsArg TemplateParamLists,
3553+
bool &AddToScope,
3554+
ArrayRef<BindingDecl *> Bindings = {});
35533555

35543556
/// Perform semantic checking on a newly-created variable
35553557
/// declaration.
@@ -5391,9 +5393,8 @@ class Sema final : public SemaBase {
53915393
bool SetDelegatingInitializer(CXXConstructorDecl *Constructor,
53925394
CXXCtorInitializer *Initializer);
53935395

5394-
bool SetCtorInitializers(
5395-
CXXConstructorDecl *Constructor, bool AnyErrors,
5396-
ArrayRef<CXXCtorInitializer *> Initializers = {});
5396+
bool SetCtorInitializers(CXXConstructorDecl *Constructor, bool AnyErrors,
5397+
ArrayRef<CXXCtorInitializer *> Initializers = {});
53975398

53985399
/// MarkBaseAndMemberDestructorsReferenced - Given a record decl,
53995400
/// mark all the non-trivial destructors of its members and bases as
@@ -6689,9 +6690,9 @@ class Sema final : public SemaBase {
66896690
/// \param SkipLocalVariables If true, don't mark local variables as
66906691
/// 'referenced'.
66916692
/// \param StopAt Subexpressions that we shouldn't recurse into.
6692-
void MarkDeclarationsReferencedInExpr(
6693-
Expr *E, bool SkipLocalVariables = false,
6694-
ArrayRef<const Expr *> StopAt = {});
6693+
void MarkDeclarationsReferencedInExpr(Expr *E,
6694+
bool SkipLocalVariables = false,
6695+
ArrayRef<const Expr *> StopAt = {});
66956696

66966697
/// Try to convert an expression \p E to type \p Ty. Returns the result of the
66976698
/// conversion.
@@ -10189,15 +10190,17 @@ class Sema final : public SemaBase {
1018910190
/// \param PartialOverloading true if we are performing "partial" overloading
1019010191
/// based on an incomplete set of function arguments. This feature is used by
1019110192
/// code completion.
10192-
void AddOverloadCandidate(
10193-
FunctionDecl *Function, DeclAccessPair FoundDecl, ArrayRef<Expr *> Args,
10194-
OverloadCandidateSet &CandidateSet, bool SuppressUserConversions = false,
10195-
bool PartialOverloading = false, bool AllowExplicit = true,
10196-
bool AllowExplicitConversion = false,
10197-
ADLCallKind IsADLCandidate = ADLCallKind::NotADL,
10198-
ConversionSequenceList EarlyConversions = {},
10199-
OverloadCandidateParamOrder PO = {},
10200-
bool AggregateCandidateDeduction = false);
10193+
void AddOverloadCandidate(FunctionDecl *Function, DeclAccessPair FoundDecl,
10194+
ArrayRef<Expr *> Args,
10195+
OverloadCandidateSet &CandidateSet,
10196+
bool SuppressUserConversions = false,
10197+
bool PartialOverloading = false,
10198+
bool AllowExplicit = true,
10199+
bool AllowExplicitConversion = false,
10200+
ADLCallKind IsADLCandidate = ADLCallKind::NotADL,
10201+
ConversionSequenceList EarlyConversions = {},
10202+
OverloadCandidateParamOrder PO = {},
10203+
bool AggregateCandidateDeduction = false);
1020110204

1020210205
/// Add all of the function declarations in the given function set to
1020310206
/// the overload candidate set.
@@ -10224,15 +10227,15 @@ class Sema final : public SemaBase {
1022410227
/// both @c a1 and @c a2. If @p SuppressUserConversions, then don't
1022510228
/// allow user-defined conversions via constructors or conversion
1022610229
/// operators.
10227-
void
10228-
AddMethodCandidate(CXXMethodDecl *Method, DeclAccessPair FoundDecl,
10229-
CXXRecordDecl *ActingContext, QualType ObjectType,
10230-
Expr::Classification ObjectClassification,
10231-
ArrayRef<Expr *> Args, OverloadCandidateSet &CandidateSet,
10232-
bool SuppressUserConversions = false,
10233-
bool PartialOverloading = false,
10234-
ConversionSequenceList EarlyConversions = {},
10235-
OverloadCandidateParamOrder PO = {});
10230+
void AddMethodCandidate(CXXMethodDecl *Method, DeclAccessPair FoundDecl,
10231+
CXXRecordDecl *ActingContext, QualType ObjectType,
10232+
Expr::Classification ObjectClassification,
10233+
ArrayRef<Expr *> Args,
10234+
OverloadCandidateSet &CandidateSet,
10235+
bool SuppressUserConversions = false,
10236+
bool PartialOverloading = false,
10237+
ConversionSequenceList EarlyConversions = {},
10238+
OverloadCandidateParamOrder PO = {});
1023610239

1023710240
/// Add a C++ member function template as a candidate to the candidate
1023810241
/// set, using template argument deduction to produce an appropriate member
@@ -13031,12 +13034,13 @@ class Sema final : public SemaBase {
1303113034
bool CheckInstantiationDepth(SourceLocation PointOfInstantiation,
1303213035
SourceRange InstantiationRange);
1303313036

13034-
InstantiatingTemplate(
13035-
Sema &SemaRef, CodeSynthesisContext::SynthesisKind Kind,
13036-
SourceLocation PointOfInstantiation, SourceRange InstantiationRange,
13037-
Decl *Entity, NamedDecl *Template = nullptr,
13038-
ArrayRef<TemplateArgument> TemplateArgs = {},
13039-
sema::TemplateDeductionInfo *DeductionInfo = nullptr);
13037+
InstantiatingTemplate(Sema &SemaRef,
13038+
CodeSynthesisContext::SynthesisKind Kind,
13039+
SourceLocation PointOfInstantiation,
13040+
SourceRange InstantiationRange, Decl *Entity,
13041+
NamedDecl *Template = nullptr,
13042+
ArrayRef<TemplateArgument> TemplateArgs = {},
13043+
sema::TemplateDeductionInfo *DeductionInfo = nullptr);
1304013044

1304113045
InstantiatingTemplate(const InstantiatingTemplate &) = delete;
1304213046

clang/lib/AST/Decl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5494,9 +5494,8 @@ IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
54945494

54955495
IndirectFieldDecl *IndirectFieldDecl::CreateDeserialized(ASTContext &C,
54965496
GlobalDeclID ID) {
5497-
return new (C, ID)
5498-
IndirectFieldDecl(C, nullptr, SourceLocation(), DeclarationName(),
5499-
QualType(), {});
5497+
return new (C, ID) IndirectFieldDecl(C, nullptr, SourceLocation(),
5498+
DeclarationName(), QualType(), {});
55005499
}
55015500

55025501
SourceRange EnumConstantDecl::getSourceRange() const {

clang/lib/AST/DeclCXX.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,8 +3254,7 @@ UsingPackDecl *UsingPackDecl::Create(ASTContext &C, DeclContext *DC,
32543254
UsingPackDecl *UsingPackDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID,
32553255
unsigned NumExpansions) {
32563256
size_t Extra = additionalSizeToAlloc<NamedDecl *>(NumExpansions);
3257-
auto *Result =
3258-
new (C, ID, Extra) UsingPackDecl(nullptr, nullptr, {});
3257+
auto *Result = new (C, ID, Extra) UsingPackDecl(nullptr, nullptr, {});
32593258
Result->NumExpansions = NumExpansions;
32603259
auto *Trail = Result->getTrailingObjects<NamedDecl *>();
32613260
for (unsigned I = 0; I != NumExpansions; ++I)

clang/lib/AST/DeclTemplate.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,7 @@ NonTypeTemplateParmDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID,
796796
additionalSizeToAlloc<std::pair<QualType, TypeSourceInfo *>, Expr *>(
797797
NumExpandedTypes, HasTypeConstraint ? 1 : 0))
798798
NonTypeTemplateParmDecl(nullptr, SourceLocation(), SourceLocation(),
799-
0, 0, nullptr, QualType(), nullptr,
800-
{}, {});
799+
0, 0, nullptr, QualType(), nullptr, {}, {});
801800
NTTP->NumExpandedTypes = NumExpandedTypes;
802801
return NTTP;
803802
}

clang/lib/AST/Expr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4719,8 +4719,7 @@ DesignatedInitUpdateExpr::DesignatedInitUpdateExpr(const ASTContext &C,
47194719
OK_Ordinary) {
47204720
BaseAndUpdaterExprs[0] = baseExpr;
47214721

4722-
InitListExpr *ILE =
4723-
new (C) InitListExpr(C, lBraceLoc, {}, rBraceLoc);
4722+
InitListExpr *ILE = new (C) InitListExpr(C, lBraceLoc, {}, rBraceLoc);
47244723
ILE->setType(baseExpr->getType());
47254724
BaseAndUpdaterExprs[1] = ILE;
47264725

0 commit comments

Comments
 (0)