Use functions with prototypes when appropriate; NFCA significant number of our tests in C accidentally use functionswithout prototypes. This patch converts the function signatures to havea protot
Use functions with prototypes when appropriate; NFCA significant number of our tests in C accidentally use functionswithout prototypes. This patch converts the function signatures to havea prototype for the situations where the test is not specific to K&R Cdeclarations. e.g., void func();becomes void func(void);This is the eighth batch of tests being updated (there are asignificant number of other tests left to be updated).
show more ...
[Tooling] Added DeclStmtClass to ExtractionSemicolonPolicySince the DeclStmt range includes the semicolon, it doesn't need asemicolon at the end during extractionllvm-svn: 368850
[Extract] Fixed SemicolonExtractionPolicy for SwitchStmt and SwitchCaseReviewers: arphaman, sammccallSubscribers: dexonsmith, cfe-commitsTags: #clangDifferential Revision: https://reviews.llv
[Extract] Fixed SemicolonExtractionPolicy for SwitchStmt and SwitchCaseReviewers: arphaman, sammccallSubscribers: dexonsmith, cfe-commitsTags: #clangDifferential Revision: https://reviews.llvm.org/D65883llvm-svn: 368267
[refactor][extract] avoid extracting expressions from types in functionsllvm-svn: 318169
[clang-refactor] Introduce a new rename rule for qualified symbolsSummary: Prototype of a new rename rule for renaming qualified symbol.Reviewers: arphaman, ioeric, sammccallReviewed By: arpham
[clang-refactor] Introduce a new rename rule for qualified symbolsSummary: Prototype of a new rename rule for renaming qualified symbol.Reviewers: arphaman, ioeric, sammccallReviewed By: arphaman, sammccallSubscribers: jklaehn, cfe-commits, klimekDifferential Revision: https://reviews.llvm.org/D39332llvm-svn: 317672
[refactor] rename field references in __builtin_offsetofrdar://33875453llvm-svn: 317599
Add -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 botsllvm-svn: 317372
[refactor][extract] insert semicolons into extracted/inserted codewhen neededThis commit implements the semicolon insertion logic into the extractrefactoring. The following rules are used:- ext
[refactor][extract] insert semicolons into extracted/inserted codewhen neededThis commit implements the semicolon insertion logic into the extractrefactoring. The following rules are used:- extracting expression: add terminating ';' to the extracted function.- extracting statements that don't require terminating ';' (e.g. switch): add terminating ';' to the callee.- extracting statements with ';': move (if possible) the original ';' from the callee and add terminating ';'.- otherwise, add ';' to both places.Differential Revision: https://reviews.llvm.org/D39441llvm-svn: 317343
[refactor][extract] code extracted from inline method should be placedin a function defined before the outer classllvm-svn: 317062
[refactor][extract] prohibit extraction of ObjC property settersllvm-svn: 317056
[refactor] Initial outline of implementation of "extract function" refactoringThis commit adds an initial, skeleton outline of the "extract function"refactoring. The extracted function doesn't cap
[refactor] Initial outline of implementation of "extract function" refactoringThis commit adds an initial, skeleton outline of the "extract function"refactoring. The extracted function doesn't capture variables / rewrite codeyet, it just basically does a simple copy-paste.The following initiation rules are specified:- extraction can only be done for executable code in a function/method/block. This means that you can't extract a global variable initialize into a function right now.- simple literals and references are not extractable.This commit also adds support for full source ranges to clang-refactor's testmode.Differential Revision: https://reviews.llvm.org/D38982llvm-svn: 316465
[clang-refactor] Add "-Inplace" option to the commandline tool.Summary:Change clang-refactor default behavior to print the new code after refactoring(instead of editing the source files), which w
[clang-refactor] Add "-Inplace" option to the commandline tool.Summary:Change clang-refactor default behavior to print the new code after refactoring(instead of editing the source files), which would make it easier to useand debug the refactoring action.Reviewers: arphaman, ioericReviewed By: arphamanSubscribers: cfe-commitsDifferential Revision: https://reviews.llvm.org/D39092llvm-svn: 316212
[refactor] allow the use of refactoring diagnosticsThis commit allows the refactoring library to use its own set ofrefactoring-specific diagnostics to reports things like initiation errors.Diffe
[refactor] allow the use of refactoring diagnosticsThis commit allows the refactoring library to use its own set ofrefactoring-specific diagnostics to reports things like initiation errors.Differential Revision: https://reviews.llvm.org/D38772llvm-svn: 315924
Recommit r315738 "[clang-refactor] Apply source replacements"The fixed commit ensures that ParsedSourceRange works correctlywith Windows paths.Original message:This commit actually brings clan
Recommit r315738 "[clang-refactor] Apply source replacements"The fixed commit ensures that ParsedSourceRange works correctlywith Windows paths.Original message:This commit actually brings clang-refactor to a usable state as it can nowapply the refactoring changes to source files.The -selection option is now also fully supported.Differential Revision: https://reviews.llvm.org/D38402llvm-svn: 315918
Revert r315738The ParsedSourceRange class does not work correctly on Windows with the ':'drive separatorsllvm-svn: 315774
[clang-refactor] Apply source replacementsThis commit actually brings clang-refactor to a usable state as it can nowapply the refactoring changes to source files.The -selection option is now also
[clang-refactor] Apply source replacementsThis commit actually brings clang-refactor to a usable state as it can nowapply the refactoring changes to source files.The -selection option is now also fully supported.Differential Revision: https://reviews.llvm.org/D38402llvm-svn: 315738
Recommit r315087 "[refactor] add support for refactoring options"The recommit fixes a UB bug that occurred only on a small number of bots.Original message:This commit adds initial support for r
Recommit r315087 "[refactor] add support for refactoring options"The recommit fixes a UB bug that occurred only on a small number of bots.Original message:This commit adds initial support for refactoring options. One can now useoptional and required std::string options.This commit also adds a NewNameOption for the local-rename refactoring action toallow rename to work with custom names.Differential Revision: https://reviews.llvm.org/D37856llvm-svn: 315661
Revert r315087clang-refactor crashes on some bots after this commitllvm-svn: 315095
[refactor] add support for refactoring optionsThis commit adds initial support for refactoring options. One can now useoptional and required std::string options.This commit also adds a NewNameOp
[refactor] add support for refactoring optionsThis commit adds initial support for refactoring options. One can now useoptional and required std::string options.This commit also adds a NewNameOption for the local-rename refactoring action toallow rename to work with custom names.Differential Revision: https://reviews.llvm.org/D37856llvm-svn: 315087
Fix Refactor/tool-test-support.c test on Windows by avoidingthe STDERR redirectllvm-svn: 313266
[refactor] Use CommonOptionsParser in clang-refactorThis commit ensures that CommonOptionsParser works with subcommands. This allowsclang-refactor to use the CommonOptionsParser.Differential Rev
[refactor] Use CommonOptionsParser in clang-refactorThis commit ensures that CommonOptionsParser works with subcommands. This allowsclang-refactor to use the CommonOptionsParser.Differential Revision: https://reviews.llvm.org/D37618llvm-svn: 313260
[refactor] add clang-refactor tool with initial testing support andlocal-rename actionThis commit introduces the clang-refactor tool alongside the local-rename actionwhich uses the existing renam
[refactor] add clang-refactor tool with initial testing support andlocal-rename actionThis commit introduces the clang-refactor tool alongside the local-rename actionwhich uses the existing renaming engine used by clang-rename. The tooldoesn't actually perform the source transformations yet, it just providestesting support. This commit also moves only one test from clang-rename over totest/Refactor. I will continue to move the other tests throughoutdevelopment of clang-refactor.The following options are supported by clang-refactor:-v: use verbose output-selection: The source range that corresponds to the portion of the source that's selected (currently only special command test:<file> is supported).Please note that a follow-up commit will migrate clang-refactor tolibTooling's common option parser, so clang-refactor will be able to usethe common interface with compilation database and options like -p, -extra-arg,etc.The testing support provided by clang-refactor is described below:When -selection=test:<file> is given, clang-refactor will parse the selectioncommands from that file. The selection commands are grouped and the specifiedrefactoring action invoked by the tool. Each command in a group is expected toproduce an identical result. The precise syntax for the selection commands isdescribed in a comment in TestSupport.h.Differential Revision: https://reviews.llvm.org/D36574llvm-svn: 313244