Currently MCContext tries to lookup CWD on construction. This causes sandboxing violations when using LLVM in a daemon without filesystem access. The solution is defer CWD lookup until absolutely necessary.
The goal here makes perfect sense, but I wonder if this is the right fix... It seems almost too surgical, and makes it really easy to change MC in a way that yet again violates things.
I feel like the MCContext shouldn't be looking at the filesystem *at all*, and it should be the client that sets up the MCContext that provides a compilation directory, potentially via the filesystem query, where appropriate. Does that make sense here?
It's used to resolve relative paths encoded elsewhere in dwarf. I think all
the clients building an mccontext either have an analog (clang) or can
reasonably directly query their cwd (llc and friends).