Author: d0k
Date: Tue Mar 15 04:41:39 2016
New Revision: 263541

URL: http://llvm.org/viewvc/llvm-project?rev=263541&view=rev
Log:
Restrict the hack from r263429 to asan and msan.

The other sanitizers don't have backend passes that rely on value names.
Avoid paying the compile time cost of names there.

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=263541&r1=263540&r2=263541&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Tue Mar 15 04:41:39 2016
@@ -2154,10 +2154,12 @@ bool CompilerInvocation::CreateFromArgs(
       Res.getLangOpts()->ObjCExceptions = 1;
   }
 
-  // FIXME: Override value name discarding when sanitizers are used because the
+  // FIXME: Override value name discarding when asan or msan is 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();
+  Res.getCodeGenOpts().DiscardValueNames &=
+      !Res.getLangOpts()->Sanitize.has(SanitizerKind::Address) &&
+      !Res.getLangOpts()->Sanitize.has(SanitizerKind::Memory);
 
   // 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


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to