Use raw module format to fix -gmodules crash

To avoid `llvm::report_fatal_error("unknown module format")` in getPCHContainerWriter.
See a3e2ff19e5
This commit is contained in:
Fangrui Song 2023-01-15 12:10:05 -08:00
parent 2468edc0b3
commit 8bc3959537

View File

@ -175,6 +175,8 @@ buildCompilerInvocation(const std::string &main, std::vector<const char *> args,
ci->getPreprocessorOpts().ImplicitPCHInclude.clear();
ci->getPreprocessorOpts().PrecompiledPreambleBytes = {0, false};
ci->getPreprocessorOpts().PCHThroughHeader.clear();
ci->getHeaderSearchOpts().ModuleFormat = "raw";
return ci;
}