The goal here is to make lldbUtility a library which depends on no other libraries. It seems like this library already exists in spirit as a place to house very low level code which is commonly used by all parts of LLDB, so it makes sense to designate this as the one top-level library. We can change the name in the future to something like Support if we choose to (implying that it is analogous to LLVMSupport), but for now I just want to break the dependencies.
So, this patch deletes a bunch of dead code and moves some code that is actually only used in 1-2 places up to where it's actually used.
This is not enough to get Utility dependency free. Further tasks that I've identified, but which are too large to fit into this patch, include:
- Move RegularExpression from Core -> Utility (Long term: Delete and use LLVM)
- Move Stream from Core -> Utility (Long term: Delete and use llvm::raw_ostream)
- Move ConstString from Core -> Utility
- Move ProcessStructReader from Utility -> Process
- Move RegisterNumber from Utility -> Target
- Move Error from Core -> Utility
- Try to convert ValueObject::GetSP() from SharingPtr to std::shared_ptr, then delete SharingPtr.
- Move ModuleCache from Utility -> Target
Finally, once all of those things are done, we can begin breaking up the lldb-private.h, and lldb-enumerations.h, etc header files and moving the enumerations to more appropriate locations, which will finally break this up.