Skip to content

Commit 1948704

Browse files
committed
Changes to make the merge compile.
1 parent 836b401 commit 1948704

File tree

74 files changed

+333
-1892
lines changed

Some content is hidden

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

74 files changed

+333
-1892
lines changed

Diff for: cmake/modules/AddSwift.cmake

-171
Original file line numberDiff line numberDiff line change
@@ -2203,8 +2203,6 @@ function(_add_swift_executable_single name)
22032203
"-Xlinker" "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")
22042204
endif()
22052205

2206-
<<<<<<< HEAD
2207-
=======
22082206
# SWIFT_ENABLE_TENSORFLOW
22092207
set(swift_relative_library_path "../lib/swift/${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}")
22102208
is_darwin_based_sdk("${SWIFTEXE_SINGLE_SDK}" IS_DARWIN)
@@ -2219,11 +2217,6 @@ function(_add_swift_executable_single name)
22192217
endif()
22202218
# END SWIFT_ENABLE_TENSORFLOW
22212219

2222-
# Find the names of dependency library targets.
2223-
#
2224-
# We don't add the ${ARCH} to the target suffix because we want to link
2225-
# against fat libraries.
2226-
>>>>>>> origin/tensorflow
22272220
_list_add_string_suffix(
22282221
"${SWIFTEXE_SINGLE_LINK_LIBRARIES}"
22292222
"-${SWIFT_SDK_${SWIFTEXE_SINGLE_SDK}_LIB_SUBDIR}-${SWIFTEXE_SINGLE_ARCHITECTURE}"
@@ -2279,11 +2272,7 @@ function(_add_swift_executable_single name)
22792272
target_link_libraries("${name}" PRIVATE ${SWIFTEXE_SINGLE_LINK_LIBRARIES})
22802273
swift_common_llvm_config("${name}" ${SWIFTEXE_SINGLE_LLVM_COMPONENT_DEPENDS})
22812274

2282-
<<<<<<< HEAD
22832275
set_target_properties(${name} PROPERTIES FOLDER "Swift executables")
2284-
=======
2285-
set_target_properties(${name}
2286-
PROPERTIES FOLDER "Swift executables")
22872276

22882277
# SWIFT_ENABLE_TENSORFLOW
22892278
if(NOT "${local_rpath}" STREQUAL "")
@@ -2293,166 +2282,6 @@ function(_add_swift_executable_single name)
22932282
# END SWIFT_ENABLE_TENSORFLOW
22942283
endfunction()
22952284

2296-
# Add an executable for each target variant. Executables are given suffixes
2297-
# with the variant SDK and ARCH.
2298-
#
2299-
# See add_swift_executable for detailed documentation.
2300-
#
2301-
# Additional parameters:
2302-
# [LINK_FAT_LIBRARIES lipo_target1 ...]
2303-
# Fat libraries to link with.
2304-
function(add_swift_target_executable name)
2305-
# Parse the arguments we were given.
2306-
cmake_parse_arguments(SWIFTEXE_TARGET
2307-
"EXCLUDE_FROM_ALL;;BUILD_WITH_STDLIB"
2308-
""
2309-
"DEPENDS;LLVM_COMPONENT_DEPENDS;LINK_FAT_LIBRARIES"
2310-
${ARGN})
2311-
2312-
set(SWIFTEXE_TARGET_SOURCES ${SWIFTEXE_TARGET_UNPARSED_ARGUMENTS})
2313-
2314-
translate_flag(${SWIFTEXE_TARGET_EXCLUDE_FROM_ALL}
2315-
"EXCLUDE_FROM_ALL"
2316-
SWIFTEXE_TARGET_EXCLUDE_FROM_ALL_FLAG)
2317-
2318-
# All Swift executables depend on the standard library.
2319-
list(APPEND SWIFTEXE_TARGET_LINK_FAT_LIBRARIES swiftCore)
2320-
# All Swift executables depend on the swiftSwiftOnoneSupport library.
2321-
list(APPEND SWIFTEXE_TARGET_DEPENDS swiftSwiftOnoneSupport)
2322-
2323-
if(NOT "${SWIFT_BUILD_STDLIB}")
2324-
list(REMOVE_ITEM SWIFTEXE_TARGET_LINK_FAT_LIBRARIES
2325-
swiftCore)
2326-
endif()
2327-
2328-
foreach(sdk ${SWIFT_SDKS})
2329-
foreach(arch ${SWIFT_SDK_${sdk}_ARCHITECTURES})
2330-
set(VARIANT_SUFFIX "-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
2331-
set(VARIANT_NAME "${name}${VARIANT_SUFFIX}")
2332-
2333-
set(SWIFTEXE_TARGET_EXCLUDE_FROM_ALL_FLAG_CURRENT
2334-
${SWIFTEXE_TARGET_EXCLUDE_FROM_ALL_FLAG})
2335-
if(NOT "${VARIANT_SUFFIX}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SUFFIX}")
2336-
# By default, don't build executables for target SDKs to avoid building
2337-
# target stdlibs.
2338-
set(SWIFTEXE_TARGET_EXCLUDE_FROM_ALL_FLAG_CURRENT "EXCLUDE_FROM_ALL")
2339-
endif()
2340-
2341-
if(SWIFTEXE_TARGET_BUILD_WITH_STDLIB)
2342-
add_dependencies("swift-test-stdlib${VARIANT_SUFFIX}" ${VARIANT_NAME})
2343-
endif()
2344-
2345-
# Don't add the ${arch} to the suffix. We want to link against fat
2346-
# libraries.
2347-
_list_add_string_suffix(
2348-
"${SWIFTEXE_TARGET_DEPENDS}"
2349-
"-${SWIFT_SDK_${sdk}_LIB_SUBDIR}"
2350-
SWIFTEXE_TARGET_DEPENDS_with_suffix)
2351-
_add_swift_executable_single(
2352-
${VARIANT_NAME}
2353-
${SWIFTEXE_TARGET_SOURCES}
2354-
DEPENDS ${SWIFTEXE_TARGET_DEPENDS_with_suffix}
2355-
LLVM_COMPONENT_DEPENDS ${SWIFTEXE_TARGET_LLVM_COMPONENT_DEPENDS}
2356-
SDK "${sdk}"
2357-
ARCHITECTURE "${arch}"
2358-
LINK_FAT_LIBRARIES ${SWIFTEXE_TARGET_LINK_FAT_LIBRARIES}
2359-
${SWIFTEXE_TARGET_EXCLUDE_FROM_ALL_FLAG_CURRENT})
2360-
2361-
if(${sdk} IN_LIST SWIFT_APPLE_PLATFORMS)
2362-
add_custom_command_target(unused_var2
2363-
COMMAND "codesign" "-f" "-s" "-" "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}"
2364-
CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"
2365-
OUTPUT "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}_signed"
2366-
DEPENDS ${VARIANT_NAME})
2367-
else()
2368-
# No code signing on other platforms.
2369-
add_custom_command_target(unused_var2
2370-
CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"
2371-
OUTPUT "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}_signed"
2372-
DEPENDS ${VARIANT_NAME})
2373-
endif()
2374-
endforeach()
2375-
endforeach()
2376-
endfunction()
2377-
2378-
# Add an executable for the host machine.
2379-
#
2380-
# Usage:
2381-
# add_swift_executable(name
2382-
# [DEPENDS dep1 ...]
2383-
# [LLVM_COMPONENT_DEPENDS comp1 ...]
2384-
# [FILE_DEPENDS target1 ...]
2385-
# [LINK_LIBRARIES target1 ...]
2386-
# [EXCLUDE_FROM_ALL]
2387-
# [DONT_STRIP_NON_MAIN_SYMBOLS]
2388-
# [DISABLE_ASLR]
2389-
# source1 [source2 source3 ...])
2390-
#
2391-
# name
2392-
# Name of the executable (e.g., swift).
2393-
#
2394-
# LIBRARIES
2395-
# Libraries this executable depends on, without variant suffixes.
2396-
#
2397-
# LLVM_COMPONENT_DEPENDS
2398-
# LLVM components this executable depends on.
2399-
#
2400-
# FILE_DEPENDS
2401-
# Additional files this executable depends on.
2402-
#
2403-
# LINK_LIBRARIES
2404-
# Libraries to link with.
2405-
#
2406-
# EXCLUDE_FROM_ALL
2407-
# Whether to exclude this executable from the ALL_BUILD target.
2408-
#
2409-
# DONT_STRIP_NON_MAIN_SYMBOLS
2410-
# Should we not strip non main symbols.
2411-
#
2412-
# DISABLE_ASLR
2413-
# Should we compile with -Wl,-no_pie so that ASLR is disabled?
2414-
#
2415-
# source1 ...
2416-
# Sources to add into this executable.
2417-
#
2418-
# Note:
2419-
# Host executables are not given a variant suffix. To build an executable for
2420-
# each SDK and ARCH variant, use add_swift_target_executable.
2421-
function(add_swift_executable name)
2422-
# Parse the arguments we were given.
2423-
cmake_parse_arguments(SWIFTEXE
2424-
"EXCLUDE_FROM_ALL;DONT_STRIP_NON_MAIN_SYMBOLS;DISABLE_ASLR"
2425-
""
2426-
"DEPENDS;LLVM_COMPONENT_DEPENDS;LINK_LIBRARIES;COMPILE_FLAGS"
2427-
${ARGN})
2428-
2429-
translate_flag(${SWIFTEXE_EXCLUDE_FROM_ALL}
2430-
"EXCLUDE_FROM_ALL"
2431-
SWIFTEXE_EXCLUDE_FROM_ALL_FLAG)
2432-
translate_flag(${SWIFTEXE_DONT_STRIP_NON_MAIN_SYMBOLS}
2433-
"DONT_STRIP_NON_MAIN_SYMBOLS"
2434-
SWIFTEXE_DONT_STRIP_NON_MAIN_SYMBOLS_FLAG)
2435-
translate_flag(${SWIFTEXE_DISABLE_ASLR}
2436-
"DISABLE_ASLR"
2437-
SWIFTEXE_DISABLE_ASLR_FLAG)
2438-
2439-
set(SWIFTEXE_SOURCES ${SWIFTEXE_UNPARSED_ARGUMENTS})
2440-
2441-
_add_swift_executable_single(
2442-
${name}
2443-
${SWIFTEXE_SOURCES}
2444-
DEPENDS ${SWIFTEXE_DEPENDS}
2445-
LLVM_COMPONENT_DEPENDS ${SWIFTEXE_LLVM_COMPONENT_DEPENDS}
2446-
LINK_LIBRARIES ${SWIFTEXE_LINK_LIBRARIES}
2447-
SDK ${SWIFT_HOST_VARIANT_SDK}
2448-
ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
2449-
COMPILE_FLAGS ${SWIFTEXE_COMPILE_FLAGS}
2450-
${SWIFTEXE_EXCLUDE_FROM_ALL_FLAG}
2451-
${SWIFTEXE_DONT_STRIP_NON_MAIN_SYMBOLS_FLAG}
2452-
${SWIFTEXE_DISABLE_ASLR_FLAG})
2453-
>>>>>>> origin/tensorflow
2454-
endfunction()
2455-
24562285
macro(add_swift_tool_subdirectory name)
24572286
add_llvm_subdirectory(SWIFT TOOL ${name})
24582287
endmacro()

Diff for: cmake/modules/SwiftSource.cmake

-3
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,7 @@ function(_compile_swift_files
228228

229229
# The standard library and overlays are always built resiliently.
230230
if(SWIFTFILE_IS_STDLIB)
231-
<<<<<<< HEAD
232231
list(APPEND swift_flags "-enable-library-evolution")
233-
=======
234232
# SWIFT_ENABLE_TENSORFLOW
235233
# FIXME: `-enable-resilience` is currently disabled for the TensorFlow
236234
# module because it causes compilation to crash during IRGen.
@@ -241,7 +239,6 @@ function(_compile_swift_files
241239
NOT "${SWIFTFILE_MODULE_NAME}" STREQUAL "DifferentiationUnittest")
242240
list(APPEND swift_flags "-Xfrontend" "-enable-resilience")
243241
endif()
244-
>>>>>>> origin/tensorflow
245242
endif()
246243

247244
if(SWIFT_STDLIB_USE_NONATOMIC_RC)

Diff for: include/swift/AST/ASTContext.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,9 @@ class ASTContext final {
304304

305305
/// Cache of module names that fail the 'canImport' test in this context.
306306
llvm::SmallPtrSet<Identifier, 8> FailedModuleImportNames;
307-
<<<<<<< HEAD
308307

309-
/// Retrieve the allocator for the given arena.
310-
=======
311-
312308
public:
313-
/// \brief Retrieve the allocator for the given arena.
314-
>>>>>>> origin/tensorflow
309+
/// Retrieve the allocator for the given arena.
315310
llvm::BumpPtrAllocator &
316311
getAllocator(AllocationArena arena = AllocationArena::Permanent) const;
317312

Diff for: include/swift/AST/Attr.def

+6-6
Original file line numberDiff line numberDiff line change
@@ -411,19 +411,19 @@ SIMPLE_DECL_ATTR(_propertyDelegate, PropertyDelegate,
411411
DECL_ATTR(differentiable, Differentiable,
412412
OnAccessor | OnConstructor | OnFunc | OnVar | OnSubscript | LongAttribute |
413413
AllowMultipleAttributes,
414-
83)
414+
87)
415415
DECL_ATTR(differentiating, Differentiating,
416416
OnFunc | LongAttribute | AllowMultipleAttributes |
417-
NotSerialized, 84)
417+
NotSerialized, 88)
418418
SIMPLE_DECL_ATTR(compilerEvaluable, CompilerEvaluable,
419419
OnAccessor | OnFunc | OnConstructor | OnSubscript,
420-
/* Not serialized */ 85)
420+
/* Not serialized */ 89)
421421
SIMPLE_DECL_ATTR(TensorFlowGraph, TensorFlowGraph,
422-
OnFunc, 86)
422+
OnFunc, 90)
423423
SIMPLE_DECL_ATTR(_fieldwiseDifferentiable, FieldwiseDifferentiable,
424-
OnNominalType | UserInaccessible, 87)
424+
OnNominalType | UserInaccessible, 91)
425425
SIMPLE_DECL_ATTR(noDerivative, NoDerivative,
426-
OnVar, 88)
426+
OnVar, 92)
427427

