enable TBAA when -fthread-sanitizer is given, even with -O0 or -relaxed-aliasing
llvm-svn: 155430
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user