Skip to content

[gardening] Shell fixes. Consistent headers. a-vs-an typos. Python fixes. Unused variables and methods. #7723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Feb 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pep8
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[flake8]
filename = *.py,80+-check,backtrace-check,Benchmark_Driver,Benchmark_DTrace.in,Benchmark_GuardMalloc.in,Benchmark_RuntimeLeaksRunner.in,build-script,check-incremental,clang++,coverage-build-db,coverage-generate-data,coverage-query-db,coverage-touch-tests,gyb,ld,line-directive,mock-distcc,ns-html2rst,PathSanitizingFileCheck,recursive-lipo,rth,run-test,scale-test,submit-benchmark-results,update-checkout,viewcfg,symbolicate-linux-fatal
filename = *.py,80+-check,backtrace-check,Benchmark_Driver,Benchmark_DTrace.in,Benchmark_GuardMalloc.in,Benchmark_RuntimeLeaksRunner.in,build-script,check-incremental,clang++,coverage-build-db,coverage-generate-data,coverage-query-db,coverage-touch-tests,gyb,ld,line-directive,mock-distcc,ns-html2rst,PathSanitizingFileCheck,python-lint,recursive-lipo,round-trip-syntax-test,rth,run-test,scale-test,submit-benchmark-results,update-checkout,viewcfg,symbolicate-linux-fatal
2 changes: 1 addition & 1 deletion include/swift/AST/GenericSignatureBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class RequirementSource : public llvm::FoldingSetNode {
GenericSignatureBuilder &builder,
ProtocolDecl *protocol);

/// Retrieve an requirement source for nested type name matches.
/// Retrieve a requirement source for nested type name matches.
static const RequirementSource *forNestedTypeNameMatch(
GenericSignatureBuilder &builder);

Expand Down
2 changes: 1 addition & 1 deletion include/swift/Basic/OwnedString.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand Down
2 changes: 1 addition & 1 deletion include/swift/IDE/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ class DeclNameViewer {
unsigned commonPartsCount(DeclNameViewer &Other) const;
};

