Skip to content

Get the libdispatch tests working again #2

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

Closed
wants to merge 92 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
81953ef
[IRGen][DebugInfo] Split method declaration and definition.
dianqk Aug 6, 2023
72cadec
[CodeCompletion] Split result delivery into a result colleciton and c…
ahoppen Aug 22, 2023
a1bfb51
[CodeCompletion] Migrate labeled trailing closure completions to solv…
ahoppen Aug 23, 2023
48ce1b3
[CodeCompletion] Delete `LabeledTrailingClosure` completion kind
ahoppen Aug 23, 2023
9ecb17a
[Option][Caching] Clean up option caching exclusion list
cachemeifyoucan Aug 25, 2023
537f318
[SourceKit] RPATH 'lib/swift/host' should be added without BOOTSTRAPPING
rintaro Sep 1, 2023
0300139
[Sema][Diagnostics] Improving diagnostics for function type coerce fa…
LucianoPAlmeida Sep 3, 2023
56f390d
[CSBindings] Delay default binding production until inference is exha…
xedin Sep 4, 2023
f93f7ad
[RemoteMirror] Speed up Remote Mirror significantly by caching two ad…
bentroller Sep 1, 2023
8a2aeb9
Merge pull request #68273 from rintaro/sourcekit-host-rpath
rintaro Sep 5, 2023
1b8e20e
Fix IRGenModule::getMaximalTypeExpansionContext to use the proper ass…
aschwaighofer Sep 5, 2023
cc507fc
[CS] NFC: Rename VarRefCollector -> TypeVarRefCollector
hamishknight Sep 5, 2023
5851c59
[CS] NFC: Introduce a convenience `createConjunction`
hamishknight Sep 5, 2023
0760290
[CS] Connect conjunctions with ReturnStmts to return type
hamishknight Sep 5, 2023
4339017
[tests] Adding test for diagnostics for function type coerce failure
LucianoPAlmeida Sep 3, 2023
50130b0
[NFC] Adjusting a couple of comments for clarity
LucianoPAlmeida Sep 5, 2023
118fd86
Ensure we can fold apply of a `differentiable_function_inst`. Also fi…
asl Sep 5, 2023
ea2465d
[Sema] Report uses of package import without a package name
xymus Sep 1, 2023
7287ad0
[Diagnostics] Let the swift-syntax formatter handle multiple files it…
DougGregor Sep 6, 2023
85016b5
Merge pull request #68255 from btroller/btroller-rdar111248508-cache-…
btroller Sep 6, 2023
fd06bd8
AST: Allow the extended type of an extension to refer to be a tuple type
slavapestov Aug 30, 2023
d5cdfb2
AST: Clone generic parameter list of tuple extension from extended ty…
slavapestov Aug 30, 2023
653c00c
Sema: More tuple conformance diagnostics
slavapestov Sep 1, 2023
4b8bd6a
Sema: Fix diagnoseConformanceImpliedByConditionalConformance() for tu…
slavapestov Sep 1, 2023
e773f68
Sema: Diagnose nested type in tuple extension
slavapestov Sep 1, 2023
b2d3184
Sema: Requirement inference from generic typealias in tuple extension
slavapestov Sep 1, 2023
bd5a031
Sema: Rename misleading sameTypeReqs to extraReqs
slavapestov Sep 1, 2023
a8d865a
Sema: Refactor CheckTypeWitnessResult type used in conformance checking
slavapestov Sep 5, 2023
1ec6c35
Sema: Simplify TypeChecker::isPassThroughTypealias()
slavapestov Sep 5, 2023
9c3f2aa
Merge pull request #68301 from LucianoPAlmeida/coerce-function
LucianoPAlmeida Sep 6, 2023
43b6117
Merge pull request #68331 from hamishknight/linked-in
hamishknight Sep 6, 2023
c06fe98
Merge pull request #68330 from aschwaighofer/private_opaque_irgen_typ…
aschwaighofer Sep 6, 2023
d48f65f
[AST] fix typo in PluginRegistry.h
eltociear Sep 6, 2023
2c3c3c1
Merge pull request #67077 from DianQK/type-decl-disubprogram
felipepiovezan Sep 6, 2023
0f53e7d
[SwiftScan][Caching] Add support for plugin CAS for caching
cachemeifyoucan Aug 15, 2023
0dd8f4c
AST: Introduce abstraction for extension/type decl inheritance clauses.
tshortli Sep 6, 2023
c884632
AST: Consolidate inherited type resolution.
tshortli Sep 6, 2023
01ecd81
AST: Introduce conveniences for inheritance clause source locations.
tshortli Sep 6, 2023
52cea42
[embedded] 🚀 add `Embedded` expiremental feature.
zoecarver Aug 30, 2023
349d37a
[embedded] Start fencing parts of IRGen that are not compatible with …
zoecarver Aug 30, 2023
4878991
[embedded] Add initial tests; fix two issues in IRGen.
zoecarver Aug 30, 2023
9f75a26
[embedded] Error if embedded Swift enables library evolution.
zoecarver Aug 30, 2023
48513f3
[embedded] Introduce `isGenericFunction` and `addAllNonGenericFunctio…
zoecarver Sep 6, 2023
2d61de8
[embedded] Introduce `RuntimeEffect::Existential` and guard diagnosti…
zoecarver Sep 6, 2023
09edae3
[embedded] Use consistent target to make IR matching easier.
zoecarver Sep 6, 2023
5203053
[embedded] Don't add functions twice; fix a typo.
zoecarver Sep 6, 2023
3dbad6e
Add a runtime function to check type creation
Azoy Sep 6, 2023
00d4879
build: adjust the build to support non-Apple environments
compnerd Sep 1, 2023
acc6c10
Merge pull request #68075 from ahoppen/ahoppen/labeled-trailing-closu…
ahoppen Sep 6, 2023
5aa725d
[CodeCompletion] Delete dead code
ahoppen Aug 23, 2023
211171e
[CodeCompletion] Delete ExprContextAnalyzer
ahoppen Aug 23, 2023
9c2400b
[CodeCompletion] Delete SanitizeExpr
ahoppen Aug 23, 2023
bdc6a27
Merge pull request #68343 from eltociear/patch-44
egorzhdan Sep 6, 2023
5eebfc0
Merge pull request #68338 from tshortli/inherited-types-refactor
tshortli Sep 6, 2023
afc2bab
Merge pull request #67942 from cachemeifyoucan/eng/PR-swift-scan-plug…
cachemeifyoucan Sep 6, 2023
125962c
Merge pull request #68336 from xymus/package-import-require-package
xymus Sep 6, 2023
26d223a
[embedded] Mark test as unsupported on Windows.
zoecarver Sep 6, 2023
f540753
Merge pull request #68164 from cachemeifyoucan/eng/PR-swift-caching-o…
cachemeifyoucan Sep 6, 2023
3780ccc
[swift-syntax] Don’t pass `--filecheck-exec` to swift-syntax’s build …
ahoppen Sep 6, 2023
9583f9c
[Gardening] Deleted unreachable fatalError.
nate-chandler Sep 7, 2023
74e22dc
Merge pull request #68244 from zoecarver/embedded-swift
zoecarver Sep 7, 2023
2349a4f
Update LibcShims.cpp
compnerd Sep 7, 2023
c8e36f6
build: fix the build of the toolchain
compnerd Sep 7, 2023
25eb997
[embedded] Add basics of module serialization, importing and validati…
kubamracek Sep 2, 2023
80187e8
Expect caller heap pack and rename
Azoy Sep 6, 2023
1a72ca1
Sema: Enforce coherence condition on type witnesses of tuple conformance
slavapestov Sep 5, 2023
7dacc5e
Sema: adoptee->getAnyNominal() => dc->getSelfNominalTypeDecl()
slavapestov Sep 6, 2023
79ca1eb
Add ForwardingOperation::getSingleForwardingOperand api
meg-gupta Sep 7, 2023
3b212ce
Merge pull request #68295 from kubamracek/embedded-modules
swift-ci Sep 7, 2023
bacfdbd
Add ForwardingOperation::visitForwardedValues api
meg-gupta Sep 7, 2023
11f909f
Merge pull request #68365 from nate-chandler/gardening/20230906/1
nate-chandler Sep 7, 2023
2bb3212
Add ForwardingOperation::visitForwardedValues api
meg-gupta Sep 7, 2023
4feae67
[SILGenCleanup] Added assert.
nate-chandler Sep 7, 2023
7713eef
[MoveValueChecker] Complete lifetimes first.
nate-chandler Sep 6, 2023
d2e7b05
Merge pull request #68367 from apple/compnerd/exiting
compnerd Sep 7, 2023
1375ce6
Merge pull request #68359 from Azoy/packs-pack-packs
Azoy Sep 7, 2023
b6764c3
Merge pull request #68258 from compnerd/how-do-you-do
compnerd Sep 7, 2023
596da31
[SE-0407] Provide member macros with information about "missing" conf…
DougGregor Aug 4, 2023
973a506
Merge pull request #68282 from slavapestov/sema-tuple-conformances
slavapestov Sep 7, 2023
9876411
Merge pull request #68364 from ahoppen/ahoppen/no-more-swiftsyntax-lit
ahoppen Sep 7, 2023
68d146e
Merge pull request #68317 from xedin/delay-default-inference
xedin Sep 7, 2023
93c42f7
Merge pull request #68370 from meg-gupta/fwdops
swift-ci Sep 7, 2023
4cb8133
swift-plugin-server: remove standard headers
compnerd Sep 6, 2023
0e1cdb5
Merge pull request #68080 from ahoppen/ahoppen/delete-sanitize-expr
ahoppen Sep 7, 2023
f8f8d24
Merge pull request #67758 from DougGregor/member-macro-conformances
DougGregor Sep 7, 2023
57e56a0
Merge pull request #68342 from nate-chandler/gh68328
nate-chandler Sep 7, 2023
881d6f9
Merge pull request #68366 from compnerd/cut-the-wire
compnerd Sep 7, 2023
7c72e7d
update_checkout.py: fix inconsistent options help capitalization (#68…
MaxDesiatov Sep 7, 2023
242c336
Merge pull request #68377 from rintaro/macros-pluginserver-nostdlib
rintaro Sep 7, 2023
b7c2cb8
Merge pull request #68379 from DougGregor/swift-syntax-multiple-files
DougGregor Sep 7, 2023
6e87f15
[build] Remove intermediate pipeline so that we can guarantee that we…
gottesmm May 10, 2023
6897516
[test] Add new libdispatch -vfsoverlay flag for linux, as in apple/sw…
finagolfin Aug 26, 2023
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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
> **Note**\
> This is in reverse chronological order, so newer entries are added to the top.

## Swift 5.9.2

* [SE-0407][]:

Member macros can specify a list of protocols via the `conformances` argument to the macro role. The macro implementation will be provided with those protocols that are listed but have not already been implemented by the type to which the member macro is attached, in the same manner as extension macros.

```swift
@attached(member, conformances: Decodable, Encodable, names: named(init(from:), encode(to:)))
@attached(extension, conformances: Decodable, Encodable, names: named(init(from:), encode(to:)))
macro Codable() = #externalMacro(module: "MyMacros", type: "CodableMacro")
```

## Swift 5.9

* [SE-0382][], [SE-0389][], [SE-0394][], [SE-0397][]:
Expand Down Expand Up @@ -9833,6 +9845,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
[SE-0389]: https://github.com/apple/swift-evolution/blob/main/proposals/0389-attached-macros.md
[SE-0394]: https://github.com/apple/swift-evolution/blob/main/proposals/0394-swiftpm-expression-macros.md
[SE-0397]: https://github.com/apple/swift-evolution/blob/main/proposals/0397-freestanding-declaration-macros.md
[SE-0407]: https://github.com/apple/swift-evolution/blob/main/proposals/0407-member-macro-conformances.md
[#64927]: <https://github.com/apple/swift/issues/64927>
[#42697]: <https://github.com/apple/swift/issues/42697>
[#42728]: <https://github.com/apple/swift/issues/42728>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ let mandatoryPerformanceOptimizations = ModulePass(name: "mandatory-performance-
(moduleContext: ModulePassContext) in

var worklist = FunctionWorklist()
worklist.addAllPerformanceAnnotatedFunctions(of: moduleContext)
worklist.addAllAnnotatedGlobalInitOnceFunctions(of: moduleContext)
// For embedded Swift, optimize all the functions (there cannot be any
// generics, type metadata, etc.)
if moduleContext.options.enableEmbeddedSwift {
worklist.addAllNonGenericFunctions(of: moduleContext)
} else {
worklist.addAllPerformanceAnnotatedFunctions(of: moduleContext)
worklist.addAllAnnotatedGlobalInitOnceFunctions(of: moduleContext)
}

optimizeFunctionsTopDown(using: &worklist, moduleContext)
}
Expand Down Expand Up @@ -305,6 +311,13 @@ fileprivate struct FunctionWorklist {
}
}

mutating func addAllNonGenericFunctions(of moduleContext: ModulePassContext) {
for f in moduleContext.functions where f.isGenericFunction {
pushIfNotVisited(f)
}
return
}

mutating func addAllAnnotatedGlobalInitOnceFunctions(of moduleContext: ModulePassContext) {
for f in moduleContext.functions where f.isGlobalInitOnceFunction {
if let global = f.getInitializedGlobal(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ struct Options {
_bridged.enableSimplificationFor(inst.bridged)
}

var enableEmbeddedSwift: Bool {
_bridged.enableEmbeddedSwift()
}

enum AssertConfiguration {
case enabled
case disabled
Expand Down
2 changes: 2 additions & 0 deletions SwiftCompilerSources/Sources/SIL/Function.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ final public class Function : CustomStringConvertible, HasShortDescription, Hash
/// It's called from a `[global_init]` function via a `builtin "once"`.
public var isGlobalInitOnceFunction: Bool { bridged.isGlobalInitOnceFunction() }

public var isGenericFunction: Bool { bridged.isGenericFunction() }

/// Kinds of effect attributes which can be defined for a Swift function.
public enum EffectAttribute {
/// No effect attribute is specified.
Expand Down
19 changes: 16 additions & 3 deletions cmake/modules/AddPureSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ function(add_pure_swift_host_tool name)

# Option handling
set(options)
set(single_parameter_options)
set(single_parameter_options
SWIFT_COMPONENT)
set(multiple_parameter_options
DEPENDENCIES
SWIFT_DEPENDENCIES)
Expand Down Expand Up @@ -341,6 +342,18 @@ function(add_pure_swift_host_tool name)
COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/${name}.swiftmodule"
COMMAND_EXPAND_LISTS
COMMENT "Update mtime of executable outputs workaround")
# Export this target.
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})

if(NOT APSHT_SWIFT_COMPONENT STREQUAL no_component)
add_dependencies(${APSHT_SWIFT_COMPONENT} ${name})
swift_install_in_component(TARGETS ${name}
COMPONENT ${APSHT_SWIFT_COMPONENT}
RUNTIME DESTINATION bin)
swift_is_installing_component(${APSHT_SWIFT_COMPONENT} is_installing)
endif()

if(NOT is_installing)
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
else()
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
endif()
endfunction()
3 changes: 3 additions & 0 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,9 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
else()
message(FATAL_ERROR "Unknown BOOTSTRAPPING_MODE '${ASRLF_BOOTSTRAPPING_MODE}'")
endif()
else()
target_link_directories(${target} PRIVATE
${SWIFT_PATH_TO_SWIFT_SDK}/usr/lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH})
endif()

if(SWIFT_SWIFT_PARSER)
Expand Down
55 changes: 45 additions & 10 deletions include/swift-c/DependencyScan/DependencyScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// SWIFTSCAN_VERSION_MINOR should increase when there are API additions.
/// SWIFTSCAN_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
#define SWIFTSCAN_VERSION_MAJOR 0
#define SWIFTSCAN_VERSION_MINOR 4
#define SWIFTSCAN_VERSION_MINOR 5

SWIFTSCAN_BEGIN_DECLS

Expand Down Expand Up @@ -430,6 +430,9 @@ SWIFTSCAN_PUBLIC int invoke_swift_compiler(int argc, const char **argv);

//=== Scanner CAS Operations ----------------------------------------------===//

/// Opaque container for a CASOptions that describe how CAS should be created.
typedef struct swiftscan_cas_options_s *swiftscan_cas_options_t;

/// Opaque container for a CAS instance that includes both ObjectStore and
/// ActionCache.
typedef struct swiftscan_cas_s *swiftscan_cas_t;
Expand All @@ -445,22 +448,54 @@ typedef enum {
SWIFTSCAN_OUTPUT_TYPE_CLANG_PCH = 5
} swiftscan_output_kind_t;

/// Create a \c cas instance that points to path.
SWIFTSCAN_PUBLIC swiftscan_cas_t swiftscan_cas_create(const char *path);
/// Create a \c CASOptions for creating CAS inside scanner specified.
SWIFTSCAN_PUBLIC swiftscan_cas_options_t swiftscan_cas_options_create(void);

/// Dispose \c CASOptions.
SWIFTSCAN_PUBLIC void
swiftscan_cas_options_dispose(swiftscan_cas_options_t options);

/// Set on-disk path for the \c cas.
SWIFTSCAN_PUBLIC void
swiftscan_cas_options_set_ondisk_path(swiftscan_cas_options_t options,
const char *path);

/// Set plugin path for the \c cas.
SWIFTSCAN_PUBLIC void
swiftscan_cas_options_set_plugin_path(swiftscan_cas_options_t options,
const char *path);

/// Set option using a name/value pair. Return true if error.
/// If error happens, the error message is returned via `error` parameter, and
/// caller needs to free the error message via `swiftscan_string_dispose`.
SWIFTSCAN_PUBLIC bool
swiftscan_cas_options_set_option(swiftscan_cas_options_t options,
const char *name, const char *value,
swiftscan_string_ref_t *error);

/// Create a \c cas instance from plugin. Return NULL if error.
/// If error happens, the error message is returned via `error` parameter, and
/// caller needs to free the error message via `swiftscan_string_dispose`.
SWIFTSCAN_PUBLIC swiftscan_cas_t swiftscan_cas_create_from_options(
swiftscan_cas_options_t options, swiftscan_string_ref_t *error);

/// Dispose the \c cas instance.
SWIFTSCAN_PUBLIC void swiftscan_cas_dispose(swiftscan_cas_t cas);

/// Store content into CAS. Return \c CASID as string.
SWIFTSCAN_PUBLIC swiftscan_string_ref_t swiftscan_cas_store(swiftscan_cas_t cas,
uint8_t *data,
unsigned size);
/// Store content into CAS. Return \c CASID as string. Return NULL on error.
/// If error happens, the error message is returned via `error` parameter, and
/// caller needs to free the error message via `swiftscan_string_dispose`.
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
swiftscan_cas_store(swiftscan_cas_t cas, uint8_t *data, unsigned size,
swiftscan_string_ref_t *error);

/// Compute \c CacheKey for output of \c kind from the compiler invocation \c
/// argc and \c argv with \c input. Return \c CacheKey as string.
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
swiftscan_compute_cache_key(swiftscan_cas_t cas, int argc, const char **argv,
const char *input, swiftscan_output_kind_t kind);
/// If error happens, the error message is returned via `error` parameter, and
/// caller needs to free the error message via `swiftscan_string_dispose`.
SWIFTSCAN_PUBLIC swiftscan_string_ref_t swiftscan_compute_cache_key(
swiftscan_cas_t cas, int argc, const char **argv, const char *input,
swiftscan_output_kind_t kind, swiftscan_string_ref_t *error);

//===----------------------------------------------------------------------===//

Expand Down
71 changes: 62 additions & 9 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "swift/AST/RequirementSignature.h"
#include "swift/AST/StorageImpl.h"
#include "swift/AST/TypeAlignments.h"
#include "swift/AST/TypeResolutionStage.h"
#include "swift/AST/TypeWalker.h"
#include "swift/AST/Types.h"
#include "swift/Basic/ArrayRefView.h"
Expand Down Expand Up @@ -662,7 +663,7 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
HasAnyUnavailableDuringLoweringValues : 1
);

SWIFT_INLINE_BITFIELD(ModuleDecl, TypeDecl, 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1,
SWIFT_INLINE_BITFIELD(ModuleDecl, TypeDecl, 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1,
/// If the module is compiled as static library.
StaticLibrary : 1,

Expand Down Expand Up @@ -706,6 +707,9 @@ class alignas(1 << DeclAlignInBits) Decl : public ASTAllocated<Decl> {
/// Whether this module was built with -experimental-hermetic-seal-at-link.
HasHermeticSealAtLink : 1,

/// Whether this module was built with embedded Swift.
IsEmbeddedSwiftModule : 1,

/// Whether this module has been compiled with comprehensive checking for
/// concurrency, e.g., Sendable checking.
IsConcurrencyChecked : 1,
Expand Down Expand Up @@ -1547,6 +1551,53 @@ struct InheritedEntry : public TypeLoc {
: TypeLoc(typeLoc), isUnchecked(isUnchecked) { }
};

/// A wrapper for the collection of inherited types for either a `TypeDecl` or
/// an `ExtensionDecl`.
class InheritedTypes {
llvm::PointerUnion<const TypeDecl *, const ExtensionDecl *> Decl;
ArrayRef<InheritedEntry> Entries;

public:
InheritedTypes(
llvm::PointerUnion<const TypeDecl *, const ExtensionDecl *> decl);
InheritedTypes(const class Decl *decl);
InheritedTypes(const TypeDecl *typeDecl);
InheritedTypes(const ExtensionDecl *extensionDecl);

bool empty() const { return Entries.empty(); }
size_t size() const { return Entries.size(); }
IntRange<size_t> const getIndices() { return indices(Entries); }

/// Returns the `TypeRepr *` for the entry of the inheritance clause at the
/// given index.
TypeRepr *getTypeRepr(unsigned i) const { return Entries[i].getTypeRepr(); }

/// Returns the `Type` for the entry of the inheritance clause at the given
/// index, resolved at the given stage, or `Type()` if resolution fails.
Type getResolvedType(unsigned i, TypeResolutionStage stage =
TypeResolutionStage::Interface) const;

/// Returns the underlying array of inherited type entries.
///
/// NOTE: The `Type` associated with an entry may not be resolved yet.
ArrayRef<InheritedEntry> getEntries() const { return Entries; }

/// Returns the entry of the inheritance clause at the given index.
///
/// NOTE: The `Type` associated with the entry may not be resolved yet.
const InheritedEntry &getEntry(unsigned i) const { return Entries[i]; }

/// Returns the source location of the beginning of the inheritance clause.
SourceLoc getStartLoc() const {
return getEntries().front().getSourceRange().Start;
}

/// Returns the source location of the end of the inheritance clause.
SourceLoc getEndLoc() const {
return getEntries().back().getSourceRange().End;
}
};

/// ExtensionDecl - This represents a type extension containing methods
/// associated with the type. This is not a ValueDecl and has no Type because
/// there are no runtime values of the Extension's type.
Expand Down Expand Up @@ -1582,6 +1633,7 @@ class ExtensionDecl final : public GenericContext, public Decl,
friend class MemberLookupTable;
friend class ConformanceLookupTable;
friend class IterableDeclContext;
friend class InheritedTypes;

ExtensionDecl(SourceLoc extensionLoc, TypeRepr *extendedType,
ArrayRef<InheritedEntry> inherited,
Expand Down Expand Up @@ -1662,7 +1714,7 @@ class ExtensionDecl final : public GenericContext, public Decl,

/// Retrieve the set of protocols that this type inherits (i.e,
/// explicitly conforms to).
ArrayRef<InheritedEntry> getInherited() const { return Inherited; }
InheritedTypes getInherited() const { return InheritedTypes(this); }

void setInherited(ArrayRef<InheritedEntry> i) { Inherited = i; }

Expand Down Expand Up @@ -2994,6 +3046,8 @@ class TypeDecl : public ValueDecl {
ArrayRef<InheritedEntry> inherited) :
ValueDecl(K, context, name, NameLoc), Inherited(inherited) {}

friend class InheritedTypes;

public:
Identifier getName() const { return getBaseIdentifier(); }

Expand All @@ -3009,7 +3063,7 @@ class TypeDecl : public ValueDecl {

/// Retrieve the set of protocols that this type inherits (i.e,
/// explicitly conforms to).
ArrayRef<InheritedEntry> getInherited() const { return Inherited; }
InheritedTypes getInherited() const { return InheritedTypes(this); }

void setInherited(ArrayRef<InheritedEntry> i) { Inherited = i; }

Expand Down Expand Up @@ -5178,21 +5232,19 @@ class ProtocolDecl final : public NominalTypeDecl {
/// and conformances for tuple types.
///
/// - The declared interface type is the special TheTupleType singleton.
/// - The generic parameter list has one pack generic parameter, <Elements...>
/// - The generic signature has no requirements, <Elements...>
/// - The generic parameter list has one pack generic parameter, <each Element>
/// - The generic signature has no requirements, <each Element>
/// - The self interface type is the tuple type containing a single pack
/// expansion, (Elements...).
/// expansion, (repeat each Element).
class BuiltinTupleDecl final : public NominalTypeDecl {
TupleType *TupleSelfType = nullptr;

public:
BuiltinTupleDecl(Identifier Name, DeclContext *Parent);

SourceRange getSourceRange() const {
return SourceRange();
}

TupleType *getTupleSelfType() const;
TupleType *getTupleSelfType(const ExtensionDecl *owner) const;

// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) {
Expand Down Expand Up @@ -8650,6 +8702,7 @@ class MacroDecl : public GenericContext, public ValueDecl {
/// be added if this macro does not contain an extension role.
void getIntroducedConformances(
NominalTypeDecl *attachedTo,
MacroRole role,
SmallVectorImpl<ProtocolDecl *> &conformances) const;

/// Returns a DeclName that represents arbitrary names.
Expand Down
3 changes: 3 additions & 0 deletions include/swift/AST/DiagnosticsCommon.def
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ ERROR(scanner_find_cycle, none,
ERROR(scanner_arguments_invalid, none,
"dependencies scanner cannot be configured with arguments: '%0'", (StringRef))

ERROR(error_scanner_extra, none,
"failed inside dependency scanner: '%0'", (StringRef))

WARNING(warn_scanner_deserialize_failed, none,
"Failed to load module scanning dependency cache from: '%0', re-building scanner cache from scratch.", (StringRef))

Expand Down
3 changes: 3 additions & 0 deletions include/swift/AST/DiagnosticsFrontend.def
Original file line number Diff line number Diff line change
Expand Up @@ -554,5 +554,8 @@ ERROR(layout_string_instantiation_without_layout_strings,none,
"-enable-layout-string-value-witnesses-instantiation can not be enabled "
"without -enable-layout-string-value-witnesses.", ())

ERROR(evolution_with_embedded,none,
"Library evolution cannot be enabled with embedded Swift.", ())

#define UNDEFINE_DIAGNOSTIC_MACROS
#include "DefineDiagnosticMacros.h"
Loading