Skip to content

Commit 5dd38d7

Browse files
committed
[style] fixed the code style
1 parent b218336 commit 5dd38d7

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

compiler-rt/lib/tysan/tysan.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ __tysan_instrument_mem_inst(char *dest, char *src, uint64_t size,
265265
bool needsMemMove) {
266266
tysan_type_descriptor **destShadowDataPtr = shadow_for(dest);
267267

268-
if(!src){
269-
internal_memset((char*) destShadowDataPtr, 0, size << PtrShift());
268+
if (!src) {
269+
internal_memset((char *)destShadowDataPtr, 0, size << PtrShift());
270270
return;
271271
}
272272

@@ -275,9 +275,9 @@ __tysan_instrument_mem_inst(char *dest, char *src, uint64_t size,
275275
uint64_t *srcShadow = (uint64_t *)srcShadowInt;
276276

277277
if (needsMemMove) {
278-
internal_memmove((char*) destShadowDataPtr, srcShadow, size << PtrShift());
278+
internal_memmove((char *)destShadowDataPtr, srcShadow, size << PtrShift());
279279
} else {
280-
internal_memcpy((char*) destShadowDataPtr, srcShadow, size << PtrShift());
280+
internal_memcpy((char *)destShadowDataPtr, srcShadow, size << PtrShift());
281281
}
282282
}
283283

llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -161,29 +161,29 @@ void TypeSanitizer::initializeCallbacks(Module &M) {
161161
TysanCtorFunction =
162162
M.getOrInsertFunction(kTysanModuleCtorName, Attr, IRB.getVoidTy());
163163

164-
TysanIntrumentMemInst =
165-
M.getOrInsertFunction("__tysan_instrument_mem_inst", Attr, IRB.getVoidTy(),
166-
IRB.getPtrTy(), // Pointer of data to be written to
167-
IRB.getPtrTy(), // Pointer of data to write
168-
U64Ty, // Size of the data in bytes
169-
BoolType // Do we need to call memmove
170-
);
171-
172-
TysanInstrumentWithShadowUpdate =
173-
M.getOrInsertFunction("__tysan_instrument_with_shadow_update", Attr, IRB.getVoidTy(),
174-
IRB.getPtrTy(), // Pointer to data to be read
175-
IRB.getPtrTy(), // Pointer to type descriptor
176-
BoolType, // Do we need to type check this
177-
U64Ty, // Size of data we access in bytes
178-
OrdTy // Flags
179-
);
180-
181-
TysanSetShadowType =
182-
M.getOrInsertFunction("__tysan_set_shadow_type", Attr, IRB.getVoidTy(),
183-
IRB.getPtrTy(), // Pointer of data to be written to
184-
IRB.getPtrTy(), // Pointer to the new type descriptor
185-
U64Ty // Size of data we access in bytes
186-
);
164+
TysanIntrumentMemInst = M.getOrInsertFunction(
165+
"__tysan_instrument_mem_inst", Attr, IRB.getVoidTy(),
166+
IRB.getPtrTy(), // Pointer of data to be written to
167+
IRB.getPtrTy(), // Pointer of data to write
168+
U64Ty, // Size of the data in bytes
169+
BoolType // Do we need to call memmove
170+
);
171+
172+
TysanInstrumentWithShadowUpdate = M.getOrInsertFunction(
173+
"__tysan_instrument_with_shadow_update", Attr, IRB.getVoidTy(),
174+
IRB.getPtrTy(), // Pointer to data to be read
175+
IRB.getPtrTy(), // Pointer to type descriptor
176+
BoolType, // Do we need to type check this
177+
U64Ty, // Size of data we access in bytes
178+
OrdTy // Flags
179+
);
180+
181+
TysanSetShadowType = M.getOrInsertFunction(
182+
"__tysan_set_shadow_type", Attr, IRB.getVoidTy(),
183+
IRB.getPtrTy(), // Pointer of data to be written to
184+
IRB.getPtrTy(), // Pointer to the new type descriptor
185+
U64Ty // Size of data we access in bytes
186+
);
187187
}
188188

189189
void TypeSanitizer::instrumentGlobals(Module &M) {
@@ -627,7 +627,7 @@ bool TypeSanitizer::instrumentWithShadowUpdate(
627627

628628
Value *TD = IRB.CreateBitCast(TDGV, IRB.getPtrTy());
629629

630-
if(ClOutlineInstrumentation){
630+
if (ClOutlineInstrumentation) {
631631
if (!ForceSetType && (!ClWritesAlwaysSetType || IsRead)) {
632632
// We need to check the type here. If the type is unknown, then the read
633633
// sets the type. If the type is known, then it is checked. If the type
@@ -638,7 +638,8 @@ bool TypeSanitizer::instrumentWithShadowUpdate(
638638
ConstantInt::get(OrdTy, (int)IsRead | (((int)IsWrite) << 1));
639639

640640
IRB.CreateCall(TysanInstrumentWithShadowUpdate,
641-
{Ptr, TD, SanitizeFunction ? IRB.getTrue() : IRB.getFalse(),
641+
{Ptr, TD,
642+
SanitizeFunction ? IRB.getTrue() : IRB.getFalse(),
642643
IRB.getInt64(AccessSize), Flags});
643644
} else if (ForceSetType || IsWrite) {
644645
// In the mode where writes always set the type, for a write (which does
@@ -893,14 +894,13 @@ bool TypeSanitizer::instrumentMemInst(Value *V, Instruction *ShadowBase,
893894
}
894895

895896
if (ClOutlineInstrumentation) {
896-
if(!Src){
897+
if (!Src) {
897898
Src = ConstantPointerNull::get(IRB.getPtrTy());
898899
}
899-
IRB.CreateCall(TysanIntrumentMemInst, {
900-
Dest, Src, Size, NeedsMemMove ? IRB.getTrue() : IRB.getFalse()
901-
});
902-
}
903-
else {
900+
IRB.CreateCall(
901+
TysanIntrumentMemInst,
902+
{Dest, Src, Size, NeedsMemMove ? IRB.getTrue() : IRB.getFalse()});
903+
} else {
904904
if (!ShadowBase)
905905
ShadowBase = getShadowBase(*F);
906906
if (!AppMemMask)
@@ -914,8 +914,8 @@ bool TypeSanitizer::instrumentMemInst(Value *V, Instruction *ShadowBase,
914914
Value *ShadowData = IRB.CreateIntToPtr(ShadowDataInt, IRB.getPtrTy());
915915

916916
if (!Src) {
917-
IRB.CreateMemSet(ShadowData, IRB.getInt8(0), IRB.CreateShl(Size, PtrShift),
918-
Align(1ull << PtrShift));
917+
IRB.CreateMemSet(ShadowData, IRB.getInt8(0),
918+
IRB.CreateShl(Size, PtrShift), Align(1ull << PtrShift));
919919
return true;
920920
}
921921

@@ -931,7 +931,7 @@ bool TypeSanitizer::instrumentMemInst(Value *V, Instruction *ShadowBase,
931931
Align(1ull << PtrShift), IRB.CreateShl(Size, PtrShift));
932932
} else {
933933
IRB.CreateMemCpy(ShadowData, Align(1ull << PtrShift), SrcShadowData,
934-
Align(1ull << PtrShift), IRB.CreateShl(Size, PtrShift));
934+
Align(1ull << PtrShift), IRB.CreateShl(Size, PtrShift));
935935
}
936936
}
937937

0 commit comments

Comments
 (0)