r263412 - Temporarily make discard value names depend on whether or not we're

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 14 01:10:48 PDT 2016


Author: echristo
Date: Mon Mar 14 03:10:47 2016
New Revision: 263412

URL: http://llvm.org/viewvc/llvm-project?rev=263412&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=263412&r1=263411&r2=263412&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Mar 14 03:10:47 2016
@@ -541,7 +541,6 @@ static bool ParseCodeGenArgs(CodeGenOpti
   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(CodeGenOpti
   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;
 }
 




More information about the cfe-commits mailing list