mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Add SIL builtin for Thread Sanitizer inout accesses
...and IRGen it into a call to __tsan_write1 in compiler-rt. This is preparatory work for a later patch that will add an experimental option to treat Swift inout accesses as TSan writes.
This commit is contained in:
@@ -214,6 +214,14 @@ void IRGenFunction::emitDeallocRawCall(llvm::Value *pointer,
|
||||
{pointer, size, alignMask});
|
||||
}
|
||||
|
||||
void IRGenFunction::emitTSanInoutAccessCall(llvm::Value *address) {
|
||||
llvm::Function *fn = cast<llvm::Function>(IGM.getTSanInoutAccessFn());
|
||||
|
||||
llvm::Value *castAddress = Builder.CreateBitCast(address, IGM.Int8PtrTy);
|
||||
Builder.CreateCall(fn, {castAddress});
|
||||
}
|
||||
|
||||
|
||||
/// Initialize a relative indirectable pointer to the given value.
|
||||
/// This always leaves the value in the direct state; if it's not a
|
||||
/// far reference, it's the caller's responsibility to ensure that the
|
||||
|
||||
Reference in New Issue
Block a user