diff options
author | Eric Christopher <echristo@gmail.com> | 2016-03-14 08:10:47 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2016-03-14 08:10:47 +0000 |
commit | c2c3a545c1e878496b82b580a927f5e8f46f68e1 (patch) | |
tree | 40979269315bcf7f42556c03f9fde2eee609501a /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 0f97f17152840ca0f3d5ea124984ba45bb04edbd (diff) | |
download | bcm5719-llvm-c2c3a545c1e878496b82b580a927f5e8f46f68e1.tar.gz bcm5719-llvm-c2c3a545c1e878496b82b580a927f5e8f46f68e1.zip |
Temporarily make discard value names depend on whether or not we're
trying to track origins in the memory sanitizer since the backend
instrumentation pass currently takes names from the Instruction.
Fixes all of the origin tracking tests in compiler-rt after the
-discard-value-name option was added.
llvm-svn: 263412
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index dee425eb88b..980a685a150 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -541,7 +541,6 @@ 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)) { @@ -794,6 +793,12 @@ 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; } |