Skip to content

Merge master 2020-07-06 resolving broken build #1389

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 49 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
3ed6c99
test: make `validate_parse` more python3 friendly
compnerd Jul 2, 2020
c894511
[Apple Silicon] Add arm64 macOS support to benchmark suite
shahmishal Jul 2, 2020
ff547e7
[Apple Silicon][Test] Enable testing for arm64 macOS
shahmishal Jul 2, 2020
84489d8
[Apple Silicon] Mark several tests that require the Swift interpreter…
shahmishal Jul 2, 2020
92ca9fc
[Apple Silicon] Generalize tests for other macOS architectures
shahmishal Jul 2, 2020
1899d2c
[Apple Silicon] Mark macOS tests that require x86_64
shahmishal Jul 2, 2020
919da26
[Apple Silicon] [Build] Generalize macOS architecture check
shahmishal Jul 2, 2020
4c97d0c
[Apple Silicon] [ObjectiveC Overlay] ObjCBool is C _Bool on arm64 macOS.
shahmishal Jul 2, 2020
134f202
[Apple Silicon] Baseline arm64 macOS at Swift 5.3 / macOS 10.16
shahmishal Jul 2, 2020
efe5907
[Apple Silicon] [Test] Fix various IRGen tests for arm64 macOS
shahmishal Jul 3, 2020
02b7403
[Apple Silicon] [Test] Generalize api-digester tests for Apple Silico…
shahmishal Jul 3, 2020
ee1ea6e
[Apple Silicon] Support building for macOS arm64/arm64e
shahmishal Jul 3, 2020
960f6ce
[Apple Silicon] [build-script] Support stdlib macOS arm64/arm64e
shahmishal Jul 3, 2020
37f7848
[Apple Silicon] Use SWIFT_CROSS_COMPILING to use build-time tools (tb…
shahmishal Jul 3, 2020
587ce88
[Apple Silicon] Don't set native llvm tools path when cross compiling…
shahmishal Jul 3, 2020
91a1dc4
[Apple Silicon] [build-script] Build compiler-rt even when cross-comp…
shahmishal Jul 3, 2020
24a48ef
[Apple Silicon] [build-script] Fix cross-compile check.
shahmishal Jul 3, 2020
5218470
[Apple Silicon] Build system configuration to support arm64 macOS
shahmishal Jul 3, 2020
7009e2e
[Apple Silicon] [build-script] Fix lipo step invocation with --no-leg…
shahmishal Jul 3, 2020
2aef2c5
[Apple Silicon] Fix cross-compilation in Xcode trains where we're not…
shahmishal Jul 3, 2020
24e8e32
[Apple Silicon] [Platform] Default arm64 macOS and arm64 simulators t…
shahmishal Jul 3, 2020
0c2617f
[Apple Silicon] [IRGen] Fix test for arm64 macOS
shahmishal Jul 3, 2020
3c9e72f
[Apple Silicon] [macCatalyst] Baseline arm64(e) macCatalyst at Swift …
shahmishal Jul 3, 2020
a8aec14
[Apple Silicon] Adjust linking deployment target from 11.0 down to 10…
shahmishal Jul 3, 2020
6336b14
[Apple Silicon] [In-process memory reader] Adjust low-bits computatio…
shahmishal Jul 3, 2020
83c57f3
[Apple Silicon] [Build] Filter out any architectures that are unsuppo…
shahmishal Jul 3, 2020
76fe814
[Apple Silicon] [Test] Fix a few tests for SDK differences
shahmishal Jul 3, 2020
40d0024
[Apple Silicon] [Test] Remove explicitly-specified target.
shahmishal Jul 3, 2020
a930b51
[Apple Silicon] Simulator support for arm64
shahmishal Jul 3, 2020
710ba14
[Apple Silicon] [Platform] Baseline arm64 simulators at iOS/tvOS 14.0…
shahmishal Jul 3, 2020
194d5d0
[Apple Silicon] Use a correct isa mask on Apple Silicon without signe…
shahmishal Jul 3, 2020
0c07365
[Apple Silicon] Fix the availability for Swift 5.3 version
shahmishal Jul 3, 2020
60d996f
[Apple Silicon] Add support for triple and availability canonicalization
shahmishal Jul 3, 2020
10dda58
[Apple Silicon] Update tests for no macOS target triple canonicalization
shahmishal Jul 3, 2020
899925a
[Apple Silicon] Remove tvOS/watchOS simulator from Driver/linker test
shahmishal Jul 3, 2020
1b97c03
[ownership] Loosen restrictions around what we specialize and add gen…
gottesmm Jun 10, 2020
58d0cbc
Update validate_parse.py
compnerd Jul 3, 2020
a94df37
Merge pull request #32688 from compnerd/validation
compnerd Jul 4, 2020
8a1f2c6
Merge pull request #32397 from gottesmm/pr-92e92ba00c4c145dbd65043094…
gottesmm Jul 4, 2020
3072429
[Apple Silicon] Update the comment in AvailabilitySpec.h
shahmishal Jul 5, 2020
6ef029d
[Apple Silicon] Update the comment in lib/AST/PlatformKind.cpp
shahmishal Jul 5, 2020
bee7ba2
[Apple Silicon] Update the comment in lib/Parse/ParseExpr.cpp
shahmishal Jul 5, 2020
ca87af1
Merge pull request #32705 from apple/apple-silicon-master
shahmishal Jul 5, 2020
d4bbcf9
[AutoDiff] Fix unexpected non-differentiable property access error. (…
dan-zheng Jul 5, 2020
7b54e8b
[TBDGen] NFC: print duplicate symbol name before assertion. (#32649)
dan-zheng Jul 5, 2020
c07b3b0
NFC: add operator<< for SubstitutionMap. (#32637)
dan-zheng Jul 5, 2020
9c20198
[AutoDiff] Disallow differentiation of opaque-result-typed functions.…
dan-zheng Jul 6, 2020
c1b336b
Merge remote-tracking branch 'apple/master' into katei/merge-master-2…
kateinoigakukun Jul 6, 2020
9a99563
[WASM] Resolve build failure by fixing cross compile issue on build-s…
kateinoigakukun Jul 6, 2020
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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ if(SWIFT_PATH_TO_CMARK_BUILD)
endif()
message(STATUS "")

if("${SWIFT_NATIVE_LLVM_TOOLS_PATH}" STREQUAL "")
set(SWIFT_CROSS_COMPILING FALSE)
else()
set(SWIFT_CROSS_COMPILING TRUE)
endif()

include(SwiftSharedCMakeConfig)

# NOTE: We include this before SwiftComponents as it relies on some LLVM CMake
Expand Down
8 changes: 2 additions & 6 deletions benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ macro(configure_build)
endmacro()

macro(configure_sdks_darwin)
set(macosx_arch "x86_64")
set(macosx_arch "x86_64" "arm64")
set(iphoneos_arch "arm64" "arm64e" "armv7")
set(appletvos_arch "arm64")
set(watchos_arch "armv7k")
Expand Down Expand Up @@ -609,11 +609,7 @@ function (swift_benchmark_compile_archopts)

if(is_darwin)
# If host == target.
if("${BENCH_COMPILE_ARCHOPTS_PLATFORM}" STREQUAL "macosx")
set(OUTPUT_EXEC "${benchmark-bin-dir}/Benchmark_${BENCH_COMPILE_ARCHOPTS_OPT}")
else()
set(OUTPUT_EXEC "${benchmark-bin-dir}/Benchmark_${BENCH_COMPILE_ARCHOPTS_OPT}-${target}")
endif()
set(OUTPUT_EXEC "${benchmark-bin-dir}/Benchmark_${BENCH_COMPILE_ARCHOPTS_OPT}-${target}")
else()
# If we are on Linux, we do not support cross compiling.
set(OUTPUT_EXEC "${benchmark-bin-dir}/Benchmark_${BENCH_COMPILE_ARCHOPTS_OPT}")
Expand Down
27 changes: 22 additions & 5 deletions cmake/modules/DarwinSDKs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,34 @@ option(SWIFT_ENABLE_IOS32

if(SWIFT_ENABLE_IOS32)
set(SUPPORTED_IOS_ARCHS "armv7;armv7s;arm64;arm64e")
set(SUPPORTED_IOS_SIMULATOR_ARCHS "i386;x86_64")
set(SUPPORTED_IOS_SIMULATOR_ARCHS "i386;x86_64;arm64")
else()
set(SUPPORTED_IOS_ARCHS "arm64;arm64e")
set(SUPPORTED_IOS_SIMULATOR_ARCHS "x86_64")
set(SUPPORTED_IOS_SIMULATOR_ARCHS "x86_64;arm64")
endif()

set(SUPPORTED_TVOS_ARCHS "arm64")
set(SUPPORTED_TVOS_SIMULATOR_ARCHS "x86_64")
set(SUPPORTED_TVOS_SIMULATOR_ARCHS "x86_64;arm64")
set(SUPPORTED_WATCHOS_ARCHS "armv7k")
set(SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386")
set(SUPPORTED_OSX_ARCHS "x86_64")
set(SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386;arm64")
set(SUPPORTED_OSX_ARCHS "x86_64;arm64;arm64e")

# Get the SDK version from SDKSettings.
execute_process(
COMMAND "defaults" "read" "${CMAKE_OSX_SYSROOT}/SDKSettings.plist" "Version"
OUTPUT_VARIABLE SWIFT_OSX_SDK_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)

# Remove the last component, if any. e.g. 10.15.26 -> 10.15
string(REGEX REPLACE "\([0-9]*[.][0-9]*\)[.][0-9]*" "\\1"
SWIFT_OSX_SDK_VERSION "${SWIFT_OSX_SDK_VERSION}")

if (${SWIFT_OSX_SDK_VERSION} STREQUAL "10.14" OR
${SWIFT_OSX_SDK_VERSION} STREQUAL "10.15")
set(SUPPORTED_OSX_ARCHS "x86_64")
else()
set(SUPPORTED_OSX_ARCHS "x86_64;arm64e")
endif()

is_sdk_requested(OSX swift_build_osx)
if(swift_build_osx)
Expand Down
35 changes: 35 additions & 0 deletions cmake/modules/SwiftConfigureSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,38 @@ function(_report_sdk prefix)
message(STATUS "")
endfunction()

# Remove architectures not supported by the SDK from the given list.
function(remove_sdk_unsupported_archs name os sdk_path architectures_var)
execute_process(COMMAND
/usr/libexec/PlistBuddy -c "Print :SupportedTargets:${os}:Archs" ${sdk_path}/SDKSettings.plist
OUTPUT_VARIABLE sdk_supported_archs
RESULT_VARIABLE plist_error)

if (NOT plist_error EQUAL 0)
message(STATUS "${os} SDK at ${sdk_path} does not publish its supported architectures")
return()
endif()

set(architectures)
foreach(arch ${${architectures_var}})
if(sdk_supported_archs MATCHES "${arch}\n")
list(APPEND architectures ${arch})
elseif(arch MATCHES "^armv7(s)?$" AND os STREQUAL "iphoneos")
# 32-bit iOS is not listed explicitly in SDK settings.
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
list(APPEND architectures ${arch})
elseif(arch STREQUAL "i386" AND os STREQUAL "iphonesimulator")
# 32-bit iOS simulatoris not listed explicitly in SDK settings.
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
list(APPEND architectures ${arch})
else()
message(STATUS "${name} SDK at ${sdk_path} does not support architecture ${arch}")
endif()
endforeach()

set("${architectures_var}" ${architectures} PARENT_SCOPE)
endfunction()

# Configure an SDK
#
# Usage:
Expand Down Expand Up @@ -164,6 +196,9 @@ macro(configure_sdk_darwin
SWIFT_SDK_${prefix}_ARCHITECTURES) # result
endif()

# Remove any architectures not supported by the SDK.
remove_sdk_unsupported_archs(${name} ${xcrun_name} ${SWIFT_SDK_${prefix}_PATH} SWIFT_SDK_${prefix}_ARCHITECTURES)

list_intersect(
"${SWIFT_DARWIN_MODULE_ARCHS}" # lhs
"${architectures}" # rhs
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/SwiftSharedCMakeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ macro(swift_common_standalone_build_config_llvm product)
fix_imported_targets_for_xcode("${LLVM_EXPORTED_TARGETS}")
endif()

if(NOT CMAKE_CROSSCOMPILING)
if(NOT CMAKE_CROSSCOMPILING AND NOT SWIFT_CROSS_COMPILING)
set(${product}_NATIVE_LLVM_TOOLS_PATH "${LLVM_TOOLS_BINARY_DIR}")
endif()

Expand Down
22 changes: 22 additions & 0 deletions include/swift/AST/AvailabilitySpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,33 @@ class PlatformVersionConstraintAvailabilitySpec : public AvailabilitySpec {
SourceLoc PlatformLoc;

llvm::VersionTuple Version;

// For macOS Big Sur, we canonicalize 10.16 to 11.0 for compile-time
// checking since clang canonicalizes availability markup. However, to
// support Beta versions of macOS Big Sur where the OS
// reports 10.16 at run time, we need to compare against 10.16,
//
// This means for:
//
// if #available(macOS 10.16, *) { ... }
//
// we need to keep around both a canonical version for use in compile-time
// checks and an uncanonicalized version for the version to actually codegen
// with.
llvm::VersionTuple RuntimeVersion;

SourceRange VersionSrcRange;

public:
PlatformVersionConstraintAvailabilitySpec(PlatformKind Platform,
SourceLoc PlatformLoc,
llvm::VersionTuple Version,
llvm::VersionTuple RuntimeVersion,
SourceRange VersionSrcRange)
: AvailabilitySpec(AvailabilitySpecKind::PlatformVersionConstraint),
Platform(Platform),
PlatformLoc(PlatformLoc), Version(Version),
RuntimeVersion(RuntimeVersion),
VersionSrcRange(VersionSrcRange) {}

/// The required platform.
Expand All @@ -93,6 +110,11 @@ class PlatformVersionConstraintAvailabilitySpec : public AvailabilitySpec {
llvm::VersionTuple getVersion() const { return Version; }
SourceRange getVersionSrcRange() const { return VersionSrcRange; }

// The version to be used in codegen for version comparisons at run time.
// This is required to support beta versions of macOS Big Sur that
// report 10.16 at run time.
llvm::VersionTuple getRuntimeVersion() const { return RuntimeVersion; }

SourceRange getSourceRange() const;

void print(raw_ostream &OS, unsigned Indent) const;
Expand Down
2 changes: 2 additions & 0 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -3151,6 +3151,8 @@ ERROR(autodiff_attr_original_multiple_semantic_results,none,
ERROR(autodiff_attr_result_not_differentiable,none,
"can only differentiate functions with results that conform to "
"'Differentiable', but %0 does not conform to 'Differentiable'", (Type))
ERROR(autodiff_attr_opaque_result_type_unsupported,none,
"cannot differentiate functions returning opaque result types", ())

// differentiation `wrt` parameters clause
ERROR(diff_function_no_parameters,none,
Expand Down
4 changes: 4 additions & 0 deletions include/swift/AST/PlatformKind.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "swift/Basic/LLVM.h"
#include "swift/Config.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/VersionTuple.h"

namespace swift {

Expand Down Expand Up @@ -65,6 +66,9 @@ PlatformKind targetPlatform(const LangOptions &LangOpts);
/// an explicit attribute for the child.
bool inheritsAvailabilityFromPlatform(PlatformKind Child, PlatformKind Parent);

llvm::VersionTuple canonicalizePlatformVersion(
PlatformKind platform, const llvm::VersionTuple &version);

} // end namespace swift

#endif
6 changes: 6 additions & 0 deletions include/swift/AST/SubstitutionMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ class SubstitutionMap {
Type lookupSubstitution(CanSubstitutableType type) const;
};

inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
const SubstitutionMap &subs) {
subs.dump(OS);
return OS;
}

/// A function object suitable for use as a \c TypeSubstitutionFn that
/// queries an underlying \c SubstitutionMap.
struct QuerySubstitutionMap {
Expand Down
6 changes: 3 additions & 3 deletions include/swift/AST/TypeCheckRequests.h
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,7 @@ class DerivativeAttrOriginalDeclRequest
/// property in a `Differentiable`-conforming type.
class TangentStoredPropertyRequest
: public SimpleRequest<TangentStoredPropertyRequest,
TangentPropertyInfo(VarDecl *),
TangentPropertyInfo(VarDecl *, CanType),
RequestFlags::Cached> {
public:
using SimpleRequest::SimpleRequest;
Expand All @@ -2201,8 +2201,8 @@ class TangentStoredPropertyRequest
friend SimpleRequest;

// Evaluation.
TangentPropertyInfo evaluate(Evaluator &evaluator,
VarDecl *originalField) const;
TangentPropertyInfo evaluate(Evaluator &evaluator, VarDecl *originalField,
CanType parentType) const;

public:
// Caching.
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/TypeCheckerTypeIDZone.def
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ SWIFT_REQUEST(TypeChecker, SynthesizeAccessorRequest,
AccessorDecl *(AbstractStorageDecl *, AccessorKind),
SeparatelyCached, NoLocationInfo)
SWIFT_REQUEST(TypeChecker, TangentStoredPropertyRequest,
llvm::Expected<VarDecl *>(VarDecl *), Cached, NoLocationInfo)
llvm::Expected<VarDecl *>(VarDecl *, CanType), Cached, NoLocationInfo)
SWIFT_REQUEST(TypeChecker, TypeCheckFunctionBodyRequest,
bool(AbstractFunctionDecl *), Cached, NoLocationInfo)
SWIFT_REQUEST(TypeChecker, TypeCheckFunctionBodyAtLocRequest,
Expand Down
4 changes: 2 additions & 2 deletions include/swift/Remote/InProcessMemoryReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class InProcessMemoryReader final : public MemoryReader {
#else
auto applePlatform = false;
#endif
#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV))
#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV) || defined(__arm64__))
auto iosDerivedPlatform = true;
#else
auto iosDerivedPlatform = false;
Expand Down Expand Up @@ -67,7 +67,7 @@ class InProcessMemoryReader final : public MemoryReader {
case DLQ_GetObjCReservedLowBits: {
auto result = static_cast<uint8_t *>(outBuffer);
if (applePlatform && !iosDerivedPlatform && (sizeof(void *) == 8)) {
// Obj-C reserves low bit on 64-bit macOS only.
// Obj-C reserves low bit on 64-bit Intel macOS only.
// Other Apple platforms don't reserve this bit (even when
// running on x86_64-based simulators).
*result = 1;
Expand Down
32 changes: 31 additions & 1 deletion include/swift/SIL/ApplySite.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
#ifndef SWIFT_SIL_APPLYSITE_H
#define SWIFT_SIL_APPLYSITE_H

#include "swift/SIL/SILArgument.h"
#include "swift/SIL/SILBasicBlock.h"
#include "swift/SIL/SILInstruction.h"
#include "swift/SIL/SILFunction.h"
#include "swift/SIL/SILInstruction.h"
#include "llvm/ADT/ArrayRef.h"

namespace swift {

Expand Down Expand Up @@ -502,6 +504,34 @@ class FullApplySite : public ApplySite {
return getSubstCalleeConv().hasIndirectSILResults();
}

/// If our apply site has a single direct result SILValue, return that
/// SILValue. Return SILValue() otherwise.
///
/// This means that:
///
/// 1. If we have an ApplyInst, we just visit the apply.
/// 2. If we have a TryApplyInst, we visit the first argument of the normal
/// block.
/// 3. If we have a BeginApplyInst, we return SILValue() since the begin_apply
/// yields values instead of returning them. A returned value should only
/// be valid after a full apply site has completely finished executing.
SILValue getSingleDirectResult() const {
switch (getKind()) {
case FullApplySiteKind::ApplyInst:
return SILValue(cast<ApplyInst>(getInstruction()));
case FullApplySiteKind::BeginApplyInst: {
return SILValue();
}
case FullApplySiteKind::TryApplyInst: {
auto *normalBlock = cast<TryApplyInst>(getInstruction())->getNormalBB();
assert(normalBlock->getNumArguments() == 1 &&
"Expected try apply to have a single result");
return normalBlock->getArgument(0);
}
}
llvm_unreachable("Covered switch isn't covered?!");
}

unsigned getNumIndirectSILResults() const {
return getSubstCalleeConv().getNumIndirectSILResults();
}
Expand Down
38 changes: 37 additions & 1 deletion include/swift/SIL/SILBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,8 @@ class SILBuilder {
}

LoadBorrowInst *createLoadBorrow(SILLocation Loc, SILValue LV) {
assert(isLoadableOrOpaque(LV->getType()));
assert(isLoadableOrOpaque(LV->getType()) &&
!LV->getType().isTrivial(getFunction()));
return insert(new (getModule())
LoadBorrowInst(getSILDebugLocation(Loc), LV));
}
Expand All @@ -737,11 +738,19 @@ class SILBuilder {
BeginBorrowInst(getSILDebugLocation(Loc), LV));
}

/// Convenience function for creating a load_borrow on non-trivial values and
/// load [trivial] on trivial values. Becomes load unqualified in non-ossa
/// functions.
SILValue emitLoadBorrowOperation(SILLocation loc, SILValue v) {
if (!hasOwnership()) {
return emitLoadValueOperation(loc, v,
LoadOwnershipQualifier::Unqualified);
}

if (v->getType().isTrivial(getFunction())) {
return emitLoadValueOperation(loc, v, LoadOwnershipQualifier::Trivial);
}

return createLoadBorrow(loc, v);
}

Expand Down Expand Up @@ -877,6 +886,33 @@ class SILBuilder {
StoreBorrowInst(getSILDebugLocation(Loc), Src, DestAddr));
}

/// A helper function for emitting store_borrow in operations where one must
/// handle both ossa and non-ossa code.
///
/// In words:
///
/// * If the function does not have ownership, this just emits an unqualified
/// store.
///
/// * If the function has ownership, but the type is trivial, use store
/// [trivial].
///
/// * Otherwise, emit an actual store_borrow.
void emitStoreBorrowOperation(SILLocation loc, SILValue src,
SILValue destAddr) {
if (!hasOwnership()) {
return emitStoreValueOperation(loc, src, destAddr,
StoreOwnershipQualifier::Unqualified);
}

if (src->getType().isTrivial(getFunction())) {
return emitStoreValueOperation(loc, src, destAddr,
StoreOwnershipQualifier::Trivial);
}

createStoreBorrow(loc, src, destAddr);
}

MarkUninitializedInst *
createMarkUninitialized(SILLocation Loc, SILValue src,
MarkUninitializedInst::Kind k) {
Expand Down
Loading