mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 10:55:58 +08:00
LLDB currently defines `dw_form_t` as a `uint16_t` which makes sense. However, LLVM also defines a similar type `llvm::dwarf::Form` which is an enum backed by a `uint16_t`. Switching to the llvm implementation means that we can more easily interoperate with the LLVM DWARF code. Additionally, we get some type checking out of this: I found that DWARFAttribute had a method called `FormAtIndex` that returned a `dw_attr_t`. Although `dw_attr_t` is also a `uint16_t` under the hood, the type checking benefits here are undeniable: If this had returned a something of different signedness/width, we could have had some bad bugs. Differential Revision: https://reviews.llvm.org/D150228