Open-Source Wikis

/

Swift

/

Tools

/

Auxiliary tools

apple/swift

Auxiliary tools

A walking tour of the smaller binaries under tools/. Each is a thin CLI over a corresponding library in lib/.

Demangling

| Tool | Library | Use | | ------------------------- | ----------------- | ----------------------------------------- | ------------------------------------------- | | swift-demangle | lib/Demangling/ | echo $sBaaa | swift-demangle -- decode a mangled symbol. | | swift-demangle-fuzzer | same | LibFuzzer harness for the demangler. | | swift-demangle-yamldump | same | Print the demangler's parse tree as YAML. |

The compiler's mangling spec is docs/ABI/Mangling.rst. Two copies of the demangler exist: lib/Demangling/ (compiler-side) and the runtime copy in stdlib/public/Demangling/.

IDE and refactoring

Tool Library Use
swift-ide-test lib/IDE/ CLI for completion, cursor info, conforming-method-list, semantic tokens.
swift-refactor lib/Refactoring/ Run a single refactoring transformation (extract function, rename, etc.).

swift-ide-test is the workhorse for test/IDE/. Most completion test files have a // RUN: %target-swift-ide-test ... invocation.

Reflection and runtime inspection

Tool Library Use
swift-reflection-dump lib/SwiftRemoteMirror/ Dump reflection metadata (__swift5_* sections) from a binary or .swiftmodule.
swift-reflection-fuzzer same LibFuzzer harness for the reflection reader.
swift-inspect same Inspect a running Swift process: list classes, count instances, dump heap.
swift-remoteast-test lib/RemoteAST/ Test the RemoteAST library used by LLDB.

SwiftRemoteMirror is the C library that walks a remote process's metadata. Xcode's "Debug Memory Graph" and equivalent tools use it.

Macros

Tool Library Use
swift-plugin-server lib/Macros/ Out-of-process host for user-defined Swift macros.
libMockPlugin lib/Macros/ Mock plugin used by the macros test infrastructure.

Macros are loaded as compiler plugins; for trust and isolation, they execute in a separate process.

Module / API tools

Tool Library Use
swift-stdlib-tool - Apple-platform helper to bundle stdlib dylibs.
swift-compatibility-symbols - Reports the back-compat symbols emitted by an stdlib build.
swift-def-to-strings-converter lib/Localization/ Convert DiagnosticsXxx.def to .strings for translation.
swift-serialize-diagnostics - Encode diagnostics into the .dia format consumed by Xcode.
swift-function-caller-generator - Generate thunks for cross-language function calls.
swift-scan-test lib/DependencyScan/ Drive the dependency-scan library.

Debug-info / LLDB integration

Tool Library Use
lldb-moduleimport-test lib/Frontend/ Test the LLDB-private importer entry point.
libStaticMirror lib/StaticMirror/ Static reflection reader used by symbolgraph and tools.

Where to find a tool's tests

Each tool has a corresponding directory under test/ (e.g., test/Demangle/, test/IDE/, test/refactoring/, test/SymbolGraph/, test/SwiftDemangle/). The test files use // RUN: %target-<tool> substitutions defined in test/lit.cfg.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Auxiliary tools – Swift wiki | Factory