Skip to content

Commit 2164497

Browse files
committed
---
yaml --- r: 225279 b: refs/heads/tensorflow-merge c: 312bdb2 h: refs/heads/master i: 225277: 2c95821 225275: bde8b3a 225271: cf76a97 225263: 811d8e9 225247: 4789fe8 225215: efafda2 225151: f4ef673 225023: 6ac6252 224767: 1ca73cc 224255: e310c51 223231: 9282c7c 221183: dfb6c16
1 parent 2f9c46f commit 2164497

File tree

190 files changed

+1568
-8293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+1568
-8293
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-06-14-a: 888f12b456d2b9b0e35518c1972bb
906906
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-06-15-a: 683450174579052b46e32f3b8f7fcc6fe8127db9
907907
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-06-16-a: 5d81d51e075adbc6128d5612ac1d9a43186d0396
908908
refs/heads/move-debugging-executables-into-its-own-section: 968835a1ac02f692a0f5d8ebd60949ab6b0f14bc
909-
refs/heads/tensorflow-merge: 8620bc619bd8b31ba2d757eea6c43efb44048f86
909+
refs/heads/tensorflow-merge: 312bdb2032dfc33e666f94617fdd56629d8a28aa
910910
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-06-17-a: b947b41f2e23855c11bd483879813857b41e63ec
911911
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-06-18-a: 76370219d53fcd9b9d7440166a992c9fd21909f7
912912
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-06-19-a: 171b02e41ec9c3c8b592cecf7da70ab560d06cc5

branches/tensorflow-merge/benchmark/scripts/bench_code_size.py

Lines changed: 0 additions & 104 deletions
This file was deleted.

branches/tensorflow-merge/benchmark/scripts/run_smoke_bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
# ===--- run_smoke_bench -------------------------------------------------===//
4+
# ===--- Benchmark_Driver ------------------------------------------------===//
55
#
66
# This source file is part of the Swift.org open source project
77
#

