diff options
author | Kostya Serebryany <kcc@google.com> | 2012-04-24 06:57:01 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-04-24 06:57:01 +0000 |
commit | 5dd2cfc81edf4c8f3aabc9b4e9be076b8fd0fc02 (patch) | |
tree | e3c2edd3e9a1fecdb926f6d574969dcc1016fe01 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 0b65c40821b6a0ce73d74924b1550f6ae7afd7f3 (diff) | |
download | bcm5719-llvm-5dd2cfc81edf4c8f3aabc9b4e9be076b8fd0fc02.tar.gz bcm5719-llvm-5dd2cfc81edf4c8f3aabc9b4e9be076b8fd0fc02.zip |
enable TBAA when -fthread-sanitizer is given, even with -O0 or -relaxed-aliasing
llvm-svn: 155430
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 9a55c084800..0b1ddc15be0 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -102,9 +102,10 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO, if (LangOpts.CUDA) createCUDARuntime(); - // Enable TBAA unless it's suppressed. - if (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0) - TBAA = new CodeGenTBAA(Context, VMContext, getLangOpts(), + // Enable TBAA unless it's suppressed. ThreadSanitizer needs TBAA even at O0. + if (LangOpts.ThreadSanitizer || + (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0)) + TBAA = new CodeGenTBAA(Context, VMContext, CodeGenOpts, getLangOpts(), ABI.getMangleContext()); // If debug info or coverage generation is enabled, create the CGDebugInfo |