Skip to content

Commit 81e9eaf

Browse files
committed
Format after all the renames
Mostly just to fix up the `<optional>` include location.
1 parent 8b67bfe commit 81e9eaf

File tree

324 files changed

+1923
-2021
lines changed

Some content is hidden

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

324 files changed

+1923
-2021
lines changed

include/swift/AST/ASTDemangler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#include "swift/Demangling/NamespaceMacros.h"
2828
#include "swift/Demangling/TypeDecoder.h"
2929
#include "llvm/ADT/ArrayRef.h"
30-
#include <optional>
3130
#include "llvm/ADT/StringRef.h"
31+
#include <optional>
3232

3333
namespace swift {
3434

include/swift/AST/ASTPrinter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,7 @@ class ASTPrinter {
306306
void callPrintDeclPre(const Decl *D, std::optional<BracketOptions> Bracket);
307307

308308
/// Make a callback to printDeclPost(), performing any necessary bookkeeping.
309-
void callPrintDeclPost(const Decl *D,
310-
std::optional<BracketOptions> Bracket) {
309+
void callPrintDeclPost(const Decl *D, std::optional<BracketOptions> Bracket) {
311310
printDeclPost(D, Bracket);
312311
}
313312

include/swift/AST/ASTScope.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
#include "swift/Basic/LLVM.h"
3838
#include "swift/Basic/NullablePtr.h"
3939
#include "swift/Basic/SourceManager.h"
40-
#include <optional>
4140
#include "llvm/ADT/PointerIntPair.h"
4241
#include "llvm/ADT/STLExtras.h"
4342
#include "llvm/ADT/SmallVector.h"
43+
#include <optional>
4444

4545
/// In case there's a bug in the ASTScope lookup system, suggest that the user
4646
/// try disabling it.

include/swift/AST/ASTWalker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
#define SWIFT_AST_ASTWALKER_H
1515

1616
#include "swift/Basic/LLVM.h"
17-
#include <optional>
1817
#include "llvm/ADT/None.h"
1918
#include "llvm/ADT/PointerUnion.h"
19+
#include <optional>
2020
#include <utility>
2121

2222
namespace swift {

include/swift/AST/AbstractSourceFileDepGraphFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include "swift/AST/Decl.h"
1717
#include "swift/AST/DeclContext.h"
1818
#include "swift/AST/FineGrainedDependencies.h"
19-
#include <optional>
2019
#include "llvm/Support/VirtualOutputBackend.h"
20+
#include <optional>
2121

2222
namespace swift {
2323
class DiagnosticEngine;

include/swift/AST/AccessNotes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#include "swift/AST/Identifier.h"
2222
#include "swift/AST/StorageImpl.h"
2323
#include "swift/Basic/NullablePtr.h"
24-
#include <optional>
2524
#include "llvm/Support/Error.h"
2625
#include "llvm/Support/MemoryBuffer.h"
2726
#include "llvm/Support/raw_ostream.h"
27+
#include <optional>
2828
#include <set>
2929
#include <string>
3030
#include <vector>
@@ -97,8 +97,8 @@ class AccessNotesFile {
9797

9898
/// Load the access notes from \p buffer, or \c None if they cannot be loaded.
9999
/// Diagnoses any parsing issues with the access notes file.
100-
static std::optional<AccessNotesFile>
101-
load(ASTContext &ctx, const llvm::MemoryBuffer *buffer);
100+
static std::optional<AccessNotesFile> load(ASTContext &ctx,
101+
const llvm::MemoryBuffer *buffer);
102102

103103
/// Look up the access note in this file, if any, which applies to \p VD.
104104
NullablePtr<const AccessNote> lookup(ValueDecl *VD) const;

include/swift/AST/AccessScope.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include "swift/AST/DeclContext.h"
1818
#include "swift/Basic/Debug.h"
1919
#include "llvm/ADT/None.h"
20-
#include <optional>
2120
#include "llvm/ADT/PointerIntPair.h"
21+
#include <optional>
2222

2323
namespace swift {
2424

include/swift/AST/AnyFunctionRef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#include "swift/Basic/LLVM.h"
2323
#include "llvm/ADT/DenseMap.h"
2424
#include "llvm/ADT/None.h"
25-
#include <optional>
2625
#include "llvm/ADT/PointerUnion.h"
26+
#include <optional>
2727

2828
namespace swift {
2929
class CaptureInfo;

include/swift/AST/ArgumentList.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#include "swift/AST/ASTAllocated.h"
2121
#include "swift/AST/Types.h"
2222
#include "swift/Basic/Debug.h"
23-
#include <optional>
2423
#include "llvm/ADT/STLExtras.h"
2524
#include "llvm/Support/TrailingObjects.h"
25+
#include <optional>
2626

2727
namespace swift {
2828
/// Forward declared trampoline for Expr::getType.
@@ -221,9 +221,8 @@ class alignas(Argument) ArgumentList final
221221
/// \param arena The arena to allocate the ArgumentList in.
222222
static ArgumentList *
223223
create(ASTContext &ctx, SourceLoc lParenLoc, ArrayRef<Argument> args,
224-
SourceLoc rParenLoc,
225-
std::optional<unsigned> firstTrailingClosureIndex, bool isImplicit,
226-
ArgumentList *originalArgs = nullptr,
224+
SourceLoc rParenLoc, std::optional<unsigned> firstTrailingClosureIndex,
225+
bool isImplicit, ArgumentList *originalArgs = nullptr,
227226
AllocationArena arena = AllocationArena::Permanent);
228227

229228
/// Create a new explicit parsed ArgumentList.
@@ -528,7 +527,7 @@ class alignas(Argument) ArgumentList final
528527
/// will match against semantic sub-expressions, but that may be disabled by
529528
/// passing \c false for \c allowSemantic.
530529
std::optional<unsigned> findArgumentExpr(Expr *expr,
531-
bool allowSemantic = true) const;
530+
bool allowSemantic = true) const;
532531

533532
/// Creates a TupleExpr or ParenExpr that holds the argument exprs. A
534533
/// ParenExpr will be returned for a single argument, otherwise a TupleExpr.

include/swift/AST/Attr.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
#include "swift/Basic/SourceLoc.h"
4040
#include "swift/Basic/UUID.h"
4141
#include "swift/Basic/Version.h"
42-
#include <optional>
4342
#include "llvm/ADT/DenseMapInfo.h"
4443
#include "llvm/ADT/SmallVector.h"
4544
#include "llvm/ADT/StringRef.h"
4645
#include "llvm/ADT/iterator_range.h"
4746
#include "llvm/Support/ErrorHandling.h"
4847
#include "llvm/Support/TrailingObjects.h"
4948
#include "llvm/Support/VersionTuple.h"
49+
#include <optional>
5050

5151
namespace swift {
5252
class ArgumentList;
@@ -664,8 +664,7 @@ enum class PlatformAgnosticAvailabilityKind {
664664
/// Defines the @available attribute.
665665
class AvailableAttr : public DeclAttribute {
666666
public:
667-
#define INIT_VER_TUPLE(X) \
668-
X(X.empty() ? std::optional<llvm::VersionTuple>() : X)
667+
#define INIT_VER_TUPLE(X) X(X.empty() ? std::optional<llvm::VersionTuple>() : X)
669668

670669
AvailableAttr(SourceLoc AtLoc, SourceRange Range, PlatformKind Platform,
671670
StringRef Message, StringRef Rename, ValueDecl *RenameDecl,
@@ -2348,18 +2347,17 @@ class ExternAttr : public DeclAttribute {
23482347
SourceLoc LParenLoc, RParenLoc;
23492348

23502349
public:
2351-
ExternAttr(std::optional<StringRef> ModuleName,
2352-
std::optional<StringRef> Name, SourceLoc AtLoc,
2353-
SourceLoc LParenLoc, SourceLoc RParenLoc, SourceRange Range,
2354-
ExternKind Kind, bool Implicit)
2350+
ExternAttr(std::optional<StringRef> ModuleName, std::optional<StringRef> Name,
2351+
SourceLoc AtLoc, SourceLoc LParenLoc, SourceLoc RParenLoc,
2352+
SourceRange Range, ExternKind Kind, bool Implicit)
23552353
: DeclAttribute(DeclAttrKind::Extern, AtLoc, Range, Implicit),
23562354
LParenLoc(LParenLoc), RParenLoc(RParenLoc), ModuleName(ModuleName),
23572355
Name(Name) {
23582356
Bits.ExternAttr.kind = static_cast<unsigned>(Kind);
23592357
}
23602358

2361-
ExternAttr(std::optional<StringRef> ModuleName,
2362-
std::optional<StringRef> Name, ExternKind Kind, bool Implicit)
2359+
ExternAttr(std::optional<StringRef> ModuleName, std::optional<StringRef> Name,
2360+
ExternKind Kind, bool Implicit)
23632361
: ExternAttr(ModuleName, Name, SourceLoc(), SourceLoc(), SourceLoc(),
23642362
SourceRange(), Kind, Implicit) {}
23652363

@@ -2558,22 +2556,23 @@ class RawLayoutAttr final : public DeclAttribute {
25582556
/// Return the type whose array layout the attribute type should get its
25592557
/// layout from, along with the size of that array. Returns None if the
25602558
/// attribute specifies scalar or manual layout.
2561-
std::optional<std::pair<TypeRepr *, unsigned>> getArrayLikeTypeAndCount() const {
2559+
std::optional<std::pair<TypeRepr *, unsigned>>
2560+
getArrayLikeTypeAndCount() const {
25622561
if (!LikeType)
25632562
return std::nullopt;
25642563
if (Alignment == ~0u)
25652564
return std::nullopt;
25662565
return std::make_pair(LikeType, SizeOrCount);
25672566
}
2568-
2567+
25692568
/// Return the size and alignment of the attributed type. Returns
25702569
/// None if the attribute specifies layout like some other type.
25712570
std::optional<std::pair<unsigned, unsigned>> getSizeAndAlignment() const {
25722571
if (LikeType)
25732572
return std::nullopt;
25742573
return std::make_pair(SizeOrCount, Alignment);
25752574
}
2576-
2575+
25772576
Type getResolvedLikeType(StructDecl *sd) const;
25782577

25792578
/// Return the type whose single-element layout the attribute type should get
@@ -2586,7 +2585,7 @@ class RawLayoutAttr final : public DeclAttribute {
25862585
return std::nullopt;
25872586
return getResolvedLikeType(sd);
25882587
}
2589-
2588+
25902589
/// Return the type whose array layout the attribute type should get its
25912590
/// layout from, along with the size of that array. Returns None if the
25922591
/// attribute specifies scalar or manual layout.
@@ -2598,7 +2597,7 @@ class RawLayoutAttr final : public DeclAttribute {
25982597
return std::nullopt;
25992598
return std::make_pair(getResolvedLikeType(sd), SizeOrCount);
26002599
}
2601-
2600+
26022601
static bool classof(const DeclAttribute *DA) {
26032602
return DA->getKind() == DeclAttrKind::RawLayout;
26042603
}

include/swift/AST/Availability.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
#include "swift/AST/Type.h"
2121
#include "swift/Basic/LLVM.h"
22-
#include <optional>
2322
#include "llvm/Support/VersionTuple.h"
23+
#include <optional>
2424

2525
namespace swift {
2626
class ASTContext;
@@ -230,11 +230,12 @@ class UnavailabilityReason {
230230
class AvailabilityContext {
231231
VersionRange OSVersion;
232232
std::optional<bool> SPI;
233+
233234
public:
234235
/// Creates a context that requires certain versions of the target OS.
235236
explicit AvailabilityContext(VersionRange OSVersion,
236237
std::optional<bool> SPI = std::nullopt)
237-
: OSVersion(OSVersion), SPI(SPI) {}
238+
: OSVersion(OSVersion), SPI(SPI) {}
238239

239240
/// Creates a context that imposes the constraints of the ASTContext's
240241
/// deployment target.

include/swift/AST/CatchNode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
#ifndef SWIFT_AST_CATCHNODE_H
1414
#define SWIFT_AST_CATCHNODE_H
1515

16-
#include "llvm/ADT/Hashing.h"
17-
#include <optional>
18-
#include "llvm/ADT/PointerUnion.h"
1916
#include "swift/AST/Decl.h"
2017
#include "swift/AST/Expr.h"
2118
#include "swift/AST/Stmt.h"
19+
#include "llvm/ADT/Hashing.h"
20+
#include "llvm/ADT/PointerUnion.h"
21+
#include <optional>
2222

2323
namespace swift {
2424

include/swift/AST/ConstTypeInfo.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,15 @@ struct ConstValueTypePropertyInfo {
234234
std::shared_ptr<CompileTimeValue> Value;
235235
std::optional<AttrValueVector> PropertyWrappers;
236236

237-
ConstValueTypePropertyInfo(
238-
swift::VarDecl *VarDecl, std::shared_ptr<CompileTimeValue> Value,
239-
std::optional<AttrValueVector> PropertyWrappers)
240-
: VarDecl(VarDecl), Value(Value), PropertyWrappers(PropertyWrappers)
241-
{}
237+
ConstValueTypePropertyInfo(swift::VarDecl *VarDecl,
238+
std::shared_ptr<CompileTimeValue> Value,
239+
std::optional<AttrValueVector> PropertyWrappers)
240+
: VarDecl(VarDecl), Value(Value), PropertyWrappers(PropertyWrappers) {}
242241

243242
ConstValueTypePropertyInfo(swift::VarDecl *VarDecl,
244243
std::shared_ptr<CompileTimeValue> Value)
245244
: VarDecl(VarDecl), Value(Value),
246-
PropertyWrappers(std::optional<AttrValueVector>())
247-
{}
245+
PropertyWrappers(std::optional<AttrValueVector>()) {}
248246
};
249247

250248
struct ConstValueTypeInfo {

include/swift/AST/Decl.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6316,8 +6316,7 @@ class VarDecl : public AbstractStorageDecl {
63166316

63176317
/// Retrieve information about the mutability of the composed
63186318
/// property wrappers.
6319-
std::optional<PropertyWrapperMutability>
6320-
getPropertyWrapperMutability() const;
6319+
std::optional<PropertyWrapperMutability> getPropertyWrapperMutability() const;
63216320

63226321
/// Returns whether this property is the backing storage property or a storage
63236322
/// wrapper for wrapper instance's projectedValue. If this property is

include/swift/AST/DeclContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
#include "swift/Basic/LLVM.h"
3030
#include "swift/Basic/STLExtras.h"
3131
#include "swift/Basic/SourceLoc.h"
32-
#include <optional>
3332
#include "llvm/ADT/PointerEmbeddedInt.h"
3433
#include "llvm/ADT/PointerIntPair.h"
3534
#include "llvm/ADT/PointerUnion.h"
3635
#include "llvm/Support/raw_ostream.h"
36+
#include <optional>
3737

3838
#include <type_traits>
3939

include/swift/AST/DiagnosticConsumer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#include "swift/Basic/LLVM.h"
2323
#include "swift/Basic/SourceLoc.h"
2424
#include "llvm/ADT/None.h"
25-
#include <optional>
2625
#include "llvm/Support/SourceMgr.h"
26+
#include <optional>
2727

2828
namespace swift {
2929
class DiagnosticArgument;

include/swift/AST/DiagnosticEngine.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ namespace swift {
577577

578578
/// Conditionally limit the diagnostic behavior if the given \c limit
579579
/// is not \c None.
580-
InFlightDiagnostic &limitBehaviorIf(
581-
std::optional<DiagnosticBehavior> limit) {
580+
InFlightDiagnostic &
581+
limitBehaviorIf(std::optional<DiagnosticBehavior> limit) {
582582
if (!limit) {
583583
return *this;
584584
}

include/swift/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
#include "swift/Basic/Debug.h"
3434
#include "swift/Basic/InlineBitfield.h"
3535
#include "llvm/ADT/None.h"
36-
#include <optional>
3736
#include "llvm/Support/TrailingObjects.h"
37+
#include <optional>
3838
#include <utility>
3939

4040
namespace llvm {

include/swift/AST/ExtInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "swift/AST/LifetimeDependence.h"
2525

2626
#include "llvm/ADT/None.h"
27-
#include <optional>
2827
#include "llvm/Support/raw_ostream.h"
28+
#include <optional>
2929

3030
#include <utility>
3131

include/swift/AST/FineGrainedDependencies.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
#include "swift/Basic/ReferenceDependencyKeys.h"
2323
#include "llvm/ADT/Hashing.h"
2424
#include "llvm/ADT/None.h"
25-
#include <optional>
2625
#include "llvm/ADT/SetVector.h"
2726
#include "llvm/Support/MD5.h"
2827
#include "llvm/Support/MemoryBuffer.h"
2928
#include "llvm/Support/VirtualOutputBackend.h"
3029
#include "llvm/Support/YAMLParser.h"
3130
#include "llvm/Support/YAMLTraits.h"
3231
#include "llvm/Support/raw_ostream.h"
32+
#include <optional>
3333
#include <string>
3434
#include <unordered_map>
3535
#include <unordered_set>
@@ -892,8 +892,7 @@ class SourceFileDepGraph {
892892

893893
/// Read a swiftdeps file from \p buffer and return a SourceFileDepGraph if
894894
/// successful.
895-
std::optional<SourceFileDepGraph> static loadFromBuffer(
896-
llvm::MemoryBuffer &);
895+
std::optional<SourceFileDepGraph> static loadFromBuffer(llvm::MemoryBuffer &);
897896
std::optional<SourceFileDepGraph> static loadFromSwiftModuleBuffer(
898897
llvm::MemoryBuffer &);
899898

0 commit comments

Comments
 (0)