From 7ac02d54badc79489c86dfa9a10eefe1825e98b9 Mon Sep 17 00:00:00 2001 From: Ge Sen Date: Thu, 10 Dec 2015 13:35:06 +0800 Subject: [PATCH] Erase redundant whitespaces. --- include/swift/Basic/JSONSerialization.h | 2 +- include/swift/Driver/Types.h | 2 +- include/swift/SIL/PatternMatch.h | 2 +- include/swift/SILAnalysis/BottomUpIPAnalysis.h | 2 +- lib/AST/Module.cpp | 4 ++-- lib/IDE/SyntaxModel.cpp | 2 +- lib/Sema/CSRanking.cpp | 2 +- lib/Sema/TypeCheckAttr.cpp | 2 +- stdlib/public/core/ArrayBuffer.swift | 2 +- stdlib/public/core/String.swift | 2 +- test/1_stdlib/Mirror.swift | 2 +- test/Constraints/generic_overload.swift | 4 ++-- test/IRGen/class_bounded_generics.swift | 2 +- test/Interpreter/generics.swift | 2 +- test/Prototypes/FloatingPoint.swift | 2 +- test/Prototypes/Integers.swift.gyb | 2 +- test/SILGen/let_decls.swift | 2 +- test/SILPasses/copyforward.sil | 2 +- test/SILPasses/definite_init_diagnostics.swift | 2 +- test/SILPasses/devirt_static_witness_method.sil | 2 +- test/Sema/availability_versions.swift | 4 ++-- 21 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/swift/Basic/JSONSerialization.h b/include/swift/Basic/JSONSerialization.h index 9fd98b9d9bfaf..00946e705ff0a 100644 --- a/include/swift/Basic/JSONSerialization.h +++ b/include/swift/Basic/JSONSerialization.h @@ -284,7 +284,7 @@ struct missingTraits : public std::integral_constant::value && !has_ScalarTraits::value && !has_ObjectTraits::value - && !has_ArrayTraits::value> {}; + && !has_ArrayTraits::value> {}; template struct validatedObjectTraits : public std::integral_constant -void swift::driver::types::forAllTypes(const Fn &fn) { +void swift::driver::types::forAllTypes(const Fn &fn) { static_assert(std::is_constructible,Fn>::value, "must have the signature 'void(types::ID)'"); for (uint8_t i = 0; i < static_cast(TY_INVALID); ++i) diff --git a/include/swift/SIL/PatternMatch.h b/include/swift/SIL/PatternMatch.h index 29bf43af74479..68df32c62aea8 100644 --- a/include/swift/SIL/PatternMatch.h +++ b/include/swift/SIL/PatternMatch.h @@ -691,7 +691,7 @@ using BuiltinApplyTy = typename Apply_match::Ty; /// Matcher for any of the builtin checked conversions. template inline typename OneOf_match, BuiltinApplyTy>::Ty -m_CheckedConversion(const T0 &Op0) { +m_CheckedConversion(const T0 &Op0) { return m_USCheckedConversion(Op0) || m_SUCheckedConversion(Op0); } diff --git a/include/swift/SILAnalysis/BottomUpIPAnalysis.h b/include/swift/SILAnalysis/BottomUpIPAnalysis.h index 71754bd293d2b..20a62655a1825 100644 --- a/include/swift/SILAnalysis/BottomUpIPAnalysis.h +++ b/include/swift/SILAnalysis/BottomUpIPAnalysis.h @@ -148,7 +148,7 @@ class BottomUpIPAnalysis : public SILAnalysis { }; /// Computes and stores a bottom-up function order. - template class BottomUpFunctionOrder { + template class BottomUpFunctionOrder { typedef llvm::SmallVector FunctionInfoList; diff --git a/lib/AST/Module.cpp b/lib/AST/Module.cpp index 6b3ea61d8a771..6ffdb8a66c56b 100644 --- a/lib/AST/Module.cpp +++ b/lib/AST/Module.cpp @@ -119,7 +119,7 @@ class SourceFile::LookupCache { Members.shrink_and_clear(); } - decltype(Members)::const_iterator begin() const { return Members.begin(); } + decltype(Members)::const_iterator begin() const { return Members.begin(); } decltype(Members)::const_iterator end() const { return Members.end(); } decltype(Members)::const_iterator find(DeclName Name) const { return Members.find(Name); @@ -1530,7 +1530,7 @@ bool SourceFile::walk(ASTWalker &walker) { return false; } -StringRef SourceFile::getFilename() const { +StringRef SourceFile::getFilename() const { if (BufferID == -1) return ""; SourceManager &SM = getASTContext().SourceMgr; diff --git a/lib/IDE/SyntaxModel.cpp b/lib/IDE/SyntaxModel.cpp index 26177ff5c0a1b..21e123174a769 100644 --- a/lib/IDE/SyntaxModel.cpp +++ b/lib/IDE/SyntaxModel.cpp @@ -666,7 +666,7 @@ std::pair ModelASTWalker::walkToStmtPre(Stmt *S) { TokLen = 7; // '#elseif' if (!passNonTokenNode({SyntaxNodeKind::BuildConfigKeyword, CharSourceRange(Clause.Loc, TokLen) })) - return { false, nullptr }; + return { false, nullptr }; if (Clause.Cond && !annotateIfConfigConditionIdentifiers(Clause.Cond)) return { false, nullptr }; diff --git a/lib/Sema/CSRanking.cpp b/lib/Sema/CSRanking.cpp index ce1f5f7e90e7a..c93df28e45df4 100644 --- a/lib/Sema/CSRanking.cpp +++ b/lib/Sema/CSRanking.cpp @@ -1252,7 +1252,7 @@ ConstraintSystem::findBestSolution(SmallVectorImpl &viable, return None; } -SolutionDiff::SolutionDiff(ArrayRef solutions) { +SolutionDiff::SolutionDiff(ArrayRef solutions) { if (solutions.size() <= 1) return; diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index c7136e0302201..fab3e1bdab3ae 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -95,7 +95,7 @@ class AttributeEarlyChecker : public AttributeVisitor { void visitTransparentAttr(TransparentAttr *attr); void visitMutationAttr(DeclAttribute *attr); void visitMutatingAttr(MutatingAttr *attr) { visitMutationAttr(attr); } - void visitNonMutatingAttr(NonMutatingAttr *attr) { visitMutationAttr(attr); } + void visitNonMutatingAttr(NonMutatingAttr *attr) { visitMutationAttr(attr); } void visitDynamicAttr(DynamicAttr *attr); void visitOwnershipAttr(OwnershipAttr *attr) { diff --git a/stdlib/public/core/ArrayBuffer.swift b/stdlib/public/core/ArrayBuffer.swift index 1ee647bf91ba5..0143ba1bf82f9 100644 --- a/stdlib/public/core/ArrayBuffer.swift +++ b/stdlib/public/core/ArrayBuffer.swift @@ -175,7 +175,7 @@ extension _ArrayBuffer { element is Element, "Down-casted Array element failed to match the target type") } - else { + else { let ns = _nonNative _precondition( ns.objectAtIndex(index) is Element, diff --git a/stdlib/public/core/String.swift b/stdlib/public/core/String.swift index 057b49c85c327..6888366da3a62 100644 --- a/stdlib/public/core/String.swift +++ b/stdlib/public/core/String.swift @@ -208,7 +208,7 @@ extension String : _BuiltinUTF16StringLiteralConvertible { public init( _builtinUTF16StringLiteral start: Builtin.RawPointer, numberOfCodeUnits: Builtin.Word - ) { + ) { self = String( _StringCore( baseAddress: COpaquePointer(start), diff --git a/test/1_stdlib/Mirror.swift b/test/1_stdlib/Mirror.swift index 15257461cb16f..580eb1ab96cb6 100644 --- a/test/1_stdlib/Mirror.swift +++ b/test/1_stdlib/Mirror.swift @@ -55,7 +55,7 @@ func find(substring: String, within domain: String) -> String.Index? { if (domainCount < substringCount) { return nil } var sliceStart = domain.startIndex var sliceEnd = domain.startIndex.advancedBy(substringCount) - for var i = 0;; ++i { + for var i = 0;; ++i { if domain[sliceStart.. { +struct StructOverload { func f0(u: U, t: T) -> Int { return 0 } func f0(u: U, t: T) -> Double { return 0 } @@ -65,7 +65,7 @@ var so_f1_x2 = SO.f1(5, t: x2) d = so_f1_x2 // Overloading of class methods -class ClassOverloadA { +class ClassOverloadA { func f0(u: U, t: T) -> Int { return 0 } func f1(u: U, t: T) -> Double { return 0 } } diff --git a/test/IRGen/class_bounded_generics.swift b/test/IRGen/class_bounded_generics.swift index db65686275d7d..f6907441651f9 100644 --- a/test/IRGen/class_bounded_generics.swift +++ b/test/IRGen/class_bounded_generics.swift @@ -257,6 +257,6 @@ func class_bounded_metatype(t : T) { t.dynamicType.foo() } -class WeakRef { +class WeakRef { weak var value: T? } diff --git a/test/Interpreter/generics.swift b/test/Interpreter/generics.swift index 79186cdcec767..68b379822b0ac 100644 --- a/test/Interpreter/generics.swift +++ b/test/Interpreter/generics.swift @@ -93,7 +93,7 @@ func checkOverloadResolution() { } checkOverloadResolution() -class Base { +class Base { var v = 0 required init() {} func map() { diff --git a/test/Prototypes/FloatingPoint.swift b/test/Prototypes/FloatingPoint.swift index 5c00af67b4d19..46bafe9f58c6b 100644 --- a/test/Prototypes/FloatingPoint.swift +++ b/test/Prototypes/FloatingPoint.swift @@ -770,7 +770,7 @@ extension BinaryFloatingPointType { } public static func sqrt(x: X) -> Self { - if X._fractionalBitCount <= Self._fractionalBitCount { return sqrt(Self(x)) } + if X._fractionalBitCount <= Self._fractionalBitCount { return sqrt(Self(x)) } return Self(X._sqrtStickyRounding(x)) } diff --git a/test/Prototypes/Integers.swift.gyb b/test/Prototypes/Integers.swift.gyb index 40526f0fa4a7d..42a95385f5d39 100644 --- a/test/Prototypes/Integers.swift.gyb +++ b/test/Prototypes/Integers.swift.gyb @@ -168,7 +168,7 @@ public typealias UWord = UInt${word_bits} public protocol IntegerType : Comparable, ArithmeticType, - IntegerLiteralConvertible, CustomStringConvertible { + IntegerLiteralConvertible, CustomStringConvertible { // Dispatching through these puts less stress on the user reading // the interface and error messages (and on the type checker) than diff --git a/test/SILGen/let_decls.swift b/test/SILGen/let_decls.swift index 8e2d69c2b2903..2f8b581b01ccd 100644 --- a/test/SILGen/let_decls.swift +++ b/test/SILGen/let_decls.swift @@ -152,7 +152,7 @@ func testGetOnlySubscript(x : GetOnlySubscriptStruct, idx : Int) -> Int { extension Optional { func getLV() -> Int { } } -struct CloseOverAddressOnlyConstant { +struct CloseOverAddressOnlyConstant { func isError() { let AOV = Optional() takeClosure({ AOV.getLV() }) diff --git a/test/SILPasses/copyforward.sil b/test/SILPasses/copyforward.sil index bc1ac47056818..68307cf4d8ac6 100644 --- a/test/SILPasses/copyforward.sil +++ b/test/SILPasses/copyforward.sil @@ -11,7 +11,7 @@ sil @f_in_guaranteed : $@convention(thin) (@in_guaranteed T) -> () sil @f_out : $@convention(thin) (@out T) -> () sil @f_owned : $@convention(thin) (@owned T) -> () -protocol P { +protocol P { init(_ i : Int32) }; diff --git a/test/SILPasses/definite_init_diagnostics.swift b/test/SILPasses/definite_init_diagnostics.swift index e619272cd28c6..ad03ad2515952 100644 --- a/test/SILPasses/definite_init_diagnostics.swift +++ b/test/SILPasses/definite_init_diagnostics.swift @@ -721,7 +721,7 @@ class ClassWhoseInitDoesntReturn : BaseWithConvenienceInits { } // DI: Incorrectly diagnostic in delegating init with generic enum -enum r17233681Lazy { +enum r17233681Lazy { case Thunk(() -> T) case Value(T) diff --git a/test/SILPasses/devirt_static_witness_method.sil b/test/SILPasses/devirt_static_witness_method.sil index 81b9bd9514fab..1226e01d50197 100644 --- a/test/SILPasses/devirt_static_witness_method.sil +++ b/test/SILPasses/devirt_static_witness_method.sil @@ -5,7 +5,7 @@ import Builtin import Swift import SwiftShims -protocol CanAdd { +protocol CanAdd { func +(lhs: Self, rhs: Self) -> Self } diff --git a/test/Sema/availability_versions.swift b/test/Sema/availability_versions.swift index ceb523bf4f441..9c95bdea824e7 100644 --- a/test/Sema/availability_versions.swift +++ b/test/Sema/availability_versions.swift @@ -757,7 +757,7 @@ class ClassWithDeclarationsOfUnavailableClasses { func unavailableMethodWithUnavailableParameterType(o : ClassAvailableOn10_10) { } - func methodWithUnavailableReturnType() -> ClassAvailableOn10_10 { // expected-error {{'ClassAvailableOn10_10' is only available on OS X 10.10 or newer}} + func methodWithUnavailableReturnType() -> ClassAvailableOn10_10 { // expected-error {{'ClassAvailableOn10_10' is only available on OS X 10.10 or newer}} // expected-note@-1 {{add @available attribute to enclosing class}} // expected-note@-2 {{add @available attribute to enclosing instance method}} @@ -768,7 +768,7 @@ class ClassWithDeclarationsOfUnavailableClasses { } @available(OSX, introduced=10.10) - func unavailableMethodWithUnavailableReturnType() -> ClassAvailableOn10_10 { + func unavailableMethodWithUnavailableReturnType() -> ClassAvailableOn10_10 { return ClassAvailableOn10_10() }