This patch encapsulates the encoding and decoding logic of basic block metadata into the Metadata struct, and also reduces the decoded size of SHT_LLVM_BB_ADDR_MAP section.
The patch would've looked more readable if we could use designated initializer, but that is a c++20 feature.
Nit: I'd add blank lines either side of this method.