These two methods are very similar and various refactorizations need to modify both similar ways. Merge them as a template.
One could also just remove GetCompileUnit and make GetCompileUnitContainingDIEOffset to also accept offset of the CU itself (currently it accepts only DIE offsets after the CU header). But that would be less safe regarding some internal sanity checking.
The whole patchset available for testing as: git clone -b debugtypes git://git.jankratochvil.net/lldb
Ah, I think I finally understand the --pos thingy. :)