Skip to content

Commit ec4477f

Browse files
Merge pull request #7666 from practicalswift/gardening-20170221
[gardening] Remove asserts from fixed crashers. Fix URLs. Fix word processing artefacts. Cleanups.
2 parents 96f92a9 + 312a7fe commit ec4477f

File tree

13 files changed

+47
-33
lines changed

13 files changed

+47
-33
lines changed

docs/OwnershipManifesto.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ additional semantic concerns.
797797
A shared value can be used in the scope that binds it
798798
just like an ordinary parameter or `let` binding.
799799
If the shared value is used in a place that requires
800-
ownership, Swift will simply implicitly copy the value
800+
ownership, Swift will simply implicitly copy the value --
801801
again, just like an ordinary parameter or `let` binding.
802802

803803
#### Limitations of shared values
@@ -861,7 +861,7 @@ born from a trio of concerns:
861861
lexical and maintains the ability to run arbitrary code
862862
at the end of an access. Imagine what it would take to
863863
implement a loop that added these temporary mutable
864-
references to an array each iteration of the loop would
864+
references to an array -- each iteration of the loop would
865865
have to be able to queue up arbitrary code to run as a clean-up
866866
when the function was finished with the array. This would
867867
hardly be a low-cost abstraction! A more Rust-like

include/swift/Basic/OwnedString.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//

include/swift/Runtime/Config.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#ifndef SWIFT_RUNTIME_CONFIG_H
1818
#define SWIFT_RUNTIME_CONFIG_H
1919

20-
#include "llvm/Support/Compiler.h"
21-
2220
/// Does the current Swift platform support "unbridged" interoperation
2321
/// with Objective-C? If so, the implementations of various types must
2422
/// implicitly handle Objective-C pointers.

include/swift/Syntax/TokenSyntax.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//

include/swift/Syntax/Trivia.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
8-
// See http://swift.org/LICENSE.txt for license information
9-
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
1212
//

