Skip to content

Commit fef0f83

Browse files
Merge pull request #5163 from swiftwasm/release/5.8
[pull] swiftwasm-release/5.8 from release/5.8
2 parents c2b14c2 + 14983a4 commit fef0f83

Some content is hidden

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

60 files changed

+330
-132
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,8 @@ else()
11931193
add_subdirectory(stdlib/public/BackDeployConcurrency)
11941194
endif()
11951195

1196-
# Some tools (e.g. swift-reflection-dump) rely on a host swiftReflection, so
1197-
# ensure we build that when building tools.
1196+
# Some tools (e.g. swift-reflection-dump) rely on a host swiftRemoteInspection,
1197+
# so ensure we build that when building tools.
11981198
if(SWIFT_INCLUDE_TOOLS)
11991199
add_subdirectory(stdlib/public/SwiftShims/swift/shims)
12001200
endif()

include/swift/Basic/Mangler.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ class Mangler {
5454

5555
/// Identifier substitutions.
5656
llvm::StringMap<unsigned> StringSubstitutions;
57+
58+
/// Index to use for the next added substitution.
59+
/// Note that this is not simply the sum of the size of the \c Substitutions
60+
/// and \c StringSubstitutions maps above, since in some circumstances the
61+
/// same entity may be registered for multiple substitution indexes.
62+
unsigned NextSubstitutionIndex = 0;
5763

5864
/// Word substitutions in mangled identifiers.
5965
llvm::SmallVector<SubstitutionWord, 26> Words;
@@ -102,7 +108,6 @@ class Mangler {
102108
}
103109

104110
protected:
105-
106111
Mangler() : Buffer(Storage) { }
107112

108113
/// Begins a new mangling but does not add the mangling prefix.
@@ -134,15 +139,15 @@ class Mangler {
134139
void addSubstitution(const void *ptr) {
135140
if (!UseSubstitutions)
136141
return;
137-
138-
auto value = Substitutions.size() + StringSubstitutions.size();
142+
143+
auto value = NextSubstitutionIndex++;
139144
Substitutions[ptr] = value;
140145
}
141146
void addSubstitution(StringRef Str) {
142147
if (!UseSubstitutions)
143148
return;
144149

145-
auto value = Substitutions.size() + StringSubstitutions.size();
150+
auto value = NextSubstitutionIndex++;
146151
StringSubstitutions[Str] = value;
147152
}
148153

include/swift/Demangling/DemangleNodes.def

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ NODE(AccessibleFunctionRecord)
339339
NODE(CompileTimeConst)
340340

341341
// Added in Swift 5.7
342-
NODE(OpaqueReturnTypeIndexed)
343342
NODE(BackDeploymentThunk)
344343
NODE(BackDeploymentFallback)
345344
NODE(ExtendedExistentialTypeShape)
@@ -351,6 +350,8 @@ NODE(SymbolicExtendedExistentialType)
351350
// Added in Swift 5.8
352351
NODE(MetatypeParamsRemoved)
353352
NODE(HasSymbolQuery)
353+
NODE(OpaqueReturnTypeIndex)
354+
NODE(OpaqueReturnTypeParent)
354355

355356
#undef CONTEXT_NODE
356357
#undef NODE

include/swift/Demangling/Demangler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,9 @@ class Demangler : public NodeFactory {
475475
friend DemangleInitRAII;
476476

477477
void addSubstitution(NodePointer Nd) {
478-
if (Nd)
478+
if (Nd) {
479479
Substitutions.push_back(Nd, *this);
480+
}
480481
}
481482

482483
NodePointer addChild(NodePointer Parent, NodePointer Child);

include/swift/Reflection/MetadataSource.h renamed to include/swift/RemoteInspection/MetadataSource.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace reflection {
3636

3737
enum class MetadataSourceKind {
3838
#define METADATA_SOURCE(Id, Parent) Id,
39-
#include "swift/Reflection/MetadataSources.def"
39+
#include "swift/RemoteInspection/MetadataSources.def"
4040
#undef METADATA_SOURCE
4141
};
4242

@@ -344,7 +344,7 @@ class MetadataSourceVisitor {
344344
return static_cast<ImplClass*>(this) \
345345
->visit##Id##MetadataSource(cast<Id##MetadataSource>(MS), \
346346
::std::forward<Args>(args)...);
347-
#include "swift/Reflection/MetadataSources.def"
347+
#include "swift/RemoteInspection/MetadataSources.def"
348348
}
349349
}
350350
};

include/swift/Reflection/MetadataSourceBuilder.h renamed to include/swift/RemoteInspection/MetadataSourceBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef SWIFT_REFLECTION_METADATASOURCEBUILDER_H
1818
#define SWIFT_REFLECTION_METADATASOURCEBUILDER_H
1919

20-
#include "swift/Reflection/MetadataSource.h"
20+
#include "swift/RemoteInspection/MetadataSource.h"
2121

2222
namespace swift {
2323
namespace reflection {

include/swift/Reflection/ReflectionContext.h renamed to include/swift/RemoteInspection/ReflectionContext.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
#include "swift/Concurrency/Actor.h"
3131
#include "swift/Remote/MemoryReader.h"
3232
#include "swift/Remote/MetadataReader.h"
33-
#include "swift/Reflection/Records.h"
34-
#include "swift/Reflection/RuntimeInternals.h"
35-
#include "swift/Reflection/TypeLowering.h"
36-
#include "swift/Reflection/TypeRef.h"
37-
#include "swift/Reflection/TypeRefBuilder.h"
33+
#include "swift/RemoteInspection/Records.h"
34+
#include "swift/RemoteInspection/RuntimeInternals.h"
35+
#include "swift/RemoteInspection/TypeLowering.h"
36+
#include "swift/RemoteInspection/TypeRef.h"
37+
#include "swift/RemoteInspection/TypeRefBuilder.h"
3838
#include "swift/Basic/Unreachable.h"
3939

4040
#include <set>

0 commit comments

Comments
 (0)