branches/tensorflow-merge/include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,14 +1530,6 @@ ERROR(types_not_equal,none,
15301530
(Type, Type, Type))
15311531
ERROR(type_does_not_conform_owner,none,
15321532
"%0 requires that %1 conform to %2", (Type, Type, Type))
1533-
ERROR(type_does_not_conform_in_decl_ref,none,
1534-
"referencing %0 %1 on %2 requires that %3 conform to %4",
1535-
(DescriptiveDeclKind, DeclName, Type, Type, Type))
1536-
ERROR(type_does_not_conform_decl_owner,none,
1537-
"%0 %1 requires that %2 conform to %3",
1538-
(DescriptiveDeclKind, DeclName, Type, Type))
1539-
NOTE(where_type_does_not_conform_type,none,
1540-
"where %0 = %1", (Type, Type))
15411533
NOTE(requirement_implied_by_conditional_conformance,none,
15421534
"requirement from conditional conformance of %0 to %1", (Type, Type))
15431535
NOTE(candidate_types_equal_requirement,none,

branches/tensorflow-merge/include/swift/AST/Module.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ enum class SourceFileKind {
100100
Library, ///< A normal .swift file.
101101
Main, ///< A .swift file that can have top-level code.
102102
REPL, ///< A virtual file that holds the user's input in the REPL.
103-
SIL, ///< Came from a .sil file.
104-
Interface ///< Came from a .swiftinterface file, representing another module.
103+
SIL ///< Came from a .sil file.
105104
};
106105

107106
/// Discriminator for resilience strategy.
@@ -1022,7 +1021,6 @@ class SourceFile final : public FileUnit {
10221021
return true;
10231022

10241023
case SourceFileKind::Library:
1025-
case SourceFileKind::Interface:
10261024
case SourceFileKind::SIL:
10271025
return false;
10281026
}

branches/tensorflow-merge/include/swift/AST/Types.h

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,13 @@ class alignas(1 << TypeAlignInBits) TypeBase {
913913
/// the result would be the (parenthesized) type ((int, int)).
914914
Type getUnlabeledType(ASTContext &Context);
915915

916+
/// Retrieve the type without any labels around it. For example, given
917+
/// \code
918+
/// (p : int)
919+
/// \endcode
920+
/// the result would be the (unparenthesized) type 'int'.
921+
Type getWithoutImmediateLabel();
922+
916923
/// Retrieve the type without any parentheses around it.
917924
Type getWithoutParens();
918925

@@ -937,6 +944,11 @@ class alignas(1 << TypeAlignInBits) TypeBase {
937944
/// Otherwise, returns the type itself.
938945
Type getRValueType();
939946

947+
/// getRValueType - For an @lvalue type or tuple containing a single
948+
/// non-variadic element, retrieves the underlying object type.
949+
/// Otherwise, returns the type itself.
950+
Type getRValueObjectType();
951+
940952
/// getInOutObjectType - For an inout type, retrieves the underlying object
941953
/// type. Otherwise, returns the type itself.
942954
Type getInOutObjectType();
@@ -946,7 +958,8 @@ class alignas(1 << TypeAlignInBits) TypeBase {
946958
/// Otherwise, returns the type itself.
947959
Type getWithoutSpecifierType();
948960

949-
/// getRValueInstanceType - Looks through inout types and metatypes.
961+
/// Retrieves the rvalue instance type, looking through single-element
962+
/// tuples, inout types, and metatypes.
950963
Type getRValueInstanceType();
951964

952965
/// For a ReferenceStorageType like @unowned, this returns the referent.
@@ -1890,6 +1903,16 @@ class TupleType final : public TypeBase, public llvm::FoldingSetNode,
18901903
bool hasInOutElement() const {
18911904
return static_cast<bool>(Bits.TupleType.HasInOutElement);
18921905
}
1906+
1907+
/// Returns true if this tuple has parenthesis semantics.
1908+
bool hasParenSema(bool allowName = false) const {
1909+
auto Fields = getElements();
1910+
if (Fields.size() != 1 || Fields[0].isVararg())
1911+
return false;
1912+
if (allowName)
1913+
return true;
1914+
return !Fields[0].hasName();
1915+
}
18931916

18941917
// Implement isa/cast/dyncast/etc.
18951918
static bool classof(const TypeBase *T) {
@@ -5146,6 +5169,17 @@ inline Type TypeBase::getInOutObjectType() {
51465169
return this;
51475170
}
51485171

5172+
inline Type TypeBase::getRValueObjectType() {
5173+
Type type = this;
5174+
5175+
// Look through lvalue type.
5176+
if (auto lv = type->getAs<LValueType>())
5177+
type = lv->getObjectType();
5178+
5179+
// Look through argument list tuples.
5180+
return type->getWithoutImmediateLabel();
5181+
}
5182+
51495183
/// getWithoutSpecifierType - For a non-materializable type
51505184
/// e.g. @lvalue or inout, retrieves the underlying object type.
51515185
/// Otherwise, returns the type itself.

branches/tensorflow-merge/include/swift/Basic/SourceManager.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class SourceManager {
3030
unsigned CodeCompletionBufferID = 0U;
3131
unsigned CodeCompletionOffset;
3232

33+
/// \brief The buffer ID where a hashbang line #! is allowed.
34+
unsigned HashbangBufferID = 0U;
35+
3336
/// Associates buffer identifiers to buffer IDs.
3437
llvm::StringMap<unsigned> BufIdentIDMap;
3538

@@ -85,6 +88,15 @@ class SourceManager {
8588

8689
SourceLoc getCodeCompletionLoc() const;
8790

91+
void setHashbangBufferID(unsigned BufferID) {
92+
assert(HashbangBufferID == 0U && "Hashbang buffer ID already set");
93+
HashbangBufferID = BufferID;
94+
}
95+
96+
unsigned getHashbangBufferID() const {
97+
return HashbangBufferID;
98+
}
99+
88100
/// Returns true if \c LHS is before \c RHS in the source buffer.
89101
bool isBeforeInBuffer(SourceLoc LHS, SourceLoc RHS) const {
90102
return LHS.Value.getPointer() < RHS.Value.getPointer();

branches/tensorflow-merge/include/swift/Frontend/Frontend.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class CompilerInvocation {
293293
std::string getPCHHash() const;
294294

295295
SourceFile::ImplicitModuleImportKind getImplicitModuleImportKind() {
296-
if (getInputKind() == InputFileKind::SIL) {
296+
if (getInputKind() == InputFileKind::IFK_SIL) {
297297
return SourceFile::ImplicitModuleImportKind::None;
298298
}
299299
if (getParseStdlib()) {
@@ -310,7 +310,7 @@ class CompilerInvocation {
310310
bool alwaysSetModuleToMain, bool bePrimary,
311311
serialization::ExtendedValidationInfo &extendedInfo);
312312
bool hasSerializedAST() {
313-
return FrontendOpts.InputKind == InputFileKind::SwiftLibrary;
313+
return FrontendOpts.InputKind == InputFileKind::IFK_Swift_Library;
314314
}
315315

316316
const PrimarySpecificPaths &
@@ -507,10 +507,10 @@ class CompilerInstance {
507507
void setUpDiagnosticOptions();
508508
bool setUpModuleLoaders();
509509
bool isInputSwift() {
510-
return Invocation.getInputKind() == InputFileKind::Swift;
510+
return Invocation.getInputKind() == InputFileKind::IFK_Swift;
511511
}
512512
bool isInSILMode() {
513-
return Invocation.getInputKind() == InputFileKind::SIL;
513+
return Invocation.getInputKind() == InputFileKind::IFK_SIL;
514514
}
515515

516516
bool setUpInputs();

branches/tensorflow-merge/include/swift/Frontend/FrontendInputsAndOutputs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ class FrontendInputsAndOutputs {
152152
// treat the input as LLVM_IR.
153153
bool shouldTreatAsLLVM() const;
154154
bool shouldTreatAsSIL() const;
155-
bool shouldTreatAsModuleInterface() const;
156155

157156
bool areAllNonPrimariesSIB() const;
158157

branches/tensorflow-merge/include/swift/Frontend/FrontendOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class FrontendOptions {
3636
FrontendInputsAndOutputs InputsAndOutputs;
3737

3838
/// The kind of input on which the frontend should operate.
39-
InputFileKind InputKind = InputFileKind::Swift;
39+
InputFileKind InputKind = InputFileKind::IFK_Swift;
4040

4141
void forAllOutputPaths(const InputFile &input,
4242
llvm::function_ref<void(StringRef)> fn) const;
@@ -291,7 +291,7 @@ class FrontendOptions {
291291
StringRef determineFallbackModuleName() const;
292292

293293
bool isCompilingExactlyOneSwiftFile() const {
294-
return InputKind == InputFileKind::Swift &&
294+
return InputKind == InputFileKind::IFK_Swift &&
295295
InputsAndOutputs.hasSingleInput();
296296
}
297297

branches/tensorflow-merge/include/swift/Frontend/InputFile.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
namespace swift {
2323

2424
enum class InputFileKind {
25-
None,
26-
Swift,
27-
SwiftLibrary,
28-
SwiftREPL,
29-
SwiftModuleInterface,
30-
SIL,
31-
LLVM
25+
IFK_None,
26+
IFK_Swift,
27+
IFK_Swift_Library,
28+
IFK_Swift_REPL,
29+
IFK_SIL,
30+
IFK_LLVM_IR
3231
};
3332

3433
// Inputs may include buffers that override contents, and eventually should

branches/tensorflow-merge/include/swift/Migrator/ASTMigratorPass.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ void runAPIDiffMigratorPass(EditorAdapter &Editor,
5050
SourceFile *SF,
5151
const MigratorOptions &Opts);
5252

53+
/// Run a pass to fix up new tuple interpretation in SE-0110.
54+
void runTupleSplatMigratorPass(EditorAdapter &Editor,
55+
SourceFile *SF,
56+
const MigratorOptions &Opts);
57+
5358
} // end namespace migrator
5459
} // end namespace swift
5560

branches/tensorflow-merge/include/swift/Parse/Lexer.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ enum class TriviaRetentionMode {
5151
WithTrivia,
5252
};
5353

54-
enum class HashbangMode : bool {
55-
Disallowed,
56-
Allowed,
57-
};
58-
5954
/// Kinds of conflict marker which the lexer might encounter.
6055
enum class ConflictMarkerKind {
6156
/// A normal or diff3 conflict marker, initiated by at least 7 "<"s,
@@ -103,9 +98,6 @@ class Lexer {
10398
/// file. This enables the 'sil' keyword.
10499
const bool InSILMode;
105100

106-
/// True if we should skip past a `#!` line at the start of the file.
107-
const bool IsHashbangAllowed;
108-
109101
const CommentRetentionMode RetainComments;
110102

111103
const TriviaRetentionMode TriviaRetention;
@@ -136,7 +128,7 @@ class Lexer {
136128
/// everything.
137129
Lexer(const PrincipalTag &, const LangOptions &LangOpts,
138130
const SourceManager &SourceMgr, unsigned BufferID,
139-
DiagnosticEngine *Diags, bool InSILMode, HashbangMode HashbangAllowed,
131+
DiagnosticEngine *Diags, bool InSILMode,
140132
CommentRetentionMode RetainComments,
141133
TriviaRetentionMode TriviaRetention);
142134

@@ -159,14 +151,13 @@ class Lexer {
159151
Lexer(
160152
const LangOptions &Options, const SourceManager &SourceMgr,
161153
unsigned BufferID, DiagnosticEngine *Diags, bool InSILMode,
162-
HashbangMode HashbangAllowed = HashbangMode::Disallowed,
163154
CommentRetentionMode RetainComments = CommentRetentionMode::None,
164155
TriviaRetentionMode TriviaRetention = TriviaRetentionMode::WithoutTrivia);
165156

166157
/// \brief Create a lexer that scans a subrange of the source buffer.
167158
Lexer(const LangOptions &Options, const SourceManager &SourceMgr,
168159
unsigned BufferID, DiagnosticEngine *Diags, bool InSILMode,
169-
HashbangMode HashbangAllowed, CommentRetentionMode RetainComments,
160+
CommentRetentionMode RetainComments,
170161
TriviaRetentionMode TriviaRetention, unsigned Offset,
171162
unsigned EndOffset);
172163

0 commit comments

Comments
 (0)