/// This provide a utility for writing to a underlying string buffer multiple
/// This provide a utility for writing to an underlying string buffer mulitiple
/// string pieces and retrieve them later when the underlying buffer is stable.
class DelayedStringRetriever : public raw_ostream {
SmallVectorImpl<char> &OS;
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Sema/Semantics.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- Semantics.h - Swift Container for Semantic Info ----*- C++ -*-===//
//===--- Semantics.h - Swift Container for Semantic Info --------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Syntax/DeclSyntax.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- DeclSyntax.cpp - Declaration Syntax Interface ----------*- C++ -*-===//
//===--- DeclSyntax.h - Declaration Syntax Interface ------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Syntax/ExprSyntax.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- ExprSyntax.h - Swift Expression Syntax Interface --------*- C++ -*-===//
//===--- ExprSyntax.h - Swift Expression Syntax Interface -------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Syntax/Format.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- Format.cpp - Declaration Syntax Formatting Interface ---*- C++ -*-===//
//===--- Format.h - Declaration Syntax Formatting Interface -----*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Syntax/GenericSyntax.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- GenericSyntax.cpp - Swift Generic Syntax Interface -----*- C++ -*-===//
//===--- GenericSyntax.h - Swift Generic Syntax Interface -------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Syntax/SyntaxFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ struct SyntaxFactory {
/// Make a metatype type with all elements marked as missing.
static MetatypeTypeSyntax makeBlankMetatypeType();

/// Make an sugared Array type, as in `[MyType]`.
/// Make a sugared Array type, as in `[MyType]`.
static ArrayTypeSyntax makeArrayType(RC<TokenSyntax> LeftSquareBracket,
TypeSyntax ElementType,
RC<TokenSyntax> RightSquareBracket);
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Syntax/SyntaxKinds.def
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- SyntaxKinds.def - Swift Syntax Node Metaprogramming -------------===//
//===--- SyntaxKinds.def - Swift Syntax Node Metaprogramming --------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
9 changes: 0 additions & 9 deletions lib/AST/GenericSignatureBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2283,15 +2283,6 @@ class GenericSignatureBuilder::InferRequirementsWalker : public TypeWalker {
unsigned MinDepth;
unsigned MaxDepth;

/// We cannot add requirements to archetypes from outer generic parameter
/// lists.
bool isOuterArchetype(PotentialArchetype *PA) {
unsigned ParamDepth = PA->getRootGenericParamKey().Depth;
assert(ParamDepth <= MaxDepth);
(void) MaxDepth;
return ParamDepth < MinDepth;
}

public:
InferRequirementsWalker(GenericSignatureBuilder &builder,
TypeRepr *typeRepr,
Expand Down
2 changes: 1 addition & 1 deletion lib/Index/Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ bool IndexSwiftASTWalker::startEntityDecl(ValueDecl *D) {
return false;

} else if (auto ParentED = dyn_cast<ExtensionDecl>(Parent)) {
if (NominalTypeDecl *NTD = ParentED->getExtendedType()->getAnyNominal()) {
if (ParentED->getExtendedType()->getAnyNominal()) {
if (addRelation(Info, (SymbolRoleSet) SymbolRole::RelationChildOf, ParentED))
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/SILGen/SILGenPoly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ namespace {
SGF.B.createInitExistentialAddr(Loc, existentialBuf,
inputTupleType,
concreteTL.getLoweredType(),
/*Conformances=*/{});
/*conformances=*/{});

auto tupleTemp = SGF.useBufferAsTemporary(tupleBuf, concreteTL);
translateAndImplodeInto(inputOrigType, inputTupleType,
Expand Down Expand Up @@ -1911,7 +1911,7 @@ ResultPlanner::planTupleIntoIndirectResult(AbstractionPattern innerOrigType,
SILValue outerConcreteResultAddr
= Gen.B.createInitExistentialAddr(Loc, outerResultAddr, innerSubstType,
Gen.getLoweredType(opaque, innerSubstType),
/*Conformances=*/{});
/*conformances=*/{});

// Emit into that address.
planTupleIntoIndirectResult(innerOrigType, innerSubstType,
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/DeclSyntax.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- DeclSyntax.cpp - Declaration Syntax Implementation -----*- C++ -*-===//
//===--- DeclSyntax.cpp - Declaration Syntax Implementation ---------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/Format.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- Format.cpp - Declaration Syntax Formatting Impl. -------*- C++ -*-===//
//===--- Format.cpp - Declaration Syntax Formatting Impl. -----------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/GenericSyntax.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- GenericSyntax.cpp - Swift Generic Syntax Implementation *- C++ -*-===//
//===--- GenericSyntax.cpp - Swift Generic Syntax Implementation ----------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/LegacyASTTransformer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- LegacyASTTransformer.cpp - Swift lib/AST -> lib/Syntax -*- C++ -*-===//
//===--- LegacyASTTransformer.cpp - Swift lib/AST -> lib/Syntax -----------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/RawSyntax.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- RawSyntax.cpp - Swift Raw Syntax Implementation --------*- C++ -*-===//
//===--- RawSyntax.cpp - Swift Raw Syntax Implementation ------------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/StmtSyntax.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- StmtSyntax.cpp - Swift Statement Syntax Implementation -*- C++ -*-===//
//===--- StmtSyntax.cpp - Swift Statement Syntax Implementation -----------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/Syntax.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- Syntax.cpp - Swift Syntax Implementation ---------------*- C++ -*-===//
//===--- Syntax.cpp - Swift Syntax Implementation -------------------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/SyntaxData.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- SyntaxData.cpp - Swift Syntax Data Implementation ------*- C++ -*-===//
//===--- SyntaxData.cpp - Swift Syntax Data Implementation ----------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/SyntaxFactory.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- SyntaxFactory.cpp - Swift Syntax Builder Implementation *- C++ -*-===//
//===--- SyntaxFactory.cpp - Swift Syntax Builder Implementation ----------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/TokenSyntax.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- TokenSyntax.cpp - Swift Token Syntax Implementation ----*- C++ -*-===//
//===--- TokenSyntax.cpp - Swift Token Syntax Implementation --------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/Trivia.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- Syntax.cpp - Swift Syntax Trivia Implementation --------*- C++ -*-===//
//===--- Trivia.cpp - Swift Syntax Trivia Implementation ------------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/TypeSyntax.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- TypeSyntax.cpp - Swift Type Syntax Implementation ------*- C++ -*-===//
//===--- TypeSyntax.cpp - Swift Type Syntax Implementation ----------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2821,7 +2821,7 @@ namespace {
/// The number of bytes remaining.
size_t Remaining;
};
}
} // end anonymous namespace

// A statically-allocated pool. It's zero-initialized, so this
// doesn't cost us anything in binary size.
Expand Down
2 changes: 0 additions & 2 deletions tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,6 @@ static bool passCursorInfoForDecl(const ValueDecl *VD,

DelayedStringRetriever OverUSRsStream(SS);

SmallVector<std::pair<unsigned, unsigned>, 4> OverUSROffs;

ide::walkOverriddenDecls(VD,
[&](llvm::PointerUnion<const ValueDecl*, const clang::NamedDecl*> D) {
OverUSRsStream.startPiece();
Expand Down
2 changes: 1 addition & 1 deletion tools/swift-syntax-format/swift-syntax-format.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- swift-syntax-test.cpp - Reflection Syntax testing application ----===//
//===--- swift-syntax-format.cpp - Reflection Syntax testing application --===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion utils/rusage.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __call__(self, parser, namespace, v, option_string=None):
args = parser.parse_args()
if len(args.remainder) == 0:
parser.print_help()
exit(1)
sys.exit(1)

if args.enforce:
if args.time is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ set -u
# REQUIRES: OS=macosx
# RUN: %s %swift_obj_root

if [[ -n "$(find $1/lib -iname '*.cpp.o' -type f -exec file {} \; | grep -v -e bitcode -e bit-code)" ]]; then
if find $1/lib -iname '*.cpp.o' -type f -exec file {} \; | grep -q -v -e bitcode -e bit-code; then
echo "Found a ./lib non-bitcode object file!"
exit 1
else
echo "All ./lib object files are bit-code files!"
fi

if [[ -n "$(find $1/unittests -iname '*.cpp.o' -type f -exec file {} \; | grep -v -e bitcode -e bit-code)" ]]; then
if find $1/unittests -iname '*.cpp.o' -type f -exec file {} \; | grep -q -v -e bitcode -e bit-code; then
echo "Found a ./unittests non-bitcode object file!"
exit 1
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function check_thin_archive_for_bitcode() {
mkdir -p "${LIB_TEMP_DIR}"
cd "${LIB_TEMP_DIR}"
ar -x ${ARCHIVE}
if [[ -n "$(find ./ -iname '*.o' -exec file {} \; | grep -e bitcode -e bit-code)" ]]; then
if find ./ -iname '*.o' -exec file {} \; | grep -q -v -e bitcode -e bit-code; then
echo "Found bitcode file in thin archive: ${ARCHIVE}"
exit 1
else
Expand Down Expand Up @@ -78,7 +78,7 @@ function check_thick_archive_for_bitcode() {
cd ${arch}
ar -x "${LIB_ARCHIVE_DIR}/${THIN_ARCHIVE}"

if [[ -n "$(find ./ -iname '*.o' -exec file {} \; | grep -e bitcode -e bit-code)" ]]; then
if find ./ -iname '*.o' -exec file {} \; | grep -q -e bitcode -e bit-code; then
echo "Found bitcode file in thin archive: ${THIN_ARCHIVE}. Taken from thick archive: ${ARCHIVE}"
exit 1
else
Expand Down