428428
#undef TYPE_ATTR
429429
#undef DECL_ATTR_ALIAS

Diff for: include/swift/AST/Attr.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,6 @@ class ClangImporterSynthesizedTypeAttr : public DeclAttribute {
14251425
}
14261426
};
14271427

1428-
<<<<<<< HEAD
14291428
/// Defines a custom attribute.
14301429
class CustomAttr final : public DeclAttribute,
14311430
public TrailingCallArguments<CustomAttr> {
@@ -1478,8 +1477,6 @@ class CustomAttr final : public DeclAttribute,
14781477
}
14791478
};
14801479

1481-
/// Attributes that may be applied to declarations.
1482-
=======
14831480
// SWIFT_ENABLE_TENSORFLOW
14841481
struct DeclNameWithLoc {
14851482
DeclName Name;
@@ -1666,8 +1663,7 @@ class DifferentiatingAttr final
16661663
}
16671664
};
16681665

1669-
/// \brief Attributes that may be applied to declarations.
1670-
>>>>>>> origin/tensorflow
1666+
/// Attributes that may be applied to declarations.
16711667
class DeclAttributes {
16721668
/// Linked list of declaration attributes.
16731669
DeclAttribute *DeclAttrs;

Diff for: include/swift/AST/Decl.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -3388,10 +3388,9 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33883388
/// Is this a key path type?
33893389
Optional<KeyPathTypeKind> getKeyPathTypeKind() const;
33903390

3391-
<<<<<<< HEAD
33923391
/// Retrieve information about this type as a property delegate.
33933392
PropertyDelegateTypeInfo getPropertyDelegateTypeInfo() const;
3394-
=======
3393+
33953394
// SWIFT_ENABLE_TENSORFLOW
33963395
/// Get effective memberwise initializer for the given nominal type, if it
33973396
/// exists: either a synthesized memberwise initializer or a user-defined
@@ -3401,7 +3400,6 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
34013400
// SWIFT_ENABLE_TENSORFLOW
34023401
/// Add `@_fixed_layout` attribute to the nominal type, if possible.
34033402
void addFixedLayoutAttr();
3404-
>>>>>>> origin/tensorflow
34053403

34063404
private:
34073405
/// Predicate used to filter StoredPropertyRange.

Diff for: include/swift/AST/DiagnosticsParse.def

-3
Original file line numberDiff line numberDiff line change
@@ -483,14 +483,11 @@ ERROR(expected_sil_value_ownership_kind,none,
483483
"expected value ownership kind in SIL code", ())
484484
ERROR(expected_sil_colon,none,
485485
"expected ':' before %0", (StringRef))
486-
<<<<<<< HEAD
487486
ERROR(expected_sil_tuple_index,none,
488487
"expected tuple element index", ())
489-
=======
490488
// SWIFT_ENABLE_TENSORFLOW
491489
ERROR(malformed_autodiff_parameter_indices,none,
492490
"malformed autodiff parameter indices", ())
493-
>>>>>>> origin/tensorflow
494491

495492
// SIL Values
496493
ERROR(sil_value_redefinition,none,

Diff for: include/swift/AST/DiagnosticsSIL.def

-6
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,12 @@ ERROR(shifting_all_significant_bits,none,
395395
ERROR(static_report_error, none,
396396
"static report error", ())
397397

398-
<<<<<<< HEAD
399-
=======
400398
// SWIFT_ENABLE_TENSORFLOW
401-
>>>>>>> origin/tensorflow
402399
ERROR(pound_assert_condition_not_constant,none,
403400
"#assert condition not constant", ())
404401
ERROR(pound_assert_failure,none,
405402
"%0", (StringRef))
406403

407-
<<<<<<< HEAD
408404
NOTE(constexpr_unknown_reason_default,none,
409405
"cannot evaluate expression as constant here", ())
410406
NOTE(constexpr_unevaluable_operation,none,
@@ -456,7 +452,6 @@ NOTE(constexpr_witness_call_with_no_target_found, none,
456452
"cannot resolve a witness method call to a concrete function", ())
457453
NOTE(constexpr_witness_call_found_here, none,
458454
"witness method call found here", ())
459-
=======
460455
// Automatic differentiation diagnostics
461456
ERROR(autodiff_internal_swift_not_imported,none,
462457
"AD internal error: the Swift module is not imported", ())
@@ -517,7 +512,6 @@ NOTE(autodiff_class_member_not_supported,none,
517512
"differentiating class members is not supported yet", ())
518513
NOTE(autodiff_missing_return,none,
519514
"missing return for differentiation", ())
520-
>>>>>>> origin/tensorflow
521515

522516
ERROR(non_physical_addressof,none,
523517
"addressof only works with purely physical lvalues; "

Diff for: include/swift/AST/DiagnosticsSema.def

+1-3
Original file line numberDiff line numberDiff line change
@@ -3733,14 +3733,13 @@ ERROR(unsupported_convention,none,
37333733
ERROR(unreferenced_generic_parameter,none,
37343734
"generic parameter '%0' is not used in function signature", (StringRef))
37353735

3736-
<<<<<<< HEAD
37373736
// Opaque types
37383737
ERROR(unsupported_opaque_type,none,
37393738
"'some' types are only implemented for the declared type of properties and subscripts and the return type of functions", ())
37403739

37413740
ERROR(opaque_type_unsupported_pattern,none,
37423741
"'some' type can only be declared on a single property declaration", ())
3743-
=======
3742+
37443743
// SWIFT_ENABLE_TENSORFLOW
37453744
// Function differentiability
37463745
ERROR(autodiff_attr_argument_not_differentiable,none,
@@ -3753,7 +3752,6 @@ ERROR(autodiff_attr_result_not_differentiable,none,
37533752
ERROR(nondiff_attr_invalid_on_nondifferentiable_function,none,
37543753
"'nondiff' cannot be applied to arguments of a non-differentiable "
37553754
"function", ())
3756-
>>>>>>> origin/tensorflow
37573755

37583756
// SIL
37593757
ERROR(opened_non_protocol,none,

0 commit comments

Comments
 (0)