Skip to content

Commit a34e259

Browse files
committed
Fix merge conflicts.
1 parent 821885f commit a34e259

23 files changed

+106
-632
lines changed

include/swift/AST/Attr.def

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,11 @@ TYPE_ATTR(noescape)
5353
TYPE_ATTR(escaping)
5454
TYPE_ATTR(differentiable)
5555
TYPE_ATTR(noDerivative)
56-
<<<<<<< HEAD
5756
// SWIFT_ENABLE_TENSORFLOW
5857
TYPE_ATTR(autodiff)
5958
TYPE_ATTR(nondiff)
6059
TYPE_ATTR(quoted)
61-
=======
62-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
60+
// SWIFT_ENABLE_TENSORFLOW END
6361

6462
// SIL-specific attributes
6563
TYPE_ATTR(block_storage)
@@ -548,36 +546,30 @@ DECL_ATTR(_implicitly_synthesizes_nested_requirement, ImplicitlySynthesizesNeste
548546
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
549547
98)
550548

551-
<<<<<<< HEAD
549+
DECL_ATTR(transpose, Transpose,
550+
OnFunc | LongAttribute | AllowMultipleAttributes |
551+
ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove,
552+
99)
553+
552554
// SWIFT_ENABLE_TENSORFLOW
553555
DECL_ATTR(quoted, Quoted,
554556
OnFunc |
555557
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove,
556-
99)
558+
100)
557559
// TODO(TF-999): Remove deprecated `@differentiating` attribute.
558560
DECL_ATTR(differentiating, Differentiating,
559561
OnFunc | LongAttribute | AllowMultipleAttributes |
560562
ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove,
561-
100)
563+
101)
562564
SIMPLE_DECL_ATTR(compilerEvaluable, CompilerEvaluable,
563565
OnAccessor | OnFunc | OnConstructor | OnSubscript |
564566
ABIStableToAdd | ABIStableToRemove | APIStableToAdd | APIStableToRemove |
565-
NotSerialized, 101)
567+
NotSerialized, 102)
566568
SIMPLE_DECL_ATTR(noDerivative, NoDerivative,
567569
OnVar |
568570
ABIBreakingToAdd | ABIBreakingToRemove | APIBreakingToAdd | APIBreakingToRemove,
569-
102)
570-
DECL_ATTR(transpose, Transpose,
571-
OnFunc | LongAttribute | AllowMultipleAttributes |
572-
ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove,
573571
103)
574572
// SWIFT_ENABLE_TENSORFLOW END
575-
=======
576-
DECL_ATTR(transpose, Transpose,
577-
OnFunc | LongAttribute | AllowMultipleAttributes |
578-
ABIStableToAdd | ABIBreakingToRemove | APIStableToAdd | APIBreakingToRemove,
579-
99)
580-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
581573

582574
#undef TYPE_ATTR
583575
#undef DECL_ATTR_ALIAS

include/swift/AST/Attr.h

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,17 +1948,11 @@ class DerivativeAttr final
19481948
}
19491949
};
19501950

1951-
<<<<<<< HEAD
19521951
// SWIFT_ENABLE_TENSORFLOW
19531952
// TODO(TF-999): Remove deprecated `@differentiating` attribute.
19541953
using DifferentiatingAttr = DerivativeAttr;
1954+
// SWIFT_ENABLE_TENSORFLOW END
19551955

1956-
/// Attribute that registers a function as a transpose of another function.
1957-
///
1958-
/// Examples:
1959-
/// @transpose(of: foo)
1960-
/// @transpose(of: +, wrt: (lhs, rhs))
1961-
=======
19621956
/// The `@transpose(of:)` attribute registers a function as a transpose of
19631957
/// another function-like declaration: a 'func', 'init', 'subscript', or 'var'
19641958
/// computed property declaration.
@@ -1970,17 +1964,12 @@ using DifferentiatingAttr = DerivativeAttr;
19701964
/// Examples:
19711965
/// @transpose(of: foo)
19721966
/// @transpose(of: +, wrt: (0, 1))
1973-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
19741967
class TransposeAttr final
19751968
: public DeclAttribute,
19761969
private llvm::TrailingObjects<TransposeAttr, ParsedAutoDiffParameter> {
19771970
friend TrailingObjects;
19781971

1979-
<<<<<<< HEAD
19801972
/// The base type for the referenced original declaration. This field is
1981-
=======
1982-
/// The base type repr for the referenced original function. This field is
1983-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
19841973
/// non-null only for parsed attributes that reference a qualified original
19851974
/// declaration. This field is not serialized; type-checking uses it to
19861975
/// resolve the original declaration, which is serialized.
@@ -1995,41 +1984,23 @@ class TransposeAttr final
19951984
IndexSubset *ParameterIndices = nullptr;
19961985

19971986
explicit TransposeAttr(bool implicit, SourceLoc atLoc, SourceRange baseRange,
1998-
<<<<<<< HEAD
1999-
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
2000-
ArrayRef<ParsedAutoDiffParameter> params);
2001-
2002-
explicit TransposeAttr(bool implicit, SourceLoc atLoc, SourceRange baseRange,
2003-
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
2004-
IndexSubset *indices);
2005-
=======
20061987
TypeRepr *baseType, DeclNameRefWithLoc original,
20071988
ArrayRef<ParsedAutoDiffParameter> params);
20081989

