Skip to content

Resolve conflicts with the main branch #2222

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 115 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
e7ec8c3
SILGen: Caller-side codegen for invoking foreign async functions
jckarter Oct 30, 2020
4b33f26
Reserve a mangling for predefined completion handler impls in the run…
jckarter Nov 2, 2020
d9a1483
Add a simple AccessUseDefChainCloner.
atrick Jul 9, 2020
d86099f
Use AccessPath in LICM.
atrick Jul 7, 2020
0ff82ca
Sema: Check conformance availability when ranking solutions
slavapestov Nov 10, 2020
368dc0f
SILGen: Generate bodies for completion handler block impls
jckarter Nov 11, 2020
b7d2633
[android] Add support for x86_64 arch
finagolfin Nov 10, 2020
adacecb
[NFC] Split Make-Style Dependency Emission from FrontendTool
CodaFi Nov 11, 2020
17143cb
[NFC] Split ModuleTrace Infrastructure out of FrontendTool
CodaFi Nov 11, 2020
13c97a8
[NFC] Downgrade CompilerInvocation to FrontendOptions
CodaFi Nov 11, 2020
e9a80de
Prevent superfluous diagnostic-database execution
bnbarham Nov 12, 2020
d57d9fd
Add features file describing new available flags
bnbarham Nov 12, 2020
0ca29b5
Merge pull request #34525 from jckarter/foreign-async-silgen
jckarter Nov 12, 2020
fcd70cb
[Async CC] Add execution test for thin_to_thick.
nate-chandler Nov 12, 2020
0484f3a
[NFC] Reuse AST/ClangTypeConverter in IRGen.
varungandhi-apple Oct 30, 2020
19e6bee
[NFC] Use the Correct const-Qualification in Dependency Code
CodaFi Nov 11, 2020
fdd1821
Merge pull request #34705 from nate-chandler/concurrency/irgen/test-t…
nate-chandler Nov 12, 2020
7abf272
Merge pull request #34661 from buttaface/droid
CodaFi Nov 12, 2020
98f5e3f
[Async CC] Add execution test for convert_function.
nate-chandler Nov 12, 2020
3343a6a
Merge pull request #34671 from slavapestov/conformance-availability-s…
slavapestov Nov 12, 2020
3b051a2
Convert tabs to spaces in test/Sema/conformance_availability.swift
slavapestov Nov 12, 2020
07fafa3
[NFC] Add a TypeBase Conversion Constructor to NeverNullType
CodaFi Nov 12, 2020
4a8fdb8
Push NeverNullType Into The Leaves of Type Resolution
CodaFi Nov 12, 2020
c7cce10
Add an Assert To Make Sure the SIL Parser Emits Diagnostics
CodaFi Nov 12, 2020
517bcc4
[AutoDiff] Fix differentiation transform crashers in library evolutio…
rxwei Nov 12, 2020
e89b534
Merge pull request #34514 from varungandhi-apple/vg-irgen-remove-old-…
swift-ci Nov 12, 2020
437765e
LICM: split loads that are wider than the loop-stored value.
atrick Sep 23, 2020
92d2c23
[Tests] Fix and refactor skip-function-bodies.swift
xymus Nov 12, 2020
02c1343
[Sema] Add option to skip non-inlinable functions without types
xymus Nov 6, 2020
7b3130b
Merge pull request #34694 from CodaFi/frontend-loader
CodaFi Nov 12, 2020
a89f8e0
[NFC] Drop Unused Includes from FrontendTool
CodaFi Nov 12, 2020
76d25e7
[NFC] Fixup InputFile Convenience Getters
CodaFi Nov 12, 2020
c78e625
Merge pull request #34707 from nate-chandler/concurrency/irgen/test-c…
nate-chandler Nov 12, 2020
b4b8778
Fixup getOverlayModule
CodaFi Nov 13, 2020
40b3843
Merge pull request #34701 from CodaFi/parse-down
CodaFi Nov 13, 2020
6db8520
SIL: Abstraction pattern support for multiple foreign async returns.
jckarter Nov 12, 2020
bb1b479
Merge pull request #34716 from CodaFi/front-end-back
CodaFi Nov 13, 2020
4156382
[NFC] Corrected typo.
nate-chandler Oct 28, 2020
db8183d
[IRGen] Added LinkEntities for AsyncFunctionPointer.
nate-chandler Nov 11, 2020
ed9efa2
[TBDGen] Add async function pointers.
nate-chandler Nov 10, 2020
2d21932
[Async CC] Add constant "pointer" for async func.
nate-chandler Nov 11, 2020
660f74b
[Async CC] Add AsyncFunctionPointer to vtable.
nate-chandler Oct 28, 2020
b676a98
[Async CC] Add AsyncFunctionPointer to wtable.
nate-chandler Oct 29, 2020
6962874
To Revert: [Async CC] Disable execution tests on arm64e.
nate-chandler Nov 13, 2020
273ef12
Merge pull request #34714 from slavapestov/fix-tabs-in-conformance-av…
slavapestov Nov 13, 2020
f9c2ad6
Merge pull request #34710 from CodaFi/never-never-land
CodaFi Nov 13, 2020
b72b0c3
Merge pull request #34612 from xymus/dont-skip-nested-types
xymus Nov 13, 2020
cafd293
Merge pull request #34697 from bnbarham/add-feature-file
bnbarham Nov 13, 2020
f84f48e
[silgen] Make SwitchCaseFullExpr use an ArgumentScope instead of just…
gottesmm Nov 13, 2020
4409f14
Merge pull request #33987 from atrick/opt-licm-combined-ldst
atrick Nov 13, 2020
7f6d866
stdlib: add availability attributes to the COW debug checking functions.
eeckstein Nov 13, 2020
9304925
Update CHANGELOG.md: "Swift Next" -> "Swift 5.4" (#34720)
benrimmington Nov 13, 2020
2335eb8
Merge pull request #34721 from eeckstein/fix-cow-availability
swift-ci Nov 13, 2020
5a3c5c9
Merge branch 'nates_async_func_ptr_change_6962874' into main
aschwaighofer Nov 13, 2020
96d6bde
[SIL] NFC: fix extra semi warning
davezarzycki Nov 13, 2020
32ecd35
Change swift_task_create_f to swift_task_create now that explosions a…
aschwaighofer Nov 12, 2020
a8d9637
SIL: repair the Windows build after #33987
compnerd Nov 13, 2020
2e6c120
Merge pull request #34724 from davezarzycki/pr34724
swift-ci Nov 13, 2020
3261e2e
Merge pull request #34589 from nate-chandler/concurrency/irgen/functi…
nate-chandler Nov 13, 2020
ee8480f
[Stdlib] Fix swift_setAtWritableKeyPath to check for ReferenceWritabl…
mikeash Nov 13, 2020
73d5f01
Merge pull request #34719 from gottesmm/pr-d375facecff3f140fbe637c64f…
gottesmm Nov 13, 2020
1940f2d
Merge pull request #34717 from CodaFi/the-matrix-reloaded
CodaFi Nov 13, 2020
ed5a759
Change swift_task_create_f to swift_task_create now that explosions a…
aschwaighofer Nov 12, 2020
74419d0
Lower asynchronous functions to LLVM async coroutine intrinsics
aschwaighofer Nov 6, 2020
2271d4d
Use taskAlloc for dynamic allocas
aschwaighofer Nov 11, 2020
193a3d5
Temporarily add runAsync to run a task synchronously in the current t…
aschwaighofer Nov 13, 2020
1e9976e
Fix tests
aschwaighofer Nov 13, 2020
3a0ffbb
Merge pull request #34727 from compnerd/33987
swift-ci Nov 13, 2020
3ecc3d4
Merge pull request #34698 from bnbarham/prevent-diagnostic-database
xedin Nov 13, 2020
a6b8da7
[nfc] Remove unneeded void cast of clangDC.
zoecarver Nov 13, 2020
bcf8733
[cxx-interop] Don't import C++ objects that we can't destroy.
zoecarver Nov 9, 2020
2442ba2
Merge pull request #34729 from mikeash/referencewritablekeypath-dynam…
mikeash Nov 13, 2020
a78e82c
Merge pull request #34725 from aschwaighofer/fix_irgen_swift_task_create
aschwaighofer Nov 13, 2020
222d2fe
[cxx-interop] Support nested C++ record types.
zoecarver Nov 13, 2020
e55d6a8
Use dedicated module cache to build xctest, llbuild and Foundation (#…
edymtt Nov 13, 2020
c7f4f07
Merge pull request #34713 from jckarter/foreign-async-multi-return-ab…
jckarter Nov 13, 2020
e51575b
Silence an assert
aschwaighofer Nov 13, 2020
11723cc
[Async CC] Never map to native explosions.
nate-chandler Nov 14, 2020
f0fc662
Merge pull request #34731 from aschwaighofer/irgen_async_coroutine_sp…
aschwaighofer Nov 14, 2020
ef5a790
Merge pull request #34735 from zoecarver/cxx/cleanup/void-clang
swift-ci Nov 14, 2020
b527bb5
Merge pull request #34730 from zoecarver/cxx/fix/nested-structs
zoecarver Nov 14, 2020
d048e05
Merge pull request #34649 from zoecarver/cxx/no-import-no-destructor
zoecarver Nov 14, 2020
9116af9
Merge pull request #34743 from nate-chandler/concurrency/irgen/rdar71…
nate-chandler Nov 14, 2020
3a80605
[Test] Use runAsync to invoke async cc test.
nate-chandler Nov 14, 2020
0462e35
[Test] Use runAsync to invoke async cc test.
nate-chandler Nov 14, 2020
e276472
[AsyncCC] Resolve metadata from class instances.
nate-chandler Nov 13, 2020
85d003e
[Concurrency] Implement basic runtime support for task futures.
DougGregor Nov 12, 2020
aa76672
[Future] Add a test to make sure we're handling object lifetimes prop…
DougGregor Nov 13, 2020
0a07f18
[Futures] Fix up some comments to address some comments.
DougGregor Nov 13, 2020
4b92467
[Concurrency] Use a single atomic for future wait queue.
DougGregor Nov 13, 2020
0ae6c63
[Concurrency] Use SchedulerPrivate for the "next waiting task" link.
DougGregor Nov 13, 2020
91360f0
[Concurrency] Turn "simple task" into just "task".
DougGregor Nov 13, 2020
5538aaf
[Concurrency] Inline AsyncTask::FutureFragment::fragmentSize.
DougGregor Nov 13, 2020
19d9e0f
[Concurrency] Clarify/fix error object handling in futures.
DougGregor Nov 13, 2020
7f3db7f
[Concurrency] Have future functions write their results directly.
DougGregor Nov 13, 2020
c0fd27f
[Concurrency] Minor cleanups to futures.
DougGregor Nov 13, 2020
ab932db
[Concurrency] Remove an unnecessary 'const' from a non-static data me…
DougGregor Nov 14, 2020
4fb5f05
[Concurrency] More cleanups for futures
DougGregor Nov 14, 2020
ede5aa3
Remove test that depends on Swift.Int metadata, which isn't around.
DougGregor Nov 14, 2020
357988e
[Async CC] Unroll workaround where @main was async.
nate-chandler Nov 14, 2020
b72558e
Merge pull request #34748 from nate-chandler/concurrency/irgen/call-r…
atrick Nov 14, 2020
5dd0bce
Merge pull request #34703 from DougGregor/concurrency-task-future
DougGregor Nov 15, 2020
0d8559d
[Test] Disable partial_apply_forwarder.sil for arm64e.
nate-chandler Nov 15, 2020
60b052c
Merge pull request #34752 from nate-chandler/concurrency/irgen/rdar71…
swift-ci Nov 15, 2020
390dd28
Merge pull request #34740 from nate-chandler/concurrency/irgen/rdar71…
DougGregor Nov 15, 2020
c2b3be4
Merge pull request #34750 from nate-chandler/concurrency/irgen/rdar70…
DougGregor Nov 15, 2020
d2de176
[sil][value-lifetime] Add ValueLifetimeAnalysis::FrontierImpl = Small…
gottesmm Nov 15, 2020
a718e7d
[ownership] Centralize the concept of isReborrow on BorrowingOperand.
gottesmm Nov 16, 2020
7718bd1
[value-lifetime] Cleanup constructors.
gottesmm Nov 16, 2020
9e0b1d1
[ownership] Make SILUndef always have ValueOwnershipKind::None.
gottesmm Nov 16, 2020
c6a368d
Merge pull request #34756 from gottesmm/pr-506a6eb10f358603d6870a894a…
gottesmm Nov 16, 2020
36ba170
Merge pull request #34754 from gottesmm/pr-3155aa58f6bce5cf4eaa8382b5…
gottesmm Nov 16, 2020
4f37a1f
Merge pull request #34753 from gottesmm/pr-385ea717e6854219cf3586659f…
gottesmm Nov 16, 2020
b78a649
Merge pull request #34755 from gottesmm/pr-c948d27bcce9be4feb87ece1fc…
gottesmm Nov 16, 2020
9a6ed2f
Merge branch 'main' of github.com:apple/swift into maxd/main-merge
MaxDesiatov Nov 16, 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
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CHANGELOG

| Version | Released | Toolchain |
| :--------------------- | :--------- | :---------- |
| [Swift 5.4](#swift-54) | | |
| [Swift 5.3](#swift-53) | 2020-09-16 | Xcode 12.0 |
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
Expand All @@ -24,8 +25,8 @@ CHANGELOG

</details>

Swift Next
----------
Swift 5.4
---------

* [SR-10069][]:

Expand Down
3 changes: 2 additions & 1 deletion docs/ABI/Mangling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ types where the metadata itself has unknown layout.)
global ::= entity // some identifiable thing
global ::= from-type to-type generic-signature? 'TR' // reabstraction thunk
global ::= from-type to-type generic-signature? 'TR' // reabstraction thunk
global ::= impl-function-type 'Tz' // objc-to-swift-async completion handler block implementation
global ::= impl-function-type type 'Tz' // objc-to-swift-async completion handler block implementation
global ::= impl-function-type type 'TZ' // objc-to-swift-async completion handler block implementation (predefined by runtime)
global ::= from-type to-type self-type generic-signature? 'Ty' // reabstraction thunk with dynamic 'Self' capture
global ::= from-type to-type generic-signature? 'Tr' // obsolete mangling for reabstraction thunk
global ::= entity generic-signature? type type* 'TK' // key path getter
Expand Down
4 changes: 2 additions & 2 deletions include/swift/ABI/MetadataKind.def
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ METADATAKIND(HeapGenericLocalVariable,
METADATAKIND(ErrorObject,
1 | MetadataKindIsNonType | MetadataKindIsRuntimePrivate)

/// A heap-allocated simple task.
METADATAKIND(SimpleTask,
/// A heap-allocated task.
METADATAKIND(Task,
2 | MetadataKindIsNonType | MetadataKindIsRuntimePrivate)

// getEnumeratedMetadataKind assumes that all the enumerated values here
Expand Down
153 changes: 150 additions & 3 deletions include/swift/ABI/Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "swift/Basic/RelativePointer.h"
#include "swift/ABI/HeapObject.h"
#include "swift/ABI/Metadata.h"
#include "swift/ABI/MetadataValues.h"
#include "swift/Runtime/Config.h"
#include "swift/Basic/STLExtras.h"
Expand All @@ -29,6 +30,8 @@ class AsyncTask;
class AsyncContext;
class Executor;
class Job;
struct OpaqueValue;
struct SwiftError;
class TaskStatusRecord;

/// An ExecutorRef isn't necessarily just a pointer to an executor
Expand Down Expand Up @@ -86,6 +89,13 @@ class AsyncFunctionPointer {

/// A schedulable job.
class alignas(2 * alignof(void*)) Job {
protected:
// Indices into SchedulerPrivate, for use by the runtime.
enum {
/// The next waiting task link, an AsyncTask that is waiting on a future.
NextWaitingTaskIndex = 0,
};

public:
// Reserved for the use of the scheduler.
void *SchedulerPrivate[2];
Expand Down Expand Up @@ -230,19 +240,142 @@ class AsyncTask : public HeapObject, public Job {
}
};

bool isFuture() const { return Flags.task_isFuture(); }

bool hasChildFragment() const { return Flags.task_isChildTask(); }
ChildFragment *childFragment() {
assert(hasChildFragment());
return reinterpret_cast<ChildFragment*>(this + 1);
}

// TODO: Future fragment
class FutureFragment {
public:
/// Describes the status of the future.
///
/// Futures always begin in the "Executing" state, and will always
/// make a single state change to either Success or Error.
enum class Status : uintptr_t {
/// The future is executing or ready to execute. The storage
/// is not accessible.
Executing = 0,

/// The future has completed with result (of type \c resultType).
Success,

/// The future has completed by throwing an error (an \c Error
/// existential).
Error,
};

/// An item within the wait queue, which includes the status and the
/// head of the list of tasks.
struct WaitQueueItem {
/// Mask used for the low status bits in a wait queue item.
static const uintptr_t statusMask = 0x03;

uintptr_t storage;

Status getStatus() const {
return static_cast<Status>(storage & statusMask);
}

AsyncTask *getTask() const {
return reinterpret_cast<AsyncTask *>(storage & ~statusMask);
}

static WaitQueueItem get(Status status, AsyncTask *task) {
return WaitQueueItem{
reinterpret_cast<uintptr_t>(task) | static_cast<uintptr_t>(status)};
}
};

private:
/// Queue containing all of the tasks that are waiting in `get()`.
///
/// The low bits contain the status, the rest of the pointer is the
/// AsyncTask.
std::atomic<WaitQueueItem> waitQueue;

/// The type of the result that will be produced by the future.
const Metadata *resultType;

// Trailing storage for the result itself. The storage will be uninitialized,
// contain an instance of \c resultType, or contaon an an \c Error.

friend class AsyncTask;

public:
explicit FutureFragment(const Metadata *resultType)
: waitQueue(WaitQueueItem::get(Status::Executing, nullptr)),
resultType(resultType) { }

/// Destroy the storage associated with the future.
void destroy();

/// Retrieve a pointer to the storage of result.
OpaqueValue *getStoragePtr() {
return reinterpret_cast<OpaqueValue *>(
reinterpret_cast<char *>(this) + storageOffset(resultType));
}

/// Retrieve the error.
SwiftError *&getError() {
return *reinterpret_cast<SwiftError **>(
reinterpret_cast<char *>(this) + storageOffset(resultType));
}

/// Compute the offset of the storage from the base of the future
/// fragment.
static size_t storageOffset(const Metadata *resultType) {
size_t offset = sizeof(FutureFragment);
size_t alignment =
std::max(resultType->vw_alignment(), alignof(SwiftError *));
return (offset + alignment - 1) & ~(alignment - 1);
}

/// Determine the size of the future fragment given a particular future
/// result type.
static size_t fragmentSize(const Metadata *resultType) {
return storageOffset(resultType) +
std::max(resultType->vw_size(), sizeof(SwiftError *));
}
};

bool isFuture() const { return Flags.task_isFuture(); }

FutureFragment *futureFragment() {
assert(isFuture());
if (hasChildFragment()) {
return reinterpret_cast<FutureFragment *>(
reinterpret_cast<ChildFragment*>(this + 1) + 1);
}

return reinterpret_cast<FutureFragment *>(this + 1);
}

/// Wait for this future to complete.
///
/// \returns the status of the future. If this result is
/// \c Executing, then \c waitingTask has been added to the
/// wait queue and will be scheduled when the future completes. Otherwise,
/// the future has completed and can be queried.
FutureFragment::Status waitFuture(AsyncTask *waitingTask);

/// Complete this future.
///
/// Upon completion, any waiting tasks will be scheduled on the given
/// executor.
void completeFuture(AsyncContext *context, ExecutorRef executor);

static bool classof(const Job *job) {
return job->isAsyncTask();
}

private:
/// Access the next waiting task, which establishes a singly linked list of
/// tasks that are waiting on a future.
AsyncTask *&getNextWaitingTask() {
return reinterpret_cast<AsyncTask *&>(
SchedulerPrivate[NextWaitingTaskIndex]);
}
};

// The compiler will eventually assume these.
Expand Down Expand Up @@ -327,6 +460,20 @@ class YieldingAsyncContext : public AsyncContext {
}
};

/// An asynchronous context within a task that describes a general "Future".
/// task.
///
/// This type matches the ABI of a function `<T> () async throws -> T`, which
/// is the type used by `Task.runDetached` and `Task.group.add` to create
/// futures.
class FutureAsyncContext : public AsyncContext {
public:
SwiftError *errorResult = nullptr;
OpaqueValue *indirectResult;

using AsyncContext::AsyncContext;
};

} // end namespace swift

#endif
15 changes: 15 additions & 0 deletions include/swift/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,14 @@ class ASTContext final {
/// if applicable.
const Decl *getSwiftDeclForExportedClangDecl(const clang::Decl *decl);

/// General conversion method from Swift types -> Clang types.
///
/// HACK: This method is only intended to be called from a specific place in
/// IRGen. For converting function types, strongly prefer using one of the
/// other methods instead, instead of manually iterating over parameters
/// and results.
const clang::Type *getClangTypeForIRGen(Type ty);

/// Determine whether the given Swift type is representable in a
/// given foreign language.
ForeignRepresentationInfo
Expand Down Expand Up @@ -901,6 +909,13 @@ class ASTContext final {
/// \returns The requested module, or NULL if the module cannot be found.
ModuleDecl *getModule(ImportPath::Module ModulePath);

/// Attempts to load the matching overlay module for the given clang
/// module into this ASTContext.
///
/// \returns The Swift overlay module corresponding to the given Clang module,
/// or NULL if the overlay module cannot be found.
ModuleDecl *getOverlayModule(const FileUnit *ClangModule);

ModuleDecl *getModuleByName(StringRef ModuleName);

ModuleDecl *getModuleByIdentifier(Identifier ModuleID);
Expand Down
9 changes: 9 additions & 0 deletions include/swift/AST/ASTMangler.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ class ASTMangler : public Mangler {
Type SelfType,
ModuleDecl *Module);

/// Mangle a completion handler block implementation function, used for importing ObjC
/// APIs as async.
///
/// - If `predefined` is true, this mangles the symbol name of the completion handler
/// predefined in the Swift runtime for the given type signature.
std::string mangleObjCAsyncCompletionHandlerImpl(CanSILFunctionType BlockType,
CanType ResultType,
bool predefined);

/// Mangle the derivative function (JVP/VJP) for the given:
/// - Mangled original function name.
/// - Derivative function kind.
Expand Down
19 changes: 17 additions & 2 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class alignas(1 << DeclAlignInBits) Decl {
SWIFT_INLINE_BITFIELD(SubscriptDecl, VarDecl, 2,
StaticSpelling : 2
);
SWIFT_INLINE_BITFIELD(AbstractFunctionDecl, ValueDecl, 3+8+1+1+1+1+1+1,
SWIFT_INLINE_BITFIELD(AbstractFunctionDecl, ValueDecl, 3+8+1+1+1+1+1+1+1,
/// \see AbstractFunctionDecl::BodyKind
BodyKind : 3,

Expand All @@ -415,7 +415,11 @@ class alignas(1 << DeclAlignInBits) Decl {
Synthesized : 1,

/// Whether this member's body consists of a single expression.
HasSingleExpressionBody : 1
HasSingleExpressionBody : 1,

/// Whether peeking into this function detected nested type declarations.
/// This is set when skipping over the decl at parsing.
HasNestedTypeDeclarations : 1
);

SWIFT_INLINE_BITFIELD(FuncDecl, AbstractFunctionDecl, 1+1+2+1+1+2+1,
Expand Down Expand Up @@ -5544,6 +5548,7 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
Bits.AbstractFunctionDecl.Throws = Throws;
Bits.AbstractFunctionDecl.Synthesized = false;
Bits.AbstractFunctionDecl.HasSingleExpressionBody = false;
Bits.AbstractFunctionDecl.HasNestedTypeDeclarations = false;
}

void setBodyKind(BodyKind K) {
Expand Down Expand Up @@ -5690,6 +5695,16 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
setBody(S, BodyKind::Parsed);
}

/// Was there a nested type declaration detected when parsing this
/// function was skipped?
bool hasNestedTypeDeclarations() const {
return Bits.AbstractFunctionDecl.HasNestedTypeDeclarations;
}

void setHasNestedTypeDeclarations(bool value) {
Bits.AbstractFunctionDecl.HasNestedTypeDeclarations = value;
}

/// Note that parsing for the body was delayed.
///
/// The function should return the body statement and a flag indicating
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/FineGrainedDependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class BiIndexedTwoStageMap {
///
/// \Note The returned graph should not be escaped from the callback.
bool withReferenceDependencies(
llvm::PointerUnion<ModuleDecl *, SourceFile *> MSF,
llvm::PointerUnion<const ModuleDecl *, const SourceFile *> MSF,
const DependencyTracker &depTracker, StringRef outputPath,
bool alsoEmitDotFile, llvm::function_ref<bool(SourceFileDepGraph &&)>);

Expand Down
3 changes: 3 additions & 0 deletions include/swift/Basic/FunctionBodySkipping.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ enum class FunctionBodySkipping : uint8_t {
None,
/// Only non-inlinable function bodies should be skipped.
NonInlinable,
/// Only non-inlinable functions bodies without type definitions should
/// be skipped.
NonInlinableWithoutTypes,
/// All function bodies should be skipped, where not otherwise required
/// for type inference.
All
Expand Down
1 change: 1 addition & 0 deletions include/swift/Demangling/DemangleNodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ NODE(NominalTypeDescriptor)
NODE(NonObjCAttribute)
NODE(Number)
NODE(ObjCAsyncCompletionHandlerImpl)
NODE(PredefinedObjCAsyncCompletionHandlerImpl)
NODE(ObjCAttribute)
NODE(ObjCBlock)
NODE(EscapingObjCBlock)
Expand Down
8 changes: 4 additions & 4 deletions include/swift/Frontend/InputFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,17 @@ class InputFile final {
// FrontendInputsAndOutputs. They merely make the call sites
// a bit shorter. Add more forwarding methods as needed.

std::string dependenciesFilePath() const {
StringRef getDependenciesFilePath() const {
return getPrimarySpecificPaths().SupplementaryOutputs.DependenciesFilePath;
}
std::string loadedModuleTracePath() const {
StringRef getLoadedModuleTracePath() const {
return getPrimarySpecificPaths().SupplementaryOutputs.LoadedModuleTracePath;
}
std::string serializedDiagnosticsPath() const {
StringRef getSerializedDiagnosticsPath() const {
return getPrimarySpecificPaths().SupplementaryOutputs
.SerializedDiagnosticsPath;
}
std::string fixItsOutputPath() const {
StringRef getFixItsOutputPath() const {
return getPrimarySpecificPaths().SupplementaryOutputs.FixItsOutputPath;
}
};
Expand Down
Loading