This patch actually brings clang-refactor to a usable state as it can now apply the refactoring changes to the source files.
The -selection option is now also fully supported.
Details
Details
- Reviewers
ioeric hokein klimek - Commits
- rGe1b7b959012b: Recommit r315738 "[clang-refactor] Apply source replacements"
rG57e060b30985: [clang-refactor] Apply source replacements
rC315918: Recommit r315738 "[clang-refactor] Apply source replacements"
rC315738: [clang-refactor] Apply source replacements
rL315918: Recommit r315738 "[clang-refactor] Apply source replacements"
rL315738: [clang-refactor] Apply source replacements
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
| test/Refactor/tool-apply-replacements.cpp | ||
|---|---|---|
| 6 ↗ | (On Diff #117133) | Why is the result class {? |
| tools/clang-refactor/ClangRefactor.cpp | ||
| 319 ↗ | (On Diff #117133) | I think Changes or SourceChanges would be a clearer variable name. |
| 330 ↗ | (On Diff #117133) | s/AllSourceReplacements/Changes or SourceChanges for clarity. |
| 410 ↗ | (On Diff #117133) | s/Replacements/Changes/ ? |
| 416 ↗ | (On Diff #117133) | I think we would also want to clean up by default in the future. Maybe add this to FIXME as well? |
Comment Actions
Address review comments
| test/Refactor/tool-apply-replacements.cpp | ||
|---|---|---|
| 6 ↗ | (On Diff #117133) | Sorry, the test was broken. Fixed! |
| include/clang/Frontend/CommandLineSourceLoc.h | ||
|---|---|---|
| 57 ↗ | (On Diff #118042) | Add a comment documenting what the first element and second element of the pair represent for (<Line, Column>? If I understand correctly). |
| 60 ↗ | (On Diff #118042) | Would be clearer to document the valid format of the Str. |
| test/Refactor/tool-apply-replacements.cpp | ||
| 3 ↗ | (On Diff #118042) | Maybe add one more case for testing -selection=%t.cp.cpp:6:7-6:15. |
| tools/clang-refactor/ClangRefactor.cpp | ||
| 309 ↗ | (On Diff #118042) | Add override. |
| 313 ↗ | (On Diff #118042) | The same, override. |
| 412 ↗ | (On Diff #118042) | nit: missing a blank after open. |