summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-03-15 09:41:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-03-15 09:41:39 +0000
commitfd652b1b8ffc245c24f4db00260ba85b162f37f1 (patch)
tree38db3ae2681f1f24e3506728f4fa359938eaf47d
parentcb9dddb1d735c58e71eb9d2fb6c4599c9b9afd56 (diff)
downloadbcm5719-llvm-fd652b1b8ffc245c24f4db00260ba85b162f37f1.tar.gz
bcm5719-llvm-fd652b1b8ffc245c24f4db00260ba85b162f37f1.zip
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. llvm-svn: 263541
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index c21279450d1..d2643614670 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2154,10 +2154,12 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
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
OpenPOWER on IntegriCloud