This is follow-up from https://reviews.llvm.org/D132801, but taking into account the conditions
where the module-map flags are still used even when -fmodules is disabled.
This useful for removing unnecessary input dependencies from the cc1 invocation.