The size of the value described by a form can depend on DWARF format (32/64-bit), DWARF version, or the size of a target address. Collect these parameters into a class to make it simpler to pass them around, and have just one place to define query methods that understand the effect of the parameters on form sizes.
Inspired by review comments on D33155. This patch seemed worth splitting out as it was a bunch of typing and fiddled with an API, while still being NFC. A subsequent step would be to collect up the section references needed for retrieving the value (as opposed to the size) of the attribute described be the form, which should finish the job of making DWARFFormValue agnostic to whether the data comes from a "unit" or a line-table section.
This seems like a bit more encapsulation than I'd expect/seems warranted for a few parameters.
Especially the protected ctor, imho - it doesn't change any invariants of the class (the 3-arg ctor can be used to construct a default constructed object) & doesn't seem to protect from any really trivial misuse.
Also the 3-arg ctor would be about as good as braced init, and the value can be changed at any time with assignment anyway - maybe make this a struct? & leave the getRefAddrByteSize+getDwarfOffsetByteSize member functions for convenience - but I'd strip the rest of the accessors/ctors/friending out and make it a struct.