Files
swift-mirror/test/Demangle/demangle-special-options.test
Dave Lee c3488c60e1 Demangler: Add option to omit closure signatures (#73331)
Add a new demangler option which excludes a closure's type signature.

This will be used in lldb.

Closures are not subject to overloading, and so the signature will never be used to 
disambiguate. A demangled closure is uniquely identifiable by its index(s) and parent.

Where opaque types are involved, the concrete type signature can be quite complex. This 
demangling option allows callers to avoid printing the underlying complex nested 
concrete types.

Example:

before: `closure #1 (Swift.Int) -> () in closure #1 (Swift.Int) -> () in main`
after: `closure #1 in closure #1 in main`
2024-04-30 12:48:02 -07:00

22 lines
1.0 KiB
Plaintext

RUN: swift-demangle -display-stdlib-module=true sSi | %FileCheck %s --check-prefix=SWIFT-INT
SWIFT-INT: {{ Swift.Int$}}
RUN: swift-demangle -display-stdlib-module=false sSi | %FileCheck %s --check-prefix=INT
INT: {{ Int$}}
RUN: swift-demangle -display-objc-module=true sSo6CGRectVD | %FileCheck %s --check-prefix=OBJC-CGRECT
OBJC-CGRECT: {{ __C.CGRect$}}
RUN: swift-demangle -display-objc-module=false sSo6CGRectVD | %FileCheck %s --check-prefix=CGRECT
CGRECT: {{ CGRect$}}
RUN: swift-demangle -hiding-module=foo _TtC3foo3bar | %FileCheck %s --check-prefix=BAR
BAR: {{ bar$}}
RUN: swift-demangle -display-local-name-contexts=true s1a4mainyyFySRys5UInt8VGXEfU4_10ByteBufferL_aD | %FileCheck %s --check-prefix=LOCAL
LOCAL: ByteBuffer #1 in closure #6
RUN: swift-demangle -display-local-name-contexts=false s1a4mainyyFySRys5UInt8VGXEfU4_10ByteBufferL_aD | %FileCheck %s --check-prefix=NOLOCAL
NOLOCAL: {{ ByteBuffer$}}
RUN: swift-demangle -show-closure-signature=false s4mainySiXEfU_ySiXEfU_ | %FileCheck %s --check-prefix=CLOSURE
CLOSURE: closure #1 in closure #1 in main