summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-03-14 13:23:58 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-03-14 13:23:58 +0000
commit12f2de1a1fd0a341bb7b2d56c3f1a34967d395c9 (patch)
treed15fb68f5f057e330f1c23ae0f6c8db821d382ad
parentfba68931ed520c06636996f5b4295e7f0044ae7f (diff)
downloadbcm5719-llvm-12f2de1a1fd0a341bb7b2d56c3f1a34967d395c9.tar.gz
bcm5719-llvm-12f2de1a1fd0a341bb7b2d56c3f1a34967d395c9.zip
[Frontend] Disable value name discarding for all sanitizers.
ASan also relies on names on allocas and will emit unhelpful output if they're not present. Just force-enable value names for now. Should unbreak release builds of asan. llvm-svn: 263429
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 980a685a150..df32ca3e0f1 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -541,6 +541,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
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)) {
@@ -793,12 +794,6 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
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;
}
@@ -2158,6 +2153,12 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
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
OpenPOWER on IntegriCloud