Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang-move] Support moving multiple classes in one run.
Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25309 llvm-svn: 283526
- Loading branch information
Showing
9 changed files
with
151 additions
and
16 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
27 changes: 27 additions & 0 deletions
27
clang-tools-extra/test/clang-move/Inputs/multiple_class_test.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,27 @@ | ||
#include "multiple_class_test.h" | ||
|
||
namespace a { | ||
int Move1::f() { | ||
return 0; | ||
} | ||
} // namespace a | ||
|
||
namespace b { | ||
int Move2::f() { | ||
return 0; | ||
} | ||
} // namespace b | ||
|
||
namespace c { | ||
int Move3::f() { | ||
return 0; | ||
} | ||
|
||
int Move4::f() { | ||
return 0; | ||
} | ||
|
||
int NoMove::f() { | ||
return 0; | ||
} | ||
} // namespace c |
30 changes: 30 additions & 0 deletions
30
clang-tools-extra/test/clang-move/Inputs/multiple_class_test.h
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,30 @@ | ||
namespace a { | ||
class Move1 { | ||
public: | ||
int f(); | ||
}; | ||
} // namespace a | ||
|
||
namespace b { | ||
class Move2 { | ||
public: | ||
int f(); | ||
}; | ||
} // namespace b | ||
|
||
namespace c { | ||
class Move3 { | ||
public: | ||
int f(); | ||
}; | ||
|
||
class Move4 { | ||
public: | ||
int f(); | ||
}; | ||
|
||
class NoMove { | ||
public: | ||
int f(); | ||
}; | ||
} // namespace c |
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
58 changes: 58 additions & 0 deletions
58
clang-tools-extra/test/clang-move/move-multiple-classes.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,58 @@ | ||
// RUN: mkdir -p %T/clang-move/build | ||
// RUN: sed 's|$test_dir|%/T/clang-move|g' %S/Inputs/database_template.json > %T/clang-move/compile_commands.json | ||
// RUN: cp %S/Inputs/multiple_class_test* %T/clang-move/ | ||
// RUN: cd %T/clang-move | ||
// RUN: clang-move -names="a::Move1, b::Move2,c::Move3,c::Move4" -new_cc=%T/clang-move/new_multiple_class_test.cpp -new_header=%T/clang-move/new_multiple_class_test.h -old_cc=%T/clang-move/multiple_class_test.cpp -old_header=../clang-move/multiple_class_test.h %T/clang-move/multiple_class_test.cpp | ||
// RUN: FileCheck -input-file=%T/clang-move/new_multiple_class_test.cpp -check-prefix=CHECK-NEW-TEST-CPP %s | ||
// RUN: FileCheck -input-file=%T/clang-move/new_multiple_class_test.h -check-prefix=CHECK-NEW-TEST-H %s | ||
// RUN: FileCheck -input-file=%T/clang-move/multiple_class_test.cpp -check-prefix=CHECK-OLD-TEST-CPP %s | ||
// RUN: FileCheck -input-file=%T/clang-move/multiple_class_test.h -check-prefix=CHECK-OLD-TEST-H %s | ||
// | ||
// CHECK-OLD-TEST-H: namespace c { | ||
// CHECK-OLD-TEST-H: class NoMove { | ||
// CHECK-OLD-TEST-H: public: | ||
// CHECK-OLD-TEST-H: int f(); | ||
// CHECK-OLD-TEST-H: }; | ||
// CHECK-OLD-TEST-H: } // namespace c | ||
|
||
// CHECK-OLD-TEST-CPP: #include "{{.*}}multiple_class_test.h" | ||
// CHECK-OLD-TEST-CPP: namespace c { | ||
// CHECK-OLD-TEST-CPP: int NoMove::f() { | ||
// CHECK-OLD-TEST-CPP: return 0; | ||
// CHECK-OLD-TEST-CPP: } | ||
// CHECK-OLD-TEST-CPP: } // namespace c | ||
|
||
// CHECK-NEW-TEST-H: namespace a { | ||
// CHECK-NEW-TEST-H: class Move1 { | ||
// CHECK-NEW-TEST-H: public: | ||
// CHECK-NEW-TEST-H: int f(); | ||
// CHECK-NEW-TEST-H: }; | ||
// CHECK-NEW-TEST-H: } // namespace a | ||
// CHECK-NEW-TEST-H: namespace b { | ||
// CHECK-NEW-TEST-H: class Move2 { | ||
// CHECK-NEW-TEST-H: public: | ||
// CHECK-NEW-TEST-H: int f(); | ||
// CHECK-NEW-TEST-H: }; | ||
// CHECK-NEW-TEST-H: } // namespace b | ||
// CHECK-NEW-TEST-H: namespace c { | ||
// CHECK-NEW-TEST-H: class Move3 { | ||
// CHECK-NEW-TEST-H: public: | ||
// CHECK-NEW-TEST-H: int f(); | ||
// CHECK-NEW-TEST-H: }; | ||
// CHECK-NEW-TEST-H: class Move4 { | ||
// CHECK-NEW-TEST-H: public: | ||
// CHECK-NEW-TEST-H: int f(); | ||
// CHECK-NEW-TEST-H: }; | ||
// CHECK-NEW-TEST-H: } // namespace c | ||
|
||
// CHECK-NEW-TEST-CPP: #include "{{.*}}new_multiple_class_test.h" | ||
// CHECK-NEW-TEST-CPP: namespace a { | ||
// CHECK-NEW-TEST-CPP: int Move1::f() { return 0; } | ||
// CHECK-NEW-TEST-CPP: } // namespace a | ||
// CHECK-NEW-TEST-CPP: namespace b { | ||
// CHECK-NEW-TEST-CPP: int Move2::f() { return 0; } | ||
// CHECK-NEW-TEST-CPP: } // namespace b | ||
// CHECK-NEW-TEST-CPP: namespace c { | ||
// CHECK-NEW-TEST-CPP: int Move3::f() { return 0; } | ||
// CHECK-NEW-TEST-CPP: int Move4::f() { return 0; } | ||
// CHECK-NEW-TEST-CPP: } // namespace c |
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