aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-04-24 06:57:01 +0000
committerKostya Serebryany <kcc@google.com>2012-04-24 06:57:01 +0000
commitc9fe6056e4ce8ffad1ef439fca3318a5faf1c075 (patch)
treef18e188f2dbd00fc655808c23d90c0e187611d60 /lib/CodeGen/CodeGenModule.cpp
parent8ac95f19e6b8efc453de972dfb22ca56d54c627e (diff)
enable TBAA when -fthread-sanitizer is given, even with -O0 or -relaxed-aliasing
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 9a55c08480..0b1ddc15be 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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