Skip to content

Commit d495229

Browse files
authored
Merge pull request #1422 from swiftwasm/maxd/master-merge
Resolve conflicts with master
2 parents 7494a0a + 0e669bf commit d495229

24 files changed

+829
-582
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//===------ BackDeploymentLibs.def - Backward Deployment Libraries --------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2018 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+
// Enumerates the backward deployment libraries that need to be linked
13+
// into Swift targets. Clients of this file must define the macro
14+
//
15+
// BACK_DEPLOYMENT_LIB(Version, Filter, LibraryName)
16+
//
17+
// where:
18+
// Version is a maximum Swift version written like a tuple, e.g., (5, 1)
19+
// Filter is one of executable or all.
20+
// LibraryName is the name of the library, e.g., "swiftCompatibility51"
21+
//===----------------------------------------------------------------------===//
22+
23+
#ifndef BACK_DEPLOYMENT_LIB
24+
# error "Must define BACK_DEPLOYMENT_LIB(Version, Filter, Library)"
25+
#endif
26+
27+
BACK_DEPLOYMENT_LIB((5, 0), all, "swiftCompatibility50")
28+
BACK_DEPLOYMENT_LIB((5, 1), all, "swiftCompatibility51")
29+
BACK_DEPLOYMENT_LIB((5, 0), executable, "swiftCompatibilityDynamicReplacements")
30+
31+
#undef BACK_DEPLOYMENT_LIB

include/swift/SIL/SILFunctionConventions.h

+8
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ class SILFunctionConventions {
396396
/// Return the SIL type of the apply/entry argument at the given index.
397397
SILType getSILArgumentType(unsigned index,
398398
TypeExpansionContext context) const;
399+
400+
/// Returns true if this function does not return to the caller.
401+
bool isNoReturn(TypeExpansionContext context) const;
399402
};
400403

401404
struct SILFunctionConventions::SILResultTypeFunc {
@@ -464,6 +467,11 @@ SILFunctionConventions::getSILArgumentType(unsigned index,
464467
funcTy->getParameters()[index - getNumIndirectSILResults()], context);
465468
}
466469

470+
inline bool
471+
SILFunctionConventions::isNoReturn(TypeExpansionContext context) const {
472+
return funcTy->isNoReturnFunction(silConv.getModule(), context);
473+
}
474+
467475
inline SILFunctionConventions
468476
SILModuleConventions::getFunctionConventions(CanSILFunctionType funcTy) {
469477
return SILFunctionConventions(funcTy, *this);

include/swift/SILOptimizer/Differentiation/JVPEmitter.h renamed to include/swift/SILOptimizer/Differentiation/JVPCloner.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- JVPEmitter.h - JVP Generation in Differentiation -----*- C++ -*---===//
1+
//===--- JVPCloner.h - JVP function generation ----------------*- C++ -*---===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -15,8 +15,8 @@
1515
//
1616
//===----------------------------------------------------------------------===//
1717

18-
#ifndef SWIFT_SILOPTIMIZER_UTILS_DIFFERENTIATION_JVPEMITTER_H
19-
#define SWIFT_SILOPTIMIZER_UTILS_DIFFERENTIATION_JVPEMITTER_H
18+
#ifndef SWIFT_SILOPTIMIZER_UTILS_DIFFERENTIATION_JVPCLONER_H
19+
#define SWIFT_SILOPTIMIZER_UTILS_DIFFERENTIATION_JVPCLONER_H
2020

2121
#include "swift/SILOptimizer/Differentiation/AdjointValue.h"
2222
#include "swift/SILOptimizer/Differentiation/DifferentiationInvoker.h"
@@ -40,8 +40,8 @@ namespace autodiff {
4040

4141
class ADContext;
4242

43-
class JVPEmitter final
44-
: public TypeSubstCloner<JVPEmitter, SILOptFunctionBuilder> {
43+
class JVPCloner final
44+
: public TypeSubstCloner<JVPCloner, SILOptFunctionBuilder> {
4545
private:
4646
/// The global context.
4747
ADContext &context;
@@ -368,9 +368,9 @@ class JVPEmitter final
368368
void prepareForDifferentialGeneration();
369369

370370
public:
371-
explicit JVPEmitter(ADContext &context, SILFunction *original,
372-
SILDifferentiabilityWitness *witness, SILFunction *jvp,
373-
DifferentiationInvoker invoker);
371+
explicit JVPCloner(ADContext &context, SILFunction *original,
372+
SILDifferentiabilityWitness *witness, SILFunction *jvp,
373+
DifferentiationInvoker invoker);
374374

375375
static SILFunction *
376376
createEmptyDifferential(ADContext &context,
@@ -411,4 +411,4 @@ class JVPEmitter final
411411
} // end namespace autodiff
412412
} // end namespace swift
413413

414-
#endif // SWIFT_SILOPTIMIZER_UTILS_DIFFERENTIATION_VJPEMITTER_H
414+
#endif // SWIFT_SILOPTIMIZER_UTILS_DIFFERENTIATION_JVPCLONER_H

0 commit comments

Comments
 (0)