Skip to content

Commit 4c57791

Browse files
committed
Merge pull request #2025 from wxxsw/pull
[gardening] Put white spaces in between if/while clauses and braces where it is missing.
2 parents fc86f6e + 5ad36b2 commit 4c57791

File tree

17 files changed

+18
-18
lines changed

17 files changed

+18
-18
lines changed

docs/toc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
// Listen to the load event for the document.
7-
if (window.addEventListener){
7+
if (window.addEventListener) {
88
window.addEventListener('load', onload_handler, false);
99
} else if (window.attachEvent) {
1010
window.attachEvent('onload', onload_handler);

include/swift/AST/TypeMatcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class TypeMatcher {
186186

187187
template<typename FirstMetatypeType>
188188
bool handleAnyMetatypeType(CanTypeWrapper<FirstMetatypeType> firstMeta,
189-
Type secondType){
189+
Type secondType) {
190190
if (auto secondMeta = secondType->getAs<FirstMetatypeType>()) {
191191
if (firstMeta->getKind() != secondMeta->getKind())
192192
return mismatch(firstMeta.getPointer(), secondMeta);

include/swift/Reflection/ReflectionContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class ReflectionContext {
372372
return 0;
373373
}
374374

375-
TypeRefVector getGenericSubst(StoredPointer MetadataAddress){
375+
TypeRefVector getGenericSubst(StoredPointer MetadataAddress) {
376376
StoredPointer DescriptorAddress;
377377
SharedTargetNominalTypeDescriptorRef<Runtime> Descriptor;
378378
std::tie(Descriptor, DescriptorAddress)

include/swift/Reflection/TypeRef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ class TypeRefSubstitution
550550
}
551551

552552
TypeRefPointer
553-
visitGenericTypeParameterTypeRef(const GenericTypeParameterTypeRef *GTP){
553+
visitGenericTypeParameterTypeRef(const GenericTypeParameterTypeRef *GTP) {
554554
return Substitutions[{GTP->getDepth(), GTP->getIndex()}];
555555
}
556556

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ struct SynthesizedExtensionAnalyzer::Implementation {
442442
return {Result, MergeInfo};
443443
}
444444
assert(Ext->getGenericParams() && "No generic params.");
445-
for (auto Req : Ext->getGenericParams()->getRequirements()){
445+
for (auto Req : Ext->getGenericParams()->getRequirements()) {
446446
auto TupleOp = Req.getAsAnalyzedWrittenString();
447447
if (!TupleOp)
448448
continue;
@@ -536,7 +536,7 @@ struct SynthesizedExtensionAnalyzer::Implementation {
536536
std::unique_ptr<ExtensionInfoMap> InfoMap(new ExtensionInfoMap());
537537
ExtensionMergeInfoMap MergeInfoMap;
538538
std::vector<NominalTypeDecl*> Unhandled;
539-
auto addTypeLocNominal = [&](TypeLoc TL){
539+
auto addTypeLocNominal = [&](TypeLoc TL) {
540540
if (TL.getType()) {
541541
if (auto D = TL.getType()->getAnyNominal()) {
542542
Unhandled.push_back(D);

lib/AST/Decl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ void Decl::setDeclContext(DeclContext *DC) {
308308
}
309309

310310
bool Decl::isUserAccessible() const {
311-
if (auto VD = dyn_cast<VarDecl>(this)){
311+
if (auto VD = dyn_cast<VarDecl>(this)) {
312312
return VD->isUserAccessible();
313313
}
314314
return true;

lib/Frontend/SerializedDiagnosticConsumer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static void emitBlockID(unsigned ID, const char *Name,
315315
/// \brief Emits a record ID in the BLOCKINFO block.
316316
static void emitRecordID(unsigned ID, const char *Name,
317317
llvm::BitstreamWriter &Stream,
318-
RecordDataImpl &Record){
318+
RecordDataImpl &Record) {
319319
Record.clear();
320320
Record.push_back(ID);
321321

lib/SIL/SILPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,7 @@ class SILPrinter : public SILVisitor<SILPrinter> {
14911491
*this << "switch_enum ";
14921492
printSwitchEnumInst(SOI);
14931493
}
1494-
void visitSwitchEnumAddrInst(SwitchEnumAddrInst *SOI){
1494+
void visitSwitchEnumAddrInst(SwitchEnumAddrInst *SOI) {
14951495
*this << "switch_enum_addr ";
14961496
printSwitchEnumInst(SOI);
14971497
}

lib/SIL/SILVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2641,7 +2641,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
26412641
"switch_enum default destination must take no arguments");
26422642
}
26432643

2644-
void checkSwitchEnumAddrInst(SwitchEnumAddrInst *SOI){
2644+
void checkSwitchEnumAddrInst(SwitchEnumAddrInst *SOI) {
26452645
require(SOI->getOperand()->getType().isAddress(),
26462646
"switch_enum_addr operand must be an address");
26472647

lib/SILOptimizer/Analysis/ARCAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ findMatchingRetains(SILBasicBlock *BB) {
615615
if (SA && SA->getParent() != R.first)
616616
SA = nullptr;
617617

618-
for (auto X : R.first->getPreds()){
618+
for (auto X : R.first->getPreds()) {
619619
if (HandledBBs.find(X) != HandledBBs.end())
620620
continue;
621621
// Try to use the predecessor edge-value.

lib/SILOptimizer/LoopTransforms/ArrayBoundsCheckOpts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ static bool hoistBoundsChecks(SILLoop *Loop, DominanceInfo *DT, SILLoopInfo *LI,
11151115
// Find canonical induction variables.
11161116
InductionAnalysis IndVars(DT, IVs, Preheader, Header, ExitingBlk, ExitBlk);
11171117
bool IVarsFound = IndVars.analyse();
1118-
if (!IVarsFound){
1118+
if (!IVarsFound) {
11191119
DEBUG(llvm::dbgs() << "No induction variables found\n");
11201120
}
11211121

lib/SILOptimizer/LoopTransforms/LICM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static bool hoistInstructions(SILLoop *Loop, DominanceInfo *DT,
287287
DEBUG(llvm::dbgs() << " hoisting to preheader.\n");
288288
Changed = true;
289289
Inst->moveBefore(Preheader->getTerminator());
290-
} else if (RunsOnHighLevelSil){
290+
} else if (RunsOnHighLevelSil) {
291291
ArraySemanticsCall semCall(Inst);
292292
switch (semCall.getKind()) {
293293
case ArrayCallKind::kGetCount:

lib/SILOptimizer/Mandatory/DIMemoryUseCollector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ bool DIMemoryUse::
311311
onlyTouchesTrivialElements(const DIMemoryObjectInfo &MI) const {
312312
auto &Module = Inst->getModule();
313313

314-
for (unsigned i = FirstElement, e = i+NumElements; i != e; ++i){
314+
for (unsigned i = FirstElement, e = i+NumElements; i != e; ++i) {
315315
// Skip 'super.init' bit
316316
if (i == MI.getNumMemoryElements())
317317
return false;

lib/SILOptimizer/Mandatory/DataflowDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static void diagnoseMissingReturn(const UnreachableInst *UI,
6464

6565
static void diagnoseUnreachable(const SILInstruction *I,
6666
ASTContext &Context) {
67-
if (auto *UI = dyn_cast<UnreachableInst>(I)){
67+
if (auto *UI = dyn_cast<UnreachableInst>(I)) {
6868
SILLocation L = UI->getLoc();
6969

7070
// Invalid location means that the instruction has been generated by SIL

lib/SILOptimizer/Transforms/RemovePin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class RemovePinInsts : public SILFunctionTransform {
103103
SILValue RCId = RCIA->getRCIdentityRoot(Unpin->getOperand());
104104
DEBUG(llvm::dbgs() << " RCID Source: " << *RCId);
105105
auto *PinDef = dyn_cast<StrongPinInst>(RCId);
106-
if (PinDef && AvailablePins.count(PinDef)){
106+
if (PinDef && AvailablePins.count(PinDef)) {
107107
DEBUG(llvm::dbgs() << " Found matching pin: " << *PinDef);
108108
SmallVector<MarkDependenceInst *, 8> MarkDependentInsts;
109109
if (areSafePinUsers(PinDef, Unpin, MarkDependentInsts)) {

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ namespace {
16141614
Type visitUnresolvedDotExpr(UnresolvedDotExpr *expr) {
16151615
// Open a member constraint for constructor delegations on the
16161616
// subexpr type.
1617-
if (CS.TC.getSelfForInitDelegationInConstructor(CS.DC, expr)){
1617+
if (CS.TC.getSelfForInitDelegationInConstructor(CS.DC, expr)) {
16181618
auto baseTy = expr->getBase()->getType()
16191619
->getLValueOrInOutObjectType();
16201620

lib/Sema/TypeCheckPattern.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ bool TypeChecker::typeCheckPattern(Pattern *P, DeclContext *dc,
943943
for (unsigned i = 0, e = tuplePat->getNumElements(); i != e; ++i) {
944944
TuplePatternElt &elt = tuplePat->getElement(i);
945945
Pattern *pattern = elt.getPattern();
946-
if (typeCheckPattern(pattern, dc, elementOptions, resolver)){
946+
if (typeCheckPattern(pattern, dc, elementOptions, resolver)) {
947947
hadError = true;
948948
continue;
949949
}

0 commit comments

Comments
 (0)