Opts.DisableFPElim =
(Args.hasArg(OPT_mdisable_fp_elim) || Args.hasArg(OPT_pg));
Opts.DisableFree = Args.hasArg(OPT_disable_free);
+ Opts.DiscardValueNames = Args.hasArg(OPT_discard_value_names);
Opts.DisableTailCalls = Args.hasArg(OPT_mdisable_tail_calls);
Opts.FloatABI = Args.getLastArgValue(OPT_mfloat_abi);
if (Arg *A = Args.getLastArg(OPT_meabi)) {
Opts.CudaGpuBinaryFileNames =
Args.getAllArgValues(OPT_fcuda_include_gpubinary);
- // DiscardValueNames is set here so that it can depend (perhaps temporarily)
- // on other options.
- // We check SanitizeMemoryTrackOrigins here because the backend pass depends
- // on the name of the alloca in order to print out names.
- Opts.DiscardValueNames =
- Args.hasArg(OPT_discard_value_names) && !Opts.SanitizeMemoryTrackOrigins;
return Success;
}
if (Res.getFrontendOpts().ProgramAction == frontend::RewriteObjC)
Res.getLangOpts()->ObjCExceptions = 1;
}
+
+ // FIXME: Override value name discarding when sanitizers are used because the
+ // backend passes depend on the name of the alloca in order to print out
+ // names.
+ Res.getCodeGenOpts().DiscardValueNames &= Res.getLangOpts()->Sanitize.empty();
+
// FIXME: ParsePreprocessorArgs uses the FileManager to read the contents of
// PCH file and find the original header name. Remove the need to do that in
// ParsePreprocessorArgs and remove the FileManager