Skip to content

Commit ba242d8

Browse files
committed
formating
1 parent 0a94da3 commit ba242d8

File tree

3 files changed

+28
-32
lines changed

3 files changed

+28
-32
lines changed

compiler-rt/lib/tysan/tysan.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,8 @@ static tysan_type_descriptor *getRootTD(tysan_type_descriptor *TD) {
102102
return RootTD;
103103
}
104104

105-
bool walkAliasTree(
106-
tysan_type_descriptor* TDA, tysan_type_descriptor* TDB,
107-
uptr OffsetA, uptr OffsetB
108-
){
105+
bool walkAliasTree(tysan_type_descriptor *TDA, tysan_type_descriptor *TDB,
106+
uptr OffsetA, uptr OffsetB) {
109107
do {
110108
if (TDA == TDB)
111109
return OffsetA == OffsetB;
@@ -160,17 +158,19 @@ static bool isAliasingLegalUp(tysan_type_descriptor *TDA,
160158
return walkAliasTree(TDA, TDB, OffsetA, OffsetB);
161159
}
162160

163-
static bool isAliasingLegalWithOffset(tysan_type_descriptor *AccessTD, tysan_type_descriptor *ShadowTD, int OffsetInShadow){
161+
static bool isAliasingLegalWithOffset(tysan_type_descriptor *AccessTD,
162+
tysan_type_descriptor *ShadowTD,
163+
int OffsetInShadow) {
164164
// This is handled in the other cases
165-
if(OffsetInShadow == 0)
165+
if (OffsetInShadow == 0)
166166
return false;
167-
167+
168168
// You can't have an offset into a member
169-
if(ShadowTD->Tag == TYSAN_MEMBER_TD)
169+
if (ShadowTD->Tag == TYSAN_MEMBER_TD)
170170
return false;
171171

172172
int OffsetInAccess = 0;
173-
if(AccessTD->Tag == TYSAN_MEMBER_TD){
173+
if (AccessTD->Tag == TYSAN_MEMBER_TD) {
174174
OffsetInAccess = AccessTD->Member.Offset;
175175
AccessTD = AccessTD->Member.Base;
176176
}

compiler-rt/test/tysan/derrived_default_constructor.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22

33
#include <stdio.h>
44

5-
class Inner{
5+
class Inner {
66
public:
7-
void* ptr = nullptr;
7+
void *ptr = nullptr;
88
};
99

10-
class Base{
10+
class Base {
1111
public:
12-
void* buffer1;
13-
Inner inside;
14-
void* buffer2;
12+
void *buffer1;
13+
Inner inside;
14+
void *buffer2;
1515
};
1616

17-
class Derrived : public Base{
18-
19-
};
17+
class Derrived : public Base {};
2018

2119
Derrived derr;
2220

23-
int main(){
24-
printf("%p", derr.inside.ptr);
21+
int main() {
22+
printf("%p", derr.inside.ptr);
2523

26-
return 0;
24+
return 0;
2725
}

compiler-rt/test/tysan/inherited_member.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22

33
#include <stdio.h>
44

5-
class Base{
5+
class Base {
66
public:
7-
void* first;
8-
void* second;
9-
void* third;
7+
void *first;
8+
void *second;
9+
void *third;
1010
};
1111

12-
class Derrived : public Base{
13-
14-
};
12+
class Derrived : public Base {};
1513

1614
Derrived derr;
1715

18-
int main(){
19-
derr.second = nullptr;
20-
printf("%p", derr.second);
16+
int main() {
17+
derr.second = nullptr;
18+
printf("%p", derr.second);
2119

22-
return 0;
20+
return 0;
2321
}

0 commit comments

Comments
 (0)