Skip to content

Commit 3a66309

Browse files
committed
Rename Reflection library to RemoteInspection (swiftlang#62846)
1 parent 5a0eb50 commit 3a66309

Some content is hidden

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

44 files changed

+92
-92
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1188,8 +1188,8 @@ else()
11881188
add_subdirectory(stdlib/public/BackDeployConcurrency)
11891189
endif()
11901190

1191-
# Some tools (e.g. swift-reflection-dump) rely on a host swiftReflection, so
1192-
# ensure we build that when building tools.
1191+
# Some tools (e.g. swift-reflection-dump) rely on a host swiftRemoteInspection,
1192+
# so ensure we build that when building tools.
11931193
if(SWIFT_INCLUDE_TOOLS)
11941194
add_subdirectory(stdlib/public/SwiftShims/swift/shims)
11951195
endif()

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

+2-2
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 include/swift/RemoteInspection/MetadataSourceBuilder.h

+1-1
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 {
File renamed without changes.

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

+5-5
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>

include/swift/Reflection/TypeRef.h include/swift/RemoteInspection/TypeRef.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using llvm::dyn_cast;
3434

3535
enum class TypeRefKind {
3636
#define TYPEREF(Id, Parent) Id,
37-
#include "swift/Reflection/TypeRefs.def"
37+
#include "swift/RemoteInspection/TypeRefs.def"
3838
#undef TYPEREF
3939
};
4040

@@ -1034,7 +1034,7 @@ class TypeRefVisitor {
10341034
return static_cast<ImplClass*>(this) \
10351035
->visit##Id##TypeRef(cast<Id##TypeRef>(typeRef), \
10361036
::std::forward<Args>(args)...);
1037-
#include "swift/Reflection/TypeRefs.def"
1037+
#include "swift/RemoteInspection/TypeRefs.def"
10381038
}
10391039

10401040
// We shouldn't get an unknown kind, but bad data might result in an unknown

include/swift/Reflection/TypeRefBuilder.h include/swift/RemoteInspection/TypeRefBuilder.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
#include "swift/Remote/ExternalTypeRefCache.h"
2222
#include "swift/Remote/MetadataReader.h"
23-
#include "swift/Reflection/MetadataSourceBuilder.h"
24-
#include "swift/Reflection/Records.h"
25-
#include "swift/Reflection/TypeLowering.h"
26-
#include "swift/Reflection/TypeRef.h"
23+
#include "swift/RemoteInspection/MetadataSourceBuilder.h"
24+
#include "swift/RemoteInspection/Records.h"
25+
#include "swift/RemoteInspection/TypeLowering.h"
26+
#include "swift/RemoteInspection/TypeRef.h"
2727
#include "llvm/ADT/Optional.h"
2828
#include "llvm/ADT/SmallVector.h"
2929
#include <iomanip>
@@ -394,7 +394,7 @@ struct TypeRefDecl {
394394
/// it vends.
395395
class TypeRefBuilder {
396396
#define TYPEREF(Id, Parent) friend class Id##TypeRef;
397-
#include "swift/Reflection/TypeRefs.def"
397+
#include "swift/RemoteInspection/TypeRefs.def"
398398

399399
public:
400400
using BuiltType = const TypeRef *;
@@ -437,7 +437,7 @@ class TypeRefBuilder {
437437
#define TYPEREF(Id, Parent) \
438438
std::unordered_map<TypeRefID, const Id##TypeRef *, \
439439
TypeRefID::Hash, TypeRefID::Equal> Id##TypeRefs;
440-
#include "swift/Reflection/TypeRefs.def"
440+
#include "swift/RemoteInspection/TypeRefs.def"
441441

442442
public:
443443
template <typename TypeRefTy, typename... Args>

include/swift/Runtime/Metadata.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define SWIFT_RUNTIME_METADATA_H
1919

2020
#include "swift/ABI/Metadata.h"
21-
#include "swift/Reflection/Records.h"
21+
#include "swift/RemoteInspection/Records.h"
2222
#include "swift/Runtime/Once.h"
2323
#include "swift/shims/Visibility.h"
2424

include/swift/StaticMirror/ObjectFileContext.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef SWIFT_OBJECT_FILE_CONTEXT_H
1414
#define SWIFT_OBJECT_FILE_CONTEXT_H
1515

16-
#include "swift/Reflection/ReflectionContext.h"
16+
#include "swift/RemoteInspection/ReflectionContext.h"
1717

1818
namespace llvm {
1919
namespace object {

lib/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ add_subdirectory(RemoteAST)
4545
add_subdirectory(Sema)
4646
add_subdirectory(Serialization)
4747
add_subdirectory(SwiftDemangle)
48-
add_subdirectory(SwiftReflection)
48+
add_subdirectory(SwiftRemoteInspection)
4949
add_subdirectory(SwiftRemoteMirror)
5050
add_subdirectory(SIL)
5151
add_subdirectory(SILGen)

lib/IRGen/GenReflection.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#include "swift/AST/SubstitutionMap.h"
2424
#include "swift/Basic/Platform.h"
2525
#include "swift/IRGen/Linking.h"
26-
#include "swift/Reflection/MetadataSourceBuilder.h"
27-
#include "swift/Reflection/Records.h"
26+
#include "swift/RemoteInspection/MetadataSourceBuilder.h"
27+
#include "swift/RemoteInspection/Records.h"
2828
#include "swift/SIL/SILModule.h"
2929

3030
#include "ConstantBuilder.h"

lib/IRGen/MetadataPath.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define SWIFT_IRGEN_METADATAPATH_H
2020

2121
#include "swift/Basic/EncodedSequence.h"
22-
#include "swift/Reflection/MetadataSource.h"
22+
#include "swift/RemoteInspection/MetadataSource.h"
2323
#include "WitnessIndex.h"
2424
#include "IRGen.h"
2525

lib/StaticMirror/BinaryScanningTool.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "swift/StaticMirror/BinaryScanningTool.h"
1414
#include "swift/Basic/Unreachable.h"
1515
#include "swift/Demangling/Demangler.h"
16-
#include "swift/Reflection/ReflectionContext.h"
17-
#include "swift/Reflection/TypeRefBuilder.h"
18-
#include "swift/Reflection/TypeLowering.h"
16+
#include "swift/RemoteInspection/ReflectionContext.h"
17+
#include "swift/RemoteInspection/TypeRefBuilder.h"
18+
#include "swift/RemoteInspection/TypeLowering.h"
1919
#include "swift/Remote/CMemoryReader.h"
2020
#include "swift/StaticMirror/ObjectFileContext.h"
2121

lib/StaticMirror/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ add_swift_host_library(swiftStaticMirror STATIC
44
LLVM_LINK_COMPONENTS object support)
55

66
target_link_libraries(swiftStaticMirror PRIVATE
7-
swiftReflection)
7+
swiftRemoteInspection)

lib/StaticMirror/ObjectFileContext.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "swift/StaticMirror/ObjectFileContext.h"
1414
#include "swift/Basic/Unreachable.h"
1515
#include "swift/Demangling/Demangler.h"
16-
#include "swift/Reflection/ReflectionContext.h"
17-
#include "swift/Reflection/TypeLowering.h"
18-
#include "swift/Reflection/TypeRefBuilder.h"
16+
#include "swift/RemoteInspection/ReflectionContext.h"
17+
#include "swift/RemoteInspection/TypeLowering.h"
18+
#include "swift/RemoteInspection/TypeRefBuilder.h"
1919
#include "swift/Remote/CMemoryReader.h"
2020

2121
#include "llvm/ADT/StringSet.h"

lib/SwiftReflection/CMakeLists.txt

-9
This file was deleted.
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
add_swift_host_library(swiftRemoteInspection STATIC
3+
${SWIFT_SOURCE_DIR}/stdlib/public/RemoteInspection/MetadataSource.cpp
4+
${SWIFT_SOURCE_DIR}/stdlib/public/RemoteInspection/TypeLowering.cpp
5+
${SWIFT_SOURCE_DIR}/stdlib/public/RemoteInspection/TypeRef.cpp
6+
${SWIFT_SOURCE_DIR}/stdlib/public/RemoteInspection/TypeRefBuilder.cpp)
7+
target_compile_options(swiftRemoteInspection PRIVATE -DSWIFT_ENABLE_REFLECTION)
8+
target_link_libraries(swiftRemoteInspection PUBLIC
9+
swiftDemangling)

stdlib/public/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ add_subdirectory(SwiftShims/swift/shims)
6464
add_subdirectory(CommandLineSupport)
6565
add_subdirectory(Threading)
6666

67-
# This static library is shared across swiftCore and swiftReflection
67+
# This static library is shared across swiftCore and swiftRemoteInspection
6868
if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR)
6969
# TODO: due to the use of `add_swift_target_library` rather than `add_library`
7070
# we cannot use `target_sources` and thus must resort to list manipulations to
@@ -149,7 +149,7 @@ if(SWIFT_BUILD_STDLIB)
149149
endif()
150150

151151
if(SWIFT_BUILD_STDLIB OR SWIFT_BUILD_REMOTE_MIRROR)
152-
add_subdirectory(Reflection)
152+
add_subdirectory(RemoteInspection)
153153
add_subdirectory(SwiftRemoteMirror)
154154
endif()
155155

stdlib/public/Concurrency/TaskPrivate.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class alignas(2 * sizeof(void*)) ActiveTaskStatus {
288288

289289
// Note: this structure is mirrored by ActiveTaskStatusWithEscalation and
290290
// ActiveTaskStatusWithoutEscalation in
291-
// include/swift/Reflection/RuntimeInternals.h. Any changes to the layout here
291+
// include/swift/RemoteInspection/RuntimeInternals.h. Any changes to the layout here
292292
// must also be made there.
293293
#if SWIFT_CONCURRENCY_ENABLE_PRIORITY_ESCALATION && SWIFT_POINTER_IS_4_BYTES
294294
uint32_t Flags;

stdlib/public/Reflection/CMakeLists.txt

-19
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
set(swiftRemoteInspection_SOURCES
2+
MetadataSource.cpp
3+
TypeLowering.cpp
4+
TypeRef.cpp
5+
TypeRefBuilder.cpp)
6+
7+
set(swiftRemoteInspection_C_COMPILE_FLAGS -DswiftCore_EXPORTS)
8+
if(SWIFT_ENABLE_REFLECTION)
9+
list(APPEND swiftRemoteInspection_C_COMPILE_FLAGS -DSWIFT_ENABLE_REFLECTION)
10+
endif()
11+
12+
add_swift_target_library(swiftRemoteInspection STATIC
13+
${swiftRemoteInspection_SOURCES}
14+
C_COMPILE_FLAGS ${SWIFT_RUNTIME_CXX_FLAGS} ${swiftRemoteInspection_C_COMPILE_FLAGS}
15+
LINK_FLAGS ${SWIFT_RUNTIME_LINK_FLAGS}
16+
INCORPORATE_OBJECT_LIBRARIES
17+
swiftLLVMSupport swiftDemangling swiftDemanglingCR
18+
SWIFT_COMPILE_FLAGS ${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
19+
INSTALL_IN_COMPONENT dev)

stdlib/public/Reflection/MetadataSource.cpp stdlib/public/RemoteInspection/MetadataSource.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#if SWIFT_ENABLE_REFLECTION
1414

15-
#include "swift/Reflection/MetadataSource.h"
15+
#include "swift/RemoteInspection/MetadataSource.h"
1616
#include <iostream>
1717

1818
using namespace swift;

stdlib/public/Reflection/TypeLowering.cpp stdlib/public/RemoteInspection/TypeLowering.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
#include "llvm/Support/MathExtras.h"
2424
#include "swift/ABI/Enum.h"
2525
#include "swift/ABI/MetadataValues.h"
26-
#include "swift/Reflection/TypeLowering.h"
27-
#include "swift/Reflection/TypeRef.h"
28-
#include "swift/Reflection/TypeRefBuilder.h"
26+
#include "swift/RemoteInspection/TypeLowering.h"
27+
#include "swift/RemoteInspection/TypeRef.h"
28+
#include "swift/RemoteInspection/TypeRefBuilder.h"
2929
#include "swift/Basic/Unreachable.h"
3030
#include <iostream>
3131
#include <sstream>

stdlib/public/Reflection/TypeRef.cpp stdlib/public/RemoteInspection/TypeRef.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
#include "swift/Basic/Range.h"
2121
#include "swift/Demangling/Demangle.h"
22-
#include "swift/Reflection/TypeRef.h"
23-
#include "swift/Reflection/TypeRefBuilder.h"
22+
#include "swift/RemoteInspection/TypeRef.h"
23+
#include "swift/RemoteInspection/TypeRefBuilder.h"
2424
#include <iostream>
2525

2626
using namespace swift;

stdlib/public/Reflection/TypeRefBuilder.cpp stdlib/public/RemoteInspection/TypeRefBuilder.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717

1818
#if SWIFT_ENABLE_REFLECTION
1919

20-
#include "swift/Reflection/TypeRefBuilder.h"
20+
#include "swift/RemoteInspection/TypeRefBuilder.h"
2121
#include "swift/Demangling/Demangle.h"
22-
#include "swift/Reflection/Records.h"
23-
#include "swift/Reflection/TypeLowering.h"
24-
#include "swift/Reflection/TypeRef.h"
22+
#include "swift/RemoteInspection/Records.h"
23+
#include "swift/RemoteInspection/TypeLowering.h"
24+
#include "swift/RemoteInspection/TypeRef.h"
2525
#include "swift/Remote/MetadataReader.h"
2626
#include <iomanip>
2727
#include <iostream>

stdlib/public/SwiftRemoteMirror/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(SWIFT_BUILD_DYNAMIC_STDLIB)
55
SHARED DONT_EMBED_BITCODE NOSWIFTRT
66
SwiftRemoteMirror.cpp
77
LINK_LIBRARIES
8-
swiftReflection
8+
swiftRemoteInspection
99
C_COMPILE_FLAGS
1010
${SWIFT_RUNTIME_CXX_FLAGS} -DswiftRemoteMirror_EXPORTS -I${LLVM_MAIN_INCLUDE_DIR}
1111
LINK_FLAGS

stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ SWIFT_REMOTE_MIRROR_LINKAGE uint32_t swift_reflection_libraryVersion = 3;
2323
}
2424

2525
#include "swift/Demangling/Demangler.h"
26-
#include "swift/Reflection/ReflectionContext.h"
27-
#include "swift/Reflection/TypeLowering.h"
26+
#include "swift/RemoteInspection/ReflectionContext.h"
27+
#include "swift/RemoteInspection/TypeLowering.h"
2828
#include "swift/Remote/CMemoryReader.h"
2929
#include "swift/Basic/Unreachable.h"
3030

stdlib/public/runtime/Demangle.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ swift::_buildDemanglingForContext(const ContextDescriptor *context,
228228
}
229229

230230
// FIXME: This stuff should be merged with the existing logic in
231-
// include/swift/Reflection/TypeRefBuilder.h as part of the rewrite
231+
// include/swift/RemoteInspection/TypeRefBuilder.h as part of the rewrite
232232
// to change stdlib reflection over to using remote mirrors.
233233

234234
Demangle::NodePointer

stdlib/public/runtime/MetadataLookup.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "swift/Basic/Lazy.h"
2222
#include "swift/Demangling/Demangler.h"
2323
#include "swift/Demangling/TypeDecoder.h"
24-
#include "swift/Reflection/Records.h"
24+
#include "swift/RemoteInspection/Records.h"
2525
#include "swift/Runtime/Casting.h"
2626
#include "swift/Runtime/Concurrent.h"
2727
#include "swift/Runtime/Debug.h"

stdlib/tools/swift-reflection-test/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ add_swift_target_executable(swift-reflection-test BUILD_WITH_STDLIB
33
overrides.c
44
LINK_LIBRARIES
55
swiftRemoteMirror
6-
swiftReflection)
6+
swiftRemoteInspection)
77
# NOTE(compnerd) since _WINDLL has no impact on non-Windows targets,
88
# we just spam it on all the targets for simplicity due to the build
99
# structure of swift. This will make the global variable imported,

test/TypeRoundTrip/Inputs/RoundTrip/RoundTrip.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "swift/ABI/Metadata.h"
22
#include "swift/Demangling/Demangle.h"
3-
#include "swift/Reflection/TypeRefBuilder.h"
3+
#include "swift/RemoteInspection/TypeRefBuilder.h"
44
#include "swift/Remote/MetadataReader.h"
55
#include "swift/Remote/InProcessMemoryReader.h"
66

test/TypeRoundTrip/round-trip.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: echo "func runAllTests() throws {" >> %t/all-tests.swift
77
// RUN: for module in %S/Inputs/testcases/*.swift; do modname=$(basename $module .swift); %target-build-swift -g -static -emit-module-path %t/$modname.swiftmodule -emit-module -emit-library -module-name $modname -o %t/%target-static-library-name($modname) -I%t -L%t $module -lRoundTrip; echo " print(\"--- $modname\")" >> %t/all-tests.swift; echo " $modname.test()" >> %t/all-tests.swift; echo " print(\"\")" >> %t/all-tests.swift; echo "-l$modname" >> %t/link.txt; done
88
// RUN: echo "}" >> %t/all-tests.swift
9-
// RUN: %target-build-swift -g -I%t -o %t/round-trip %s %t/all-tests.swift -L%t %target-cxx-lib $(cat %t/link.txt) -lm -lRoundTrip -lswiftReflection
9+
// RUN: %target-build-swift -g -I%t -o %t/round-trip %s %t/all-tests.swift -L%t %target-cxx-lib $(cat %t/link.txt) -lm -lRoundTrip -lswiftRemoteInspection
1010
// RUN: %target-codesign %t/round-trip
1111
// RUN: %target-run %t/round-trip | %FileCheck %s
1212

tools/libStaticMirror/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ add_dependencies(libStaticMirror
1818

1919
target_link_libraries(libStaticMirror PRIVATE
2020
swiftStaticMirror
21-
swiftReflection)
21+
swiftRemoteInspection)
2222

2323
set_target_properties(libStaticMirror
2424
PROPERTIES

0 commit comments

Comments
 (0)