Skip to content

Commit 8593be3

Browse files
authored
Merge pull request #3765 from swiftwasm/main
[pull] swiftwasm from main
2 parents e17334b + cce4442 commit 8593be3

File tree

155 files changed

+6398
-4319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+6398
-4319
lines changed

cmake/modules/SwiftUtils.cmake

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ endfunction()
207207
# Once swift-frontend is built, if the standalone (early) swift-driver has been built,
208208
# we create a `swift-driver` symlink adjacent to the `swift` and `swiftc` executables
209209
# to ensure that `swiftc` forwards to the standalone driver when invoked.
210-
function(swift_create_early_driver_symlinks target)
210+
function(swift_create_early_driver_copies target)
211211
# Early swift-driver is built adjacent to the compiler (swift build dir)
212212
set(driver_bin_dir "${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/release/bin")
213213
set(swift_bin_dir "${SWIFT_RUNTIME_OUTPUT_INTDIR}")
@@ -217,20 +217,18 @@ function(swift_create_early_driver_symlinks target)
217217
return()
218218
endif()
219219

220-
message(STATUS "Creating early SwiftDriver symlinks.")
220+
message(STATUS "Copying over early SwiftDriver executable.")
221221
message(STATUS "From: ${driver_bin_dir}/swift-driver")
222222
message(STATUS "To: ${swift_bin_dir}/swift-driver")
223-
swift_create_post_build_symlink(swift-frontend
224-
SOURCE "${driver_bin_dir}/swift-driver"
225-
DESTINATION "${swift_bin_dir}/swift-driver"
226-
COMMENT "Creating early SwiftDriver symlinks: swift-driver")
223+
# Use configure_file instead of file(COPY...) to establish a dependency.
224+
# Further Changes to `swift-driver` will cause it to be copied over.
225+
configure_file(${driver_bin_dir}/swift-driver ${swift_bin_dir}/swift-driver COPYONLY)
227226

228227
message(STATUS "From: ${driver_bin_dir}/swift-help")
229228
message(STATUS "To: ${swift_bin_dir}/swift-help")
230-
swift_create_post_build_symlink(swift-frontend
231-
SOURCE "${driver_bin_dir}/swift-help"
232-
DESTINATION "${swift_bin_dir}/swift-help"
233-
COMMENT "Creating early SwiftDriver symlinks: swift-help")
229+
# Use configure_file instead of file(COPY...) to establish a dependency.
230+
# Further Changes to `swift-driver` will cause it to be copied over.
231+
configure_file(${driver_bin_dir}/swift-help ${swift_bin_dir}/swift-help COPYONLY)
234232
endfunction()
235233

236234
function(dump_swift_vars)

include/swift/APIDigester/ModuleAnalyzerNodes.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ struct PlatformIntroVersion {
339339
class SDKNodeDecl: public SDKNode {
340340
DeclKind DKind;
341341
StringRef Usr;
342+
StringRef MangledName;
342343
SourceLoc Loc;
343344
StringRef Location;
344345
StringRef ModuleName;
@@ -359,12 +360,13 @@ class SDKNodeDecl: public SDKNode {
359360
Optional<uint8_t> FixedBinaryOrder;
360361
PlatformIntroVersion introVersions;
361362
StringRef ObjCName;
362-
363+
mutable Optional<StringRef> demangledName;
363364
protected:
364365
SDKNodeDecl(SDKNodeInitInfo Info, SDKNodeKind Kind);
365366
virtual ~SDKNodeDecl() = default;
366367
public:
367368
StringRef getUsr() const { return Usr; }
369+
StringRef getDemangledName() const;
368370
StringRef getLocation() const { return Location; }
369371
StringRef getModuleName() const {return ModuleName;}
370372
StringRef getHeaderName() const;
@@ -463,6 +465,7 @@ class SDKNodeType: public SDKNode {
463465

464466
class SDKNodeTypeNominal : public SDKNodeType {
465467
StringRef USR;
468+
StringRef MangledName;
466469
public:
467470
SDKNodeTypeNominal(SDKNodeInitInfo Info);
468471
// Get the usr of the corresponding nominal type decl.
@@ -583,6 +586,7 @@ class SDKNodeDeclType: public SDKNodeDecl {
583586
/// in the conformance, thus getName() will give us the name of the protocol.
584587
class SDKNodeConformance: public SDKNode {
585588
StringRef Usr;
589+
StringRef MangledName;
586590
SDKNodeDeclType *TypeDecl;
587591
friend class SDKNodeDeclType;
588592
bool IsABIPlaceholder;

include/swift/AST/ASTMangler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ class ASTMangler : public Mangler {
271271

272272
std::string mangleTypeAsContextUSR(const NominalTypeDecl *type);
273273

274+
std::string mangleAnyDecl(const ValueDecl *Decl, bool prefix);
274275
std::string mangleDeclAsUSR(const ValueDecl *Decl, StringRef USRPrefix);
275276

276277
std::string mangleAccessorEntityAsUSR(AccessorKind kind,

include/swift/AST/Builtins.def

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ BUILTIN_MISC_OPERATION(StaticReport, "staticReport", "", Special)
642642
/// Returns the selected assertion configuration.
643643
BUILTIN_MISC_OPERATION(AssertConf, "assert_configuration", "n", Special)
644644

645+
/// Ifdef has type () -> Bool.
646+
BUILTIN_MISC_OPERATION(Ifdef, "ifdef", "n", Special)
647+
645648
/// StringObjectOr has type (T,T) -> T.
646649
/// Sets bits in a string object. The first operand is bit-cast string literal
647650
/// pointer to an integer. The second operand is the bit mask to be or'd into
@@ -734,10 +737,6 @@ BUILTIN_MISC_OPERATION(DestroyDefaultActor, "destroyDefaultActor", "", Special)
734737
BUILTIN_MISC_OPERATION(InitializeDistributedRemoteActor,
735738
"initializeDistributedRemoteActor", "", Special)
736739

737-
/// Destroy the distributed-actor instance in a "proxy" actor object.
738-
BUILTIN_MISC_OPERATION(DestroyDistributedActor,
739-
"destroyDistributedActor", "", Special)
740-
741740
/// Resume a non-throwing continuation normally with the given result.
742741
BUILTIN_MISC_OPERATION(ResumeNonThrowingContinuationReturning,
743742
"resumeNonThrowingContinuationReturning", "", Special)

include/swift/AST/SILOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,9 @@ class SILOptions {
192192
/// }
193193
bool EnableDynamicReplacementCanCallPreviousImplementation = true;
194194

195+
/// Are we parsing the stdlib, i.e. -parse-stdlib?
196+
bool ParseStdlib = false;
197+
195198
/// The name of the file to which the backend should save optimization
196199
/// records.
197200
std::string OptRecordFile;

include/swift/AST/USRGeneration.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ bool printExtensionUSR(const ExtensionDecl *ED, raw_ostream &OS);
6363
/// \returns true if it failed, false on success.
6464
bool printDeclUSR(const Decl *D, raw_ostream &OS);
6565

66-
/// Demangle a mangle-name-based USR to a human readable name.
67-
std::string demangleUSR(StringRef mangled);
66+
/// Get mangled name from a USR.
67+
std::string getMangledNameFromUSR(StringRef usr);
68+
69+
/// Demangle a mangled name to a human readable name.
70+
std::string demangleMangledName(StringRef mangled);
6871

6972
} // namespace ide
7073
} // namespace swift

0 commit comments

Comments
 (0)