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
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
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
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
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
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:
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/
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
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
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
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
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
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
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
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
=
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;
16 matches
Mail list logo