mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Introduce SWIFT_STDLIB_HAS_TYPE_PRINTING flag to remove the ability to print types at runtime (to save codesize) (#40649)
This commit is contained in:
committed by
GitHub
parent
4405620aa6
commit
663a6fb771
@@ -76,6 +76,8 @@ extern "C" const void *swift_dynamicCastObjCProtocolConditional(
|
||||
Protocol * const *protocols);
|
||||
#endif
|
||||
|
||||
#if SWIFT_STDLIB_HAS_TYPE_PRINTING
|
||||
|
||||
// Build a user-comprehensible name for a type.
|
||||
static void _buildNameForMetadata(const Metadata *type,
|
||||
bool qualified,
|
||||
@@ -124,6 +126,13 @@ std::string swift::nameForMetadata(const Metadata *type,
|
||||
return result;
|
||||
}
|
||||
|
||||
#else // SWIFT_STDLIB_HAS_TYPE_PRINTING
|
||||
|
||||
std::string swift::nameForMetadata(const Metadata *type, bool qualified) {
|
||||
return "<<< type printer not available >>>";
|
||||
}
|
||||
|
||||
#endif // SWIFT_STDLIB_HAS_TYPE_PRINTING
|
||||
|
||||
/// Used as part of cache key for `TypeNameCache`.
|
||||
enum class TypeNameKind {
|
||||
|
||||
Reference in New Issue
Block a user