include/swift/Syntax/TypeSyntax.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class BalancedTokensSyntaxData final : public SyntaxData {
5656
#pragma mark balanced-tokens API
5757

5858
/// balanced-tokens -> Any identifier, keyword, literal, or operator
59-
/// | Any punctuation except (­, )­, [­, ]­, {­, or }­
59+
/// | Any punctuation except (, ), [, ], {, or }
6060
class BalancedTokensSyntax final : public Syntax {
6161
friend struct SyntaxFactory;
6262
friend class SyntaxData;
@@ -229,16 +229,16 @@ class TypeSyntaxData : public SyntaxData {
229229
#pragma mark -
230230
#pragma mark type-syntax API
231231

232-
/// type -> array-type­
233-
/// | dictionary-type­
234-
/// | function-type­
235-
/// | type-identifier­
236-
/// | tuple-type­
237-
/// | optional-type­
238-
/// | implicitly-unwrapped-optional-type­
239-
/// | protocol-composition-type­
240-
/// | metatype-type­
241-
/// | 'Any­'
232+
/// type -> array-type
233+
/// | dictionary-type
234+
/// | function-type
235+
/// | type-identifier
236+
/// | tuple-type
237+
/// | optional-type
238+
/// | implicitly-unwrapped-optional-type
239+
/// | protocol-composition-type
240+
/// | metatype-type
241+
/// | 'Any'
242242
/// | 'Self'
243243
class TypeSyntax : public Syntax {
244244
using DataType = TypeSyntaxData;

lib/SILGen/SILGenConvert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ ManagedValue SILGenFunction::emitExistentialErasure(
677677
if (!C.getEmitInto() && !silConv.useLoweredAddresses()) {
678678
// We should never create new buffers just for init_existential under
679679
// opaque values mode: This is a case of an opaque value that we can
680-
// treat as a by-value one
680+
// "treat" as a by-value one
681681
ManagedValue sub = F(SGFContext());
682682
SILValue v = B.createInitExistentialOpaque(
683683
loc, existentialTL.getLoweredType(), concreteFormalType,

lib/Sema/Semantics.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
//===--- Semantics.cpp - Semantics manager --------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
113
#include "swift/Sema/Semantics.h"
214
#include "swift/AST/Expr.h"
315
#include "swift/AST/Decl.h"

lib/Syntax/LegacyASTTransformer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ LegacyASTTransformer::visitStructDecl(StructDecl *D,
286286
const CursorIndex IndexInParent) {
287287
return getUnknownDecl(D);
288288

289-
/* TODO
289+
// TODO
290+
#if 0
290291
StructDeclSyntaxBuilder StructBuilder;
291292
if (D->getStartLoc().isValid()) {
292293
auto StructKeyword = findTokenSyntax(tok::kw_struct, "struct", SourceMgr,
@@ -332,7 +333,7 @@ LegacyASTTransformer::visitStructDecl(StructDecl *D,
332333
StructBuilder.useMembers(MemberBuilder.build());
333334

334335
return StructBuilder.build().Root;
335-
*/
336+
#endif
336337
}
337338

338339
RC<SyntaxData>

utils/rusage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,5 @@ def __call__(self, parser, namespace, v, option_string=None):
133133
% args.time)
134134

135135
if over_mem or over_time:
136-
exit(-1)
137-
exit(ret)
136+
sys.exit(-1)
137+
sys.exit(ret)

validation-test/BuildSystem/LTO/target-libraries-do-not-have-bitcode.test-sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,12 @@ function check_thin_archive_for_bitcode() {
2323
local BASE_TEMPDIR=$1
2424
local ARCHIVE=$2
2525

26-
local LIB_NAME=$(basename ${ARCHIVE})
27-
local LIB_ARCH=$(basename $(dirname ${ARCHIVE}))
28-
local LIB_PLATFORM=$(basename $(dirname $(dirname ${ARCHIVE})))
26+
local LIB_NAME
27+
LIB_NAME=$(basename ${ARCHIVE})
28+
local LIB_ARCH
29+
LIB_ARCH=$(basename $(dirname ${ARCHIVE}))
30+
local LIB_PLATFORM
31+
LIB_PLATFORM=$(basename $(dirname $(dirname ${ARCHIVE})))
2932

3033
LIB_TEMP_DIR="${BASE_TEMPDIR}/${LIB_PLATFORM}-${LIB_ARCH}-${LIB_NAME}"
3134
mkdir -p "${LIB_TEMP_DIR}"
@@ -52,8 +55,10 @@ function check_thick_archive_for_bitcode() {
5255
local BASE_TEMPDIR=$1
5356
local ARCHIVE=$2
5457

55-
local LIB_NAME=$(basename ${ARCHIVE})
56-
local LIB_PLATFORM=$(basename $(dirname ${ARCHIVE}))
58+
local LIB_NAME
59+
LIB_NAME=$(basename ${ARCHIVE})
60+
local LIB_PLATFORM
61+
LIB_PLATFORM=$(basename $(dirname ${ARCHIVE}))
5762

5863
LIB_TEMP_DIR="${BASE_TEMPDIR}/${LIB_PLATFORM}-thick-${LIB_NAME}"
5964
LIB_ARCHIVE_DIR="${LIB_TEMP_DIR}/archive"

validation-test/compiler_crashers_fixed/28599-false-should-have-found-context-by-now.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

88
// RUN: not %target-swift-frontend %s -emit-ir
9-
// REQUIRES: asserts
109
protocol a:A{{}class d{func b(a=}}protocol A:a{{}class a

validation-test/compiler_crashers_fixed/28604-isinheritedprotocolsvalid.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

88
// RUN: not %target-swift-frontend %s -emit-ir
9-
// REQUIRES: asserts
109
protocol a:b
1110
protocol b:Range<a>

0 commit comments

Comments
 (0)