Skip to content

Commit

Permalink
Use raw module format to fix -gmodules crash
Browse files Browse the repository at this point in the history
To avoid `llvm::report_fatal_error("unknown module format")` in getPCHContainerWriter.
See llvm/llvm-project@a3e2ff1
  • Loading branch information
MaskRay committed Jan 15, 2023
1 parent 2468edc commit 8bc3959
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/clang_tu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8bc3959

Please sign in to comment.