Skip to content

Commit ab5aaeb

Browse files
Merge pull request swiftlang#9001 from practicalswift/gardening-20170425
[gardening] Unused variables. Unused diagnostics. Namespace comments. Typos.
2 parents 3d74633 + ff827e0 commit ab5aaeb

26 files changed

+30
-40
lines changed

include/swift/ABI/System.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
// Weak references use a marker to tell when they are controlled by
6060
// the ObjC runtime and when they are controlled by the Swift runtime.
6161
// Non-ObjC platforms don't use this marker.
62-
#define SWIFT_ABI_DEFAULT_OBJC_WEAK_REFERENCE_MARKER_MASK 0
62+
#define SWIFT_ABI_DEFAULT_OBJC_WEAK_REFERENCE_MARKER_MASK 0
6363
#define SWIFT_ABI_DEFAULT_OBJC_WEAK_REFERENCE_MARKER_VALUE 0
6464

6565
/*********************************** i386 *************************************/

include/swift/AST/DiagnosticsParse.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,6 @@ ERROR(sil_objc_with_tail_elements,none,
550550
"alloc_ref [objc] cannot have tail allocated elements", ())
551551
ERROR(found_unqualified_instruction_in_qualified_function,none,
552552
"found unqualified instruction in qualified function '%0'", (StringRef))
553-
ERROR(sil_unknown_access_kind_or_enforcement,none,
554-
"expected access kind or enforcement", ())
555553
ERROR(sil_expected_access_kind,none,
556554
"%0 instruction must have explicit access kind", (StringRef))
557555
ERROR(sil_expected_access_enforcement,none,
@@ -1180,8 +1178,6 @@ ERROR(expr_keypath_expected_property_or_type,PointsToFirstBadToken,
11801178
"expected property or type name within '#keyPath(...)'", ())
11811179
ERROR(expr_keypath_expected_rparen,PointsToFirstBadToken,
11821180
"expected ')' to complete '#keyPath' expression", ())
1183-
ERROR(expr_keypath_compound_name,none,
1184-
"cannot use compound name %0 in '#keyPath' expression", (DeclName))
11851181

11861182
// Selector expressions.
11871183
ERROR(expr_selector_expected_lparen,PointsToFirstBadToken,

include/swift/Migrator/SyntacticMigratorPass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class SyntacticMigratorPass {
3636
const clang::edit::Commit &getEdits() const;
3737
};
3838

39-
} // end namespae migrator
39+
} // end namespace migrator
4040
} // end namespace swift
4141

4242
#endif // SWIFT_MIGRATOR_SYNTACTICMIGRATORPASS_H

include/swift/Runtime/Config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@
134134
#define SWIFT_LLVM_CC_RegisterPreservingCC llvm::CallingConv::PreserveMost
135135

136136
#if SWIFT_USE_SWIFTCALL
137-
#define SWIFT_LLVM_CC_SwiftCC llvm::CallingConv::Swift
137+
#define SWIFT_LLVM_CC_SwiftCC llvm::CallingConv::Swift
138138
#else
139-
#define SWIFT_LLVM_CC_SwiftCC llvm::CallingConv::C
139+
#define SWIFT_LLVM_CC_SwiftCC llvm::CallingConv::C
140140
#endif
141141

142142
// If defined, it indicates that runtime function wrappers

include/swift/SIL/SILInstruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4994,7 +4994,7 @@ class EndLifetimeInst
49944994

49954995
/// An unsafe conversion in between ownership kinds.
49964996
///
4997-
/// This is used today in destructors where due to objective-c legacy
4997+
/// This is used today in destructors where due to Objective-C legacy
49984998
/// constraints, we need to be able to convert a guaranteed parameter to an owned
49994999
/// parameter.
50005000
class UncheckedOwnershipConversionInst

lib/AST/ASTMangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ void ASTMangler::appendImplFunctionType(SILFunctionType *fn) {
10361036
/// Mangle the context of the given declaration as a <context.
10371037
/// This is the top-level entrypoint for mangling <context>.
10381038
void ASTMangler::appendContextOf(const ValueDecl *decl) {
1039-
// Declarations provided provided by a C module have a special context
1039+
// Declarations provided by a C module have a special context
10401040
// mangling.
10411041
// known-context ::= 'So'
10421042
//

lib/AST/ProtocolConformance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ ProtocolConformance::subst(Type substType,
813813
&& "substitution mapped to different nominal?!");
814814

815815
SubstitutionMap subMap;
816-
if (auto *genericSig = getGenericSignature()) {
816+
if (getGenericSignature()) {
817817
auto *genericEnv = getGenericEnvironment();
818818
subMap = genericEnv->getSubstitutionMap(subs, conformances);
819819
}

lib/IDE/SwiftSourceDocInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ getCallArgLabelRanges(SourceManager &SM, Expr *Arg, LabelRangeEndAt EndKind) {
918918
std::vector<CharSourceRange> Ranges;
919919
if (TupleExpr *TE = dyn_cast<TupleExpr>(Arg)) {
920920
size_t ElemIndex = 0;
921-
for(Expr *Elem: TE->getElements()) {
921+
for (Expr *Elem : TE->getElements()) {
922922
SourceLoc LabelStart(Elem->getStartLoc());
923923
SourceLoc LabelEnd(LabelStart);
924924

lib/Index/Index.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
312312
if (NameLoc.isCompound()) {
313313
size_t LabelIndex = 0;
314314
SourceLoc ArgLoc;
315-
while((ArgLoc = NameLoc.getArgumentLabelLoc(LabelIndex++)).isValid()) {
315+
while ((ArgLoc = NameLoc.getArgumentLabelLoc(LabelIndex++)).isValid()) {
316316
LabelLocs.push_back(ArgLoc);
317317
}
318318
} else if (auto *CallParent = dyn_cast_or_null<CallExpr>(getParentExpr())) {
@@ -329,7 +329,7 @@ class IndexSwiftASTWalker : public SourceEntityWalker {
329329
return;
330330

331331
auto LabelIt = LabelLocs.begin();
332-
for(auto Prop : TypeContext->getStoredProperties()) {
332+
for (auto Prop : TypeContext->getStoredProperties()) {
333333
if (Prop->getParentInitializer() && Prop->isLet())
334334
continue;
335335

lib/SIL/SILBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ SILValue SILBuilder::emitObjCToThickMetatype(SILLocation Loc, SILValue Op,
345345
return createObjCToThickMetatype(Loc, Op, Ty);
346346
}
347347

348-
/// Add opned archetypes defined or used by the current instruction.
348+
/// Add opened archetypes defined or used by the current instruction.
349349
/// If there are no such opened archetypes in the current instruction
350350
/// and it is an instruction with just one operand, try to perform
351351
/// the same action for the instruction defining an operand, because

0 commit comments

Comments
 (0)