Regular expression patterns passed through the command line are being used to create an instances of llvm::Regex and thrown away.
There is no API to serialize Regex back to the original pattern. This means we have no way to reconstruct the original pattern from command line. This is necessary for serializing CompilerInvocation.
This patch stores the original pattern string in CodeGenOptions alongside the llvm::Regex instance.
This could also be: