Commit Graph

3 Commits

Author SHA1 Message Date
Saleem Abdulrasool
b74f42602a runtime: add and switch to SWIFT_USED (NFC)
This further trims dependencies to LLVMSupport by introducing the
equivalent `SWIFT_USED` macro.
2020-05-06 21:19:14 -07:00
David Zarzycki
b032d0b38f [Runtime] NFC: Move LLVM_ATTRIBUTE_USED from declaration to definition
This is both more correct and now required to keep building with
top-of-tree clang.
2019-03-08 12:35:53 -05:00
Michael Gottesman
ba9946a131 Add a dumper/verifier for OpaqueExistentialContainers (i.e. Any) in c++.
The dumper method dumps:

1. The container's metadata pointer.
2. A pointer to the container's value.
3. Whether or not said value is stored inline in the container.

This provides a general overview that can be used even when working with SIL
code in the debugger by grabbing a pointer to swift Anys and then calling the
c++ any method upon them.

The verifier is intended to be used in conjunction with ASAN for maximum
effect to catch use-after-frees of existential boxes.

While implementing this I refactored some code from ExistentialTypeMetadata into
methods on OpaqueExistentialContainer. ExistentialTypeMetadata just calls these
methods now instead of implementing the code inline.
2018-02-23 23:03:55 -08:00