Add a new frontend option for debugging called '-disable-incremental-llvm-codegen'.

Currently IRGen stores hashes of the bitcode generated by swift in object files.
This is then used to reduce compile time by not re-codegening if a subsequent
compilation yields a bit code with the same hash.

This is good for users and general compilation, but can result in confusion when
attempting to measure the "real" compile time of the compiler.

By default it is off.
This commit is contained in:
Michael Gottesman
2016-02-28 18:44:28 -08:00
parent ae53c1c219
commit aebc5baf84
4 changed files with 18 additions and 2 deletions

View File

@@ -1202,6 +1202,10 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
Opts.GenerateProfile |= Args.hasArg(OPT_profile_generate);
Opts.PrintInlineTree |= Args.hasArg(OPT_print_llvm_inline_tree);
// This is set to true by default.
Opts.UseIncrementalLLVMCodeGen &=
!Args.hasArg(OPT_disable_incremental_llvm_codegeneration);
if (Args.hasArg(OPT_embed_bitcode))
Opts.EmbedMode = IRGenEmbedMode::EmbedBitcode;
else if (Args.hasArg(OPT_embed_bitcode_marker))