diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-06-13 17:53:44 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-06-13 17:53:44 +0000 |
commit | e595e1ade02c7581a2e2ad5392f7714b7f342c05 (patch) | |
tree | 27b1ae2e276e69e5c3dd8a813b451e800070488c /clang/lib/CodeGen | |
parent | 51472bc600fc5622d50c6d9cefd88528b8c50f17 (diff) | |
download | bcm5719-llvm-e595e1ade02c7581a2e2ad5392f7714b7f342c05.tar.gz bcm5719-llvm-e595e1ade02c7581a2e2ad5392f7714b7f342c05.zip |
Remove top-level Clang -fsanitize= flags for optional ASan features.
Init-order and use-after-return modes can currently be enabled
by runtime flags. use-after-scope mode is not really working at the
moment.
The only problem I see is that users won't be able to disable extra
instrumentation for init-order and use-after-scope by a top-level Clang flag.
But this instrumentation was implicitly enabled for quite a while and
we didn't hear from users hurt by it.
llvm-svn: 210924
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/BackendUtil.cpp | 9 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 3 |
2 files changed, 2 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index e15d357354b..aa0893ef117 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -183,13 +183,8 @@ static void addAddressSanitizerPasses(const PassManagerBuilder &Builder, const PassManagerBuilderWrapper &BuilderWrapper = static_cast<const PassManagerBuilderWrapper&>(Builder); const CodeGenOptions &CGOpts = BuilderWrapper.getCGOpts(); - const LangOptions &LangOpts = BuilderWrapper.getLangOpts(); - PM.add(createAddressSanitizerFunctionPass(LangOpts.Sanitize.InitOrder, - LangOpts.Sanitize.UseAfterReturn, - LangOpts.Sanitize.UseAfterScope)); - PM.add(createAddressSanitizerModulePass( - LangOpts.Sanitize.InitOrder, - CGOpts.SanitizerBlacklistFile)); + PM.add(createAddressSanitizerFunctionPass()); + PM.add(createAddressSanitizerModulePass(CGOpts.SanitizerBlacklistFile)); } static void addMemorySanitizerPass(const PassManagerBuilder &Builder, diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 8d6b4188733..12c520792fc 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -795,9 +795,6 @@ static bool shouldUseMemSetPlusStoresToInitialize(llvm::Constant *Init, /// Should we use the LLVM lifetime intrinsics for the given local variable? static bool shouldUseLifetimeMarkers(CodeGenFunction &CGF, const VarDecl &D, unsigned Size) { - // Always emit lifetime markers in -fsanitize=use-after-scope mode. - if (CGF.getLangOpts().Sanitize.UseAfterScope) - return true; // For now, only in optimized builds. if (CGF.CGM.getCodeGenOpts().OptimizationLevel == 0) return false; |