<div dir="ltr">Yeah - how are they relying on them in a non-asserts build anyway? (were we naming certain things regardless of +/-Asserts? (well, I know we were naming some things, but mostly down in LLVM, I thought Clang generally used the IRBuilder & thus didn't name things in non-Asserts builds))</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 14, 2016 at 6:36 AM, Chandler Carruth via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">A long time ago I argued that the sanitizers should be using debug info instead of alloca names for this, and I really thought that they had implemented this... Is that not the case?<div><br></div><div>It is really bad that the sanitizers are relying on this stuff...</div><div><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Mon, Mar 14, 2016 at 2:28 PM Benjamin Kramer via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: d0k<br>
Date: Mon Mar 14 08:23:58 2016<br>
New Revision: 263429<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=263429&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=263429&view=rev</a><br>
Log:<br>
[Frontend] Disable value name discarding for all sanitizers.<br>
<br>
ASan also relies on names on allocas and will emit unhelpful output if<br>
they're not present. Just force-enable value names for now. Should<br>
unbreak release builds of asan.<br>
<br>
Modified:<br>
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
<br>
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=263429&r1=263428&r2=263429&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=263429&r1=263428&r2=263429&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)<br>
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Mar 14 08:23:58 2016<br>
@@ -541,6 +541,7 @@ static bool ParseCodeGenArgs(CodeGenOpti<br>
   Opts.DisableFPElim =<br>
       (Args.hasArg(OPT_mdisable_fp_elim) || Args.hasArg(OPT_pg));<br>
   Opts.DisableFree = Args.hasArg(OPT_disable_free);<br>
+  Opts.DiscardValueNames = Args.hasArg(OPT_discard_value_names);<br>
   Opts.DisableTailCalls = Args.hasArg(OPT_mdisable_tail_calls);<br>
   Opts.FloatABI = Args.getLastArgValue(OPT_mfloat_abi);<br>
   if (Arg *A = Args.getLastArg(OPT_meabi)) {<br>
@@ -793,12 +794,6 @@ static bool ParseCodeGenArgs(CodeGenOpti<br>
   Opts.CudaGpuBinaryFileNames =<br>
       Args.getAllArgValues(OPT_fcuda_include_gpubinary);<br>
<br>
-  // DiscardValueNames is set here so that it can depend (perhaps temporarily)<br>
-  // on other options.<br>
-  // We check SanitizeMemoryTrackOrigins here because the backend pass depends<br>
-  // on the name of the alloca in order to print out names.<br>
-  Opts.DiscardValueNames =<br>
-      Args.hasArg(OPT_discard_value_names) && !Opts.SanitizeMemoryTrackOrigins;<br>
   return Success;<br>
 }<br>
<br>
@@ -2158,6 +2153,12 @@ bool CompilerInvocation::CreateFromArgs(<br>
     if (Res.getFrontendOpts().ProgramAction == frontend::RewriteObjC)<br>
       Res.getLangOpts()->ObjCExceptions = 1;<br>
   }<br>
+<br>
+  // FIXME: Override value name discarding when sanitizers are used because the<br>
+  // backend passes depend on the name of the alloca in order to print out<br>
+  // names.<br>
+  Res.getCodeGenOpts().DiscardValueNames &= Res.getLangOpts()->Sanitize.empty();<br>
+<br>
   // FIXME: ParsePreprocessorArgs uses the FileManager to read the contents of<br>
   // PCH file and find the original header name. Remove the need to do that in<br>
   // ParsePreprocessorArgs and remove the FileManager<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div></div></div></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>