[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-16 Thread UTKARSH SAXENA via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb62b45412168: [clangd] Add RemoveUsingNamespace tweak. (authored by usaxena95). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68562/new/ https://reviews.llv

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-16 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:139 + SourceLocation FirstUsingDirectiveLoc = + SM.getLocForEndOfFile(SM.getMainFileID()); + for (auto *D : AllDirectives) { ilya-biryukov wrote

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-16 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 225183. usaxena95 marked 11 inline comments as done. usaxena95 added a comment. Addressed comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68562/new/ https://reviews.llvm.org/D68562 Files: clang-too

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-10 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM, many thanks! A few last NITs too Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:31 +/// std::vector foo(std::map); +// C

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-09 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 224067. usaxena95 marked 5 inline comments as done. usaxena95 added a comment. Added documentation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68562/new/ https://reviews.llvm.org/D68562 Files: clang-too

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-09 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Many thanks, this LG overall, just a few NITs and documentation requests. Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:31 +/// std::vector foo(std::map); +class RemoveUsingNamespace : public Tweak { +public:

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-09 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 224038. usaxena95 marked 5 inline comments as done. usaxena95 added a comment. Make action unavailable if the namespace contains a using namespace decl. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68562/new/

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-09 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:87 +return false; + if (const Decl *ParentDecl = Node->Parent->ASTNode.get()) +return llvm::isa(ParentDecl); ilya-biryukov wrote: > Can we use

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-09 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:87 +return false; + if (const Decl *ParentDecl = Node->Parent->ASTNode.get()) +return llvm::isa(ParentDecl); Can we use `ASTNode.get()` to

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-08 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:99 +return false; + if (!dyn_cast(TargetDirective->getDeclContext())) +return false; ilya-biryukov wrote: > I believe this check is redundant i

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-08 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 223898. usaxena95 marked 8 inline comments as done. usaxena95 added a comment. Addressed comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68562/new/ https://reviews.llvm.org/D68562 Files: clang-tool

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-07 Thread Merge Guard [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. Bulid results are available at http://results.llvm-merge-guard.org/Phabricator-19 See http://jenkins.llvm-merge-guard.org/job/Phabricator/19/ for more details. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68562

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-07 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:86 + if (const Decl *ParentDecl = Node->Parent->ASTNode.get()) { +return llvm::isa(ParentDecl); + } NIT: remove redundant `{}` around this `r

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-07 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 223592. usaxena95 marked 3 inline comments as done. usaxena95 added a comment. Make the tweak trigger only for TopLevelDecl. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68562/new/ https://reviews.llvm.org/D

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-07 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. The main comment is about limiting this only to global namespace. PTAL. Comment at: clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp:79 +} +} // namespace + continue rest of the file in the anonymous namespace =

[PATCH] D68562: [clangd] Add RemoveUsingNamespace tweak.

2019-10-07 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 created this revision. Herald added subscribers: cfe-commits, kadircet, arphaman, mgrang, jkorous, MaskRay, ilya-biryukov, mgorny. Herald added a project: clang. Removes the 'using namespace' under the cursor and qualifies all accesses in the current file. E.g.: using namespace std;