Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed an issue for rewriting record decls
When we have a record decl through its definition, we can only rewrite its definition once.
- Loading branch information
1 parent
921324f
commit d5bb977
Showing
11 changed files
with
142 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
clang_delta/tests/replace-derived-class/replace-derived1.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// RUN: %clang_delta --transformation=replace-derived-class --counter=1 %s 2>&1 | %remove_lit_checks | FileCheck %s | ||
|
||
struct a { | ||
~a(); | ||
}; | ||
// CHECK-NOT: struct X | ||
struct X : a {}; | ||
// CHECK: foo() { | ||
void foo() { | ||
// CHECK-NEXT: a *b; | ||
X *b; | ||
// CHECK-NEXT: b->~a(); | ||
b->~X(); | ||
// CHECK-NEXT: } | ||
} |
16 changes: 16 additions & 0 deletions
16
clang_delta/tests/replace-derived-class/replace-derived2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %clang_delta --transformation=replace-derived-class --counter=1 %s 2>&1 | %remove_lit_checks | FileCheck %s | ||
|
||
// CHECK: struct a { | ||
struct a { | ||
// CHECK-NEXT: ~a(); | ||
~a(); | ||
// CHECK-NEXT: }; | ||
}; | ||
// CHECK-NEXT: a *b; | ||
struct X : a {} *b; | ||
// CHECK-NEXT: void foo() { | ||
void foo() { | ||
// CHECK-NEXT: b->~a(); | ||
b->~X(); | ||
// CHECK-NEXT: } | ||
} |
16 changes: 16 additions & 0 deletions
16
clang_delta/tests/replace-derived-class/replace-derived3.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %clang_delta --transformation=replace-derived-class --counter=1 %s 2>&1 | %remove_lit_checks | FileCheck %s | ||
|
||
// CHECK: struct a { | ||
struct a { | ||
// CHECK-NEXT: ~a(); | ||
~a(); | ||
// CHECK-NEXT: }; | ||
}; | ||
// CHECK-NEXT: a *b; | ||
struct abcabcabcabcabcabcabca : a {} *b; | ||
// CHECK-NEXT: void foo() { | ||
void foo() { | ||
// CHECK-NEXT: b->~a(); | ||
b->~abcabcabcabcabcabcabca(); | ||
// CHECK-NEXT: } | ||
} |