Skip to content

Commit 77b102e

Browse files
Merge pull request #612 from andreasfertig/cfrontLessStraySemis
Less stray semis in Cfront mode.
2 parents 8839235 + 1eff031 commit 77b102e

13 files changed

Lines changed: 6 additions & 25 deletions

CfrontCodeGenerator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,8 @@ void CfrontCodeGenerator::InsertArg(const CXXConstructExpr* stmt)
863863
// InsertArg(Ref(vd));
864864
}
865865

866+
mInsertSemi = false;
867+
866868
} else if(tmpObjectExpr) {
867869
auto* varNameRef = Ref(mkVarDeclRefExpr(GetName(*tmpObjectExpr), stmt->getType()));
868870

tests/EduCfrontReferencesTest.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ int __main(void)
3434
i = i + 2;
3535
Fun(&i);
3636
A a;
37-
;
3837
return 0;
3938
/* a // lifetime ends here */
4039
/* f // lifetime ends here */

tests/EduCfrontTest.expect

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,11 @@ inline void Destructor_Other(Other * __this);
7979
int __main(void)
8080
{
8181
Apple a;
82-
;
8382
Set(&a, 4);
8483
Apple * paaa = nullptr;
8584
Set(paaa, 5);
8685
Apple b;
87-
;
8886
Apple c;
89-
;
9087
operatorEqual(&b, &a);
9188
return 0;
9289
Destructor_Apple(&c);

tests/EduCfrontTest13.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ int __main(void)
7575
D dvec[5];
7676
__cxa_vec_ctor(dvec, sizeof(D), 5, 0, (void *(*)(void *))Constructor_D, (void *(*)(void *))NULL);
7777
E e;
78-
;
7978
E * ep = Constructor_E((E *)malloc(sizeof(E)));
8079
if(a) {
8180
free(a);

tests/EduCfrontTest14.expect

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ int __main(void)
6464
}
6565

6666
B b1;
67-
;
6867
B b2;
69-
;
7068
return 0;
7169
/* b2 // lifetime ends here */
7270
/* b1 // lifetime ends here */

tests/EduCfrontTest16.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ inline void Destructor_Alloc(Alloc * __this)
3838
int __main(void)
3939
{
4040
Alloc a;
41-
;
4241
return 0;
4342
Destructor_Alloc(&a);
4443
;

tests/EduCfrontTest17.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ typedef struct Foo
3232
int __main(void)
3333
{
3434
Foo<int> f;
35-
;
3635
return 0;
3736
/* f // lifetime ends here */
3837
;

tests/EduCfrontTest19.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ struct Far;
1818
int __main(void)
1919
{
2020
Foo f;
21-
;
2221
return 0;
2322
/* f // lifetime ends here */
2423
;

tests/EduCfrontTest8.expect

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ inline void Destructor_Apple(Apple * __this)
3535
int __main(void)
3636
{
3737
Apple f;
38-
;
3938
alignas(Apple) char buffer[8] = {'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'};
4039
Apple * b = Constructor_Apple((Apple *)(void *)buffer, 4, 5);
4140
printf("Created\n");

tests/EduCfrontTestCopyAssign.expect

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ inline Apple * operatorEqual(Apple * __this, const Apple * __rhs)
4545
int __main(void)
4646
{
4747
Apple a;
48-
;
4948
Apple b;
50-
;
5149
operatorEqual(&b, &a);
5250
return 0;
5351
Destructor_Apple(&b);

0 commit comments

Comments
 (0)