20091990
explicit TransposeAttr(bool implicit, SourceLoc atLoc, SourceRange baseRange,
20101991
TypeRepr *baseType, DeclNameRefWithLoc original,
20111992
IndexSubset *parameterIndices);
2012-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
20131993

20141994
public:
20151995
static TransposeAttr *create(ASTContext &context, bool implicit,
20161996
SourceLoc atLoc, SourceRange baseRange,
2017-
<<<<<<< HEAD
2018-
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
2019-
=======
20201997
TypeRepr *baseType, DeclNameRefWithLoc original,
2021-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
20221998
ArrayRef<ParsedAutoDiffParameter> params);
20231999

20242000
static TransposeAttr *create(ASTContext &context, bool implicit,
20252001
SourceLoc atLoc, SourceRange baseRange,
2026-
<<<<<<< HEAD
2027-
TypeRepr *baseTypeRepr, DeclNameRefWithLoc original,
2028-
IndexSubset *indices);
2029-
=======
20302002
TypeRepr *baseType, DeclNameRefWithLoc original,
20312003
IndexSubset *parameterIndices);
2032-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
20332004

20342005
TypeRepr *getBaseTypeRepr() const { return BaseTypeRepr; }
20352006
DeclNameRefWithLoc getOriginalFunctionName() const {
@@ -2065,10 +2036,6 @@ class TransposeAttr final
20652036
return DA->getKind() == DAK_Transpose;
20662037
}
20672038
};
2068-
<<<<<<< HEAD
2069-
// SWIFT_ENABLE_TENSORFLOW END
2070-
=======
2071-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
20722039

20732040
/// Attributes that may be applied to declarations.
20742041
class DeclAttributes {

include/swift/AST/DiagnosticsParse.def

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,6 @@ ERROR(diff_params_clause_expected_parameter,PointsToFirstBadToken,
16011601
ERROR(diff_params_clause_expected_parameter_unnamed,PointsToFirstBadToken,
16021602
"expected a parameter, which can be a function parameter index or 'self'",
16031603
())
1604-
<<<<<<< HEAD
16051604

16061605
// Automatic differentiation attributes
16071606
ERROR(autodiff_attr_expected_original_decl_name,PointsToFirstBadToken,
@@ -1644,16 +1643,10 @@ ERROR(sil_inst_autodiff_invalid_witness_generic_signature,PointsToFirstBadToken,
16441643
"parameters as original function generic signature '%1'",
16451644
(StringRef, StringRef))
16461645

1647-
// Quoted attribute.
1646+
// quoted
16481647
ERROR(attr_quoted_enable_experimental_quasiquotes,PointsToFirstBadToken,
16491648
"'@quoted' is unsupported; pass -enable-experimental-quasiquotes to "
16501649
"enable support for quasiquotes", ())
1651-
=======
1652-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
1653-
1654-
// Automatic differentiation attributes
1655-
ERROR(autodiff_attr_expected_original_decl_name,PointsToFirstBadToken,
1656-
"expected an original function name", ())
16571650

16581651
//------------------------------------------------------------------------------
16591652
// MARK: Generics parsing diagnostics

include/swift/AST/DiagnosticsSema.def

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4089,26 +4089,22 @@ ERROR(opaque_type_in_protocol_requirement,none,
40894089
"'some' type cannot be the return type of a protocol requirement; did you mean to add an associated type?",
40904090
())
40914091

4092-
<<<<<<< HEAD
4093-
// SWIFT_ENABLE_TENSORFLOW
40944092
// Function differentiability
4093+
ERROR(attr_only_on_parameters_of_differentiable,none,
4094+
"'%0' may only be used on parameters of '@differentiable' function "
4095+
"types", (StringRef))
4096+
// SWIFT_ENABLE_TENSORFLOW
40954097
ERROR(autodiff_attr_argument_not_differentiable,none,
40964098
"argument is not differentiable, but the enclosing function type is "
4097-
"marked '@differentiable'; did you want to add '@noDerivative' to this argument?",
4098-
())
4099+
"marked '@differentiable'; did you want to add '@noDerivative' to this "
4100+
"argument?", ())
40994101
ERROR(autodiff_attr_result_not_differentiable,none,
41004102
"result is not differentiable, but the function type is marked "
41014103
"'@differentiable'", ())
41024104
ERROR(attr_differentiable_no_vjp_or_jvp_when_linear,none,
41034105
"cannot specify 'vjp:' or 'jvp:' for linear functions; use "
41044106
"'transpose:' instead", ())
4105-
4106-
=======
4107-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
4108-
// Function differentiability
4109-
ERROR(attr_only_on_parameters_of_differentiable,none,
4110-
"'%0' may only be used on parameters of '@differentiable' function "
4111-
"types", (StringRef))
4107+
// SWIFT_ENABLE_TENSORFLOW END
41124108

41134109
// SIL
41144110
ERROR(opened_non_protocol,none,

include/swift/ClangImporter/ClangImporterOptions.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,16 @@ class ClangImporterOptions {
101101
/// When set, don't enforce warnings with -Werror.
102102
bool DebuggerSupport = false;
103103

104-
<<<<<<< HEAD
104+
/// When set, ClangImporter is disabled, and all requests go to the
105+
/// DWARFImporter delegate.
106+
bool DisableSourceImport = false;
107+
105108
// SWIFT_ENABLE_TENSORFLOW
106109
/// When set, clang writes its output files (module caches) to this instead
107110
/// of to the real filesystem.
108111
llvm::IntrusiveRefCntPtr<clang::InMemoryOutputFileSystem>
109112
InMemoryOutputFileSystem;
110-
111-
=======
112-
/// When set, ClangImporter is disabled, and all requests go to the
113-
/// DWARFImporter delegate.
114-
bool DisableSourceImport = false;
115-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
113+
// SWIFT_ENABLE_TENSORFLOW END
116114

117115
/// Return a hash code of any components from these options that should
118116
/// contribute to a Swift Bridging PCH hash.

include/swift/Parse/Parser.h

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,24 +1014,20 @@ class Parser {
10141014
ParserResult<DerivativeAttr> parseDerivativeAttribute(SourceLoc AtLoc,
10151015
SourceLoc Loc);
10161016

1017-
<<<<<<< HEAD
1017+
/// Parse the @transpose attribute.
1018+
ParserResult<TransposeAttr> parseTransposeAttribute(SourceLoc AtLoc,
1019+
SourceLoc Loc);
1020+
1021+
// SWIFT_ENABLE_TENSORFLOW
10181022
/// Parse the deprecated @differentiating attribute.
10191023
// TODO(TF-999): Remove the deprecated `@differentiating` attribute.
10201024
ParserResult<DerivativeAttr> parseDifferentiatingAttribute(SourceLoc AtLoc,
10211025
SourceLoc Loc);
10221026

1023-
=======
1024-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
1025-
/// Parse the @transpose attribute.
1026-
ParserResult<TransposeAttr> parseTransposeAttribute(SourceLoc AtLoc,
1027-
SourceLoc Loc);
1028-
1029-
<<<<<<< HEAD
10301027
/// Parse the @quoted attribute.
10311028
ParserResult<QuotedAttr> parseQuotedAttribute(SourceLoc AtLoc, SourceLoc Loc);
1029+
// SWIFT_ENABLE_TENSORFLOW END
10321030

1033-
=======
1034-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
10351031
/// Parse a specific attribute.
10361032
ParserStatus parseDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc);
10371033

@@ -1173,20 +1169,6 @@ class Parser {
11731169
SourceLoc &LAngleLoc,
11741170
SourceLoc &RAngleLoc);
11751171

1176-
<<<<<<< HEAD
1177-
// SWIFT_ENABLE_TENSORFLOW: Added `isParsingQualifiedDeclName` flag.
1178-
/// Parses a type identifier (e.g. 'Foo' or 'Foo.Bar.Baz').
1179-
///
1180-
/// When `isParsingQualifiedDeclName` is true:
1181-
/// - Parses the type qualifier from a qualified decl name, and returns a
1182-
/// parser result for the type of the qualifier.
1183-
/// - Positions the parser at the '.' before the final declaration name.
1184-
/// - For example, 'Foo.Bar.f' parses as 'Foo.Bar' and the parser gets
1185-
/// positioned at '.f'.
1186-
/// - If there is no type qualification (e.g. when parsing just 'f'), returns
1187-
/// an empty parser error.
1188-
ParserResult<TypeRepr> parseTypeIdentifier(bool isParsingQualifiedDeclName = false);
1189-
=======
11901172
/// Parses a type identifier (e.g. 'Foo' or 'Foo.Bar.Baz').
11911173
///
11921174
/// When `isParsingQualifiedDeclBaseType` is true:
@@ -1200,7 +1182,6 @@ class Parser {
12001182
/// an empty parser error.
12011183
ParserResult<TypeRepr> parseTypeIdentifier(
12021184
bool isParsingQualifiedDeclBaseType = false);
1203-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
12041185
ParserResult<TypeRepr> parseOldStyleProtocolComposition();
12051186
ParserResult<TypeRepr> parseAnyType();
12061187
ParserResult<TypeRepr> parseSILBoxType(GenericParamList *generics,
@@ -1431,17 +1412,11 @@ class Parser {
14311412

14321413
bool canParseTypedPattern();
14331414

1434-
<<<<<<< HEAD
1435-
// SWIFT_ENABLE_TENSORFLOW
1436-
/// Returns true if a base type for a qualified declaration name can be
1437-
/// parsed.
1438-
=======
14391415
/// Returns true if a qualified declaration name base type can be parsed.
14401416
///
14411417
/// \verbatim
14421418
/// qualified-decl-name-base-type: simple-type-identifier '.'
14431419
/// \endverbatim
1444-
>>>>>>> swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a
14451420
bool canParseBaseTypeForQualifiedDeclName();
14461421

14471422
//===--------------------------------------------------------------------===//

0 commit comments

Comments
 (0)