Skip to content
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

[pull] swiftwasm from main #5531

Merged
merged 63 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
49d7e04
[cxx-interop] C++ records should have address-only layout when they c…
hyp May 9, 2023
2c4188b
[cxx-interop] mark C++ classes with trivial_abi attribute as unavaila…
hyp May 9, 2023
84b212c
[ConstraintSytem] NFC: Remove unnecessary checking/counting from `cou…
xedin May 19, 2023
f12e24e
[Diagnostics] Skip overloaded locations where all solutions have the …
xedin May 19, 2023
47a08e3
Enable IRGen/protocol_metadata test on Apple Silicon
karwa Jun 9, 2023
c6dd3ad
[CS] Diagnose UnresolvedPatternExprs as part of constraint solving
hamishknight Jun 13, 2023
fbbbd0d
[Macros] Allow keywords after `#` in freestanding macro expansions
ahoppen Jun 14, 2023
8b1c9c9
[Parse] InitAccessors: Parse initializer exprs associated with comput…
xedin Jun 15, 2023
290970a
[Build] Set swift-stdlib-tracing=0 for minimal stdlib builds.
mikeash Jun 15, 2023
988f373
[test] fix objcxx-arc-field-in-struct-type-layout-execution.swift tes…
hyp Jun 15, 2023
57e226d
[CanOSSALifetime] Bail early in lifetime extension
nate-chandler Jun 15, 2023
d1554f2
[AST] InitAccessors: Requestify a "has init accessor" check
xedin Jun 15, 2023
fc895b4
[Sema] Formalize a way to check whether storage is initializable
xedin Jun 15, 2023
f58d407
[Sema/SILGen] Consider init exprs associated with init accessor prope…
xedin Jun 15, 2023
7abd265
[cxx-interop] revert back to old address-only heuristic for MSVC
hyp Jun 15, 2023
a9f9bd1
[SourceKit] Record module loading errors when generating interfaces
hamishknight Jun 15, 2023
706985d
[Macros] Update plugin search options serialization
rintaro Jun 15, 2023
fc7ecc8
[Distributed] Harden typechecker against completely empty DAS types
ktoso Jun 16, 2023
8e66001
Merge pull request #66676 from hamishknight/interface-error
hamishknight Jun 16, 2023
e822a6a
Merge pull request #66643 from ahoppen/ahoppen/keyword-freestanding-m…
ahoppen Jun 16, 2023
b420190
Merge pull request #66695 from ktoso/wip-distributed-harden-empty-impls
ktoso Jun 16, 2023
49e9284
Merge pull request #66680 from nate-chandler/rdar110854874
nate-chandler Jun 16, 2023
cdc72fd
Merge pull request #66679 from mikeash/disable-tracing-minimal
mikeash Jun 16, 2023
4590aa1
Merge pull request #65813 from hyp/eng/passInRegs
hyp Jun 16, 2023
874ba08
SILDebugScopes: Don't ignore ConditionalClauseInitializerScope.
adrian-prantl Jun 16, 2023
9b69044
[TypeLowering] Move-only types are lexical.
nate-chandler Jun 16, 2023
f1a9e8b
Fix tests on arm64e
aschwaighofer Jun 16, 2023
c340d47
[TypeLowering] Move-only types are lexical.
nate-chandler Jun 16, 2023
0bf643d
Optimizer: add an additional DeadObjectElimination at the end of the …
eeckstein Jun 16, 2023
f8bde21
Merge pull request #66035 from xedin/rdar-109245375
xedin Jun 16, 2023
f10d0df
Merge pull request #66593 from hamishknight/pattern-error
hamishknight Jun 16, 2023
a77cc30
Merge pull request #66706 from aschwaighofer/fix_arm64e_opaque_ptr_fa…
swift-ci Jun 16, 2023
e1d2198
[TypeResolution] Ban local variable packs (#66622)
simanerush Jun 16, 2023
9d342f1
Merge pull request #66681 from xedin/enable-inits-on-props-with-init-…
xedin Jun 16, 2023
6fa0c14
[Macros] Make 'PluginSearchOption' a external union
rintaro Jun 16, 2023
1ed9df0
[DebugInfo] Update tests to use opaque ptrs
felipepiovezan May 25, 2023
5d7aa84
[SILOpt] Don't opt move-only lifetimes.
nate-chandler Jun 16, 2023
9d4f4af
Merge pull request #66698 from eeckstein/dead-alloc-in-passpipeline
eeckstein Jun 16, 2023
13cdc66
Merge pull request #66705 from nate-chandler/rdar110901430
nate-chandler Jun 16, 2023
8db8451
[SILOpt] Don't opt move-only lifetimes.
nate-chandler Jun 16, 2023
329e428
Compute VarDeclScopeMap up front.
adrian-prantl Jun 16, 2023
fef3578
Temporarily disable assertion.
adrian-prantl Jun 16, 2023
d067453
[FieldSensitivePL] NFC: Implemented print.
nate-chandler Jun 8, 2023
934ec10
[Basic] Removed spurious req from FrozenMultiMap.
nate-chandler Jun 16, 2023
f4d8761
ModuleLoader: minor clean-up to remove dead code. NFC
nkcsgexi Jun 16, 2023
1ec900e
[Macros] Add default plugin paths for Darwin SDKs and platforms.
DougGregor Jun 16, 2023
22348e6
Merge pull request #66711 from DougGregor/old-driver-default-plugin-p…
DougGregor Jun 16, 2023
13a29a0
Merge pull request #66689 from rintaro/macros-serialization-pluginopts
rintaro Jun 16, 2023
36451ef
require `consume x` for noncopyable pattern bindings since they're co…
kavon Jun 16, 2023
874b577
[IRGen] Use EnumImplStrategy to generate getEnumTag function for layo…
drexin Jun 17, 2023
4e5ff2c
Merge pull request #66495 from karwa/patch-16
rjmccall Jun 17, 2023
ca29d53
Merge pull request #66716 from nate-chandler/rdar110913116
nate-chandler Jun 17, 2023
6709648
Merge pull request #66713 from kavon/require-switch-consume
swift-ci Jun 17, 2023
f4e3292
[FieldSensitivePL] Fix vectorization.
nate-chandler Jun 16, 2023
b97712c
[MoveOnlyAddressChecker] NFC: Promoted assertion.
nate-chandler Jun 8, 2023
eaf4560
[MoveOnlyAddressChecker] Maximize lifetimes.
nate-chandler Jun 12, 2023
11443f2
[move-only] Avoid loc from func decl.
nate-chandler Jun 17, 2023
2bfa723
[MoveOnlyAddressChecker] Added extension flag.
nate-chandler Jun 17, 2023
cbd0b15
Merge pull request #66712 from felipepiovezan/felipe/update_debug_inf…
felipepiovezan Jun 17, 2023
c2f164d
Merge pull request #66692 from adrian-prantl/110841130
adrian-prantl Jun 17, 2023
606eef6
Merge pull request #66719 from nkcsgexi/clean-up-framework
nkcsgexi Jun 17, 2023
91ee824
Merge pull request #66690 from nate-chandler/rdar110676577
nate-chandler Jun 17, 2023
d312589
Merge pull request #66585 from nate-chandler/rdar99681073
nate-chandler Jun 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion include/swift/AST/ASTScope.h
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ class ConditionalClauseInitializerScope final : public ASTScopeImpl {
SourceRange
getSourceRangeOfThisASTNode(bool omitAssertions = false) const override;
std::string getClassName() const override;
bool ignoreInDebugInfo() const override { return true; }

private:
void expandAScopeThatDoesNotCreateANewInsertionPoint(ScopeCreator &);
Expand Down
10 changes: 10 additions & 0 deletions include/swift/AST/Decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5317,6 +5317,16 @@ class AbstractStorageDecl : public ValueDecl {
/// it.
bool hasStorage() const;

/// Return true if this is a VarDecl that has init accessor associated
/// with it.
bool hasInitAccessor() const;

/// Return true if this is a property that either has storage
/// or init accessor associated with it.
bool supportsInitialization() const {
return hasStorage() || hasInitAccessor();
}

/// Return true if this storage has the basic accessors/capability
/// to be mutated. This is generally constant after the accessors are
/// installed by the parser/importer/whatever.
Expand Down
16 changes: 16 additions & 0 deletions include/swift/AST/DiagnosticEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,22 @@ namespace swift {
}
};

/// A RAII object that adds and removes a diagnostic consumer from an engine.
class DiagnosticConsumerRAII final {
DiagnosticEngine &Diags;
DiagnosticConsumer &Consumer;

public:
DiagnosticConsumerRAII(DiagnosticEngine &diags,
DiagnosticConsumer &consumer)
: Diags(diags), Consumer(consumer) {
Diags.addConsumer(Consumer);
}
~DiagnosticConsumerRAII() {
Diags.removeConsumer(Consumer);
}
};

inline void
DiagnosticEngine::diagnoseWithNotes(InFlightDiagnostic parentDiag,
llvm::function_ref<void(void)> builder) {
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -4672,7 +4672,7 @@ ERROR(unknown_case_multiple_patterns,none,
ERROR(unknown_case_must_be_last,none,
"'@unknown' can only be applied to the last case in a switch", ())

WARNING(move_only_pattern_match_not_consumed,none,
ERROR(move_only_pattern_match_not_consumed,none,
"noncopyable binding being pattern-matched must have the 'consume' operator applied", ())

WARNING(where_on_one_item, none,
Expand Down
96 changes: 76 additions & 20 deletions include/swift/AST/SearchPathOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#define SWIFT_AST_SEARCHPATHOPTIONS_H

#include "swift/Basic/ArrayRefView.h"
#include "swift/Basic/ExternalUnion.h"
#include "swift/Basic/PathRemapper.h"
#include "swift/Basic/TaggedUnion.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/StringMap.h"
Expand Down Expand Up @@ -187,25 +187,81 @@ struct ExternalPluginSearchPathAndServerPath {
std::string ServerPath;
};

namespace PluginSearchOption {
struct LoadPluginLibrary {
std::string LibraryPath;
};
struct LoadPluginExecutable {
std::string ExecutablePath;
std::vector<std::string> ModuleNames;
};
struct PluginPath {
std::string SearchPath;
};
struct ExternalPluginPath {
std::string SearchPath;
std::string ServerPath;
};
class PluginSearchOption {
public:
struct LoadPluginLibrary {
std::string LibraryPath;
};
struct LoadPluginExecutable {
std::string ExecutablePath;
std::vector<std::string> ModuleNames;
};
struct PluginPath {
std::string SearchPath;
};
struct ExternalPluginPath {
std::string SearchPath;
std::string ServerPath;
};

enum class Kind : uint8_t {
LoadPluginLibrary,
LoadPluginExecutable,
PluginPath,
ExternalPluginPath,
};

using Value = TaggedUnion<LoadPluginLibrary, LoadPluginExecutable, PluginPath,
ExternalPluginPath>;
} // namespace PluginSearchOption
private:
using Members = ExternalUnionMembers<LoadPluginLibrary, LoadPluginExecutable,
PluginPath, ExternalPluginPath>;
static Members::Index getIndexForKind(Kind kind) {
switch (kind) {
case Kind::LoadPluginLibrary:
return Members::indexOf<LoadPluginLibrary>();
case Kind::LoadPluginExecutable:
return Members::indexOf<LoadPluginExecutable>();
case Kind::PluginPath:
return Members::indexOf<PluginPath>();
case Kind::ExternalPluginPath:
return Members::indexOf<ExternalPluginPath>();
}
};
using Storage = ExternalUnion<Kind, Members, getIndexForKind>;

Kind kind;
Storage storage;

public:
PluginSearchOption(const LoadPluginLibrary &v)
: kind(Kind::LoadPluginLibrary) {
storage.emplace<LoadPluginLibrary>(kind, v);
}
PluginSearchOption(const LoadPluginExecutable &v)
: kind(Kind::LoadPluginExecutable) {
storage.emplace<LoadPluginExecutable>(kind, v);
}
PluginSearchOption(const PluginPath &v) : kind(Kind::PluginPath) {
storage.emplace<PluginPath>(kind, v);
}
PluginSearchOption(const ExternalPluginPath &v)
: kind(Kind::ExternalPluginPath) {
storage.emplace<ExternalPluginPath>(kind, v);
}

Kind getKind() const { return kind; }

template <typename T>
const T *dyn_cast() const {
if (Members::indexOf<T>() != getIndexForKind(kind))
return nullptr;
return &storage.get<T>(kind);
}

template <typename T>
const T &get() const {
return storage.get<T>(kind);
}
};

/// Options for controlling search path behavior.
class SearchPathOptions {
Expand Down Expand Up @@ -383,7 +439,7 @@ class SearchPathOptions {
std::vector<std::string> RuntimeLibraryPaths;

/// Plugin search path options.
std::vector<PluginSearchOption::Value> PluginSearchOpts;
std::vector<PluginSearchOption> PluginSearchOpts;

/// Don't look in for compiler-provided modules.
bool SkipRuntimeLibraryImportPaths = false;
Expand Down
16 changes: 16 additions & 0 deletions include/swift/AST/TypeCheckRequests.h
Original file line number Diff line number Diff line change
Expand Up @@ -4312,6 +4312,22 @@ class IsNonUserModuleRequest
bool isCached() const { return true; }
};

class HasInitAccessorRequest
: public SimpleRequest<HasInitAccessorRequest, bool(AbstractStorageDecl *),
RequestFlags::Cached> {
public:
using SimpleRequest::SimpleRequest;

private:
friend SimpleRequest;

// Evaluation.
bool evaluate(Evaluator &evaluator, AbstractStorageDecl *decl) const;

public:
bool isCached() const { return true; }
};

class InitAccessorReferencedVariablesRequest
: public SimpleRequest<InitAccessorReferencedVariablesRequest,
ArrayRef<VarDecl *>(DeclAttribute *, AccessorDecl *,
Expand Down
3 changes: 3 additions & 0 deletions include/swift/AST/TypeCheckerTypeIDZone.def
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ SWIFT_REQUEST(TypeChecker, IsNonUserModuleRequest,
SWIFT_REQUEST(TypeChecker, TypeCheckObjCImplementationRequest,
unsigned(ExtensionDecl *),
Cached, NoLocationInfo)
SWIFT_REQUEST(TypeChecker, HasInitAccessorRequest,
bool(AbstractStorageDecl *), Cached,
NoLocationInfo)
SWIFT_REQUEST(TypeChecker, InitAccessorReferencedVariablesRequest,
ArrayRef<VarDecl *>(DeclAttribute *, AccessorDecl *,
ArrayRef<Identifier>),
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Basic/FrozenMultiMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class FrozenMultiMap {
// Since our array is sorted, we need to first find the first pair with our
// inst as the first element.
auto start = std::lower_bound(
storage.begin(), storage.end(), std::make_pair(key, Value()),
storage.begin(), storage.end(), std::make_pair(key, llvm::None),
[&](const std::pair<Key, Optional<Value>> &p1,
const std::pair<Key, Optional<Value>> &p2) {
return p1.first < p2.first;
Expand Down
5 changes: 5 additions & 0 deletions include/swift/Driver/ToolChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ class ToolChain {
const llvm::opt::ArgList &inputArgs,
llvm::opt::ArgStringList &arguments) const;

virtual void addPlatformSpecificPluginFrontendArgs(
const OutputInfo &OI,
const CommandOutput &output,
const llvm::opt::ArgList &inputArgs,
llvm::opt::ArgStringList &arguments) const;
virtual InvocationInfo constructInvocation(const CompileJobAction &job,
const JobContext &context) const;
virtual InvocationInfo constructInvocation(const InterpretJobAction &job,
Expand Down