[PATCH] D116490: [clangd] Code action to declare missing move/copy constructor/assignment
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 1 20:01:58 PST 2022
sammccall created this revision.
sammccall added a reviewer: kbobyrev.
Herald added subscribers: usaxena95, kadircet, arphaman, mgorny.
sammccall requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov.
Herald added a project: clang-tools-extra.
Fixes https://github.com/clangd/clangd/issues/973
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D116490
Files:
clang-tools-extra/clangd/ParsedAST.cpp
clang-tools-extra/clangd/ParsedAST.h
clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
Index: clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
+++ clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
@@ -25,6 +25,7 @@
PopulateSwitch.cpp
RawStringLiteral.cpp
RemoveUsingNamespace.cpp
+ SpecialMembers.cpp
SwapIfBranches.cpp
LINK_LIBS
Index: clang-tools-extra/clangd/ParsedAST.h
===================================================================
--- clang-tools-extra/clangd/ParsedAST.h
+++ clang-tools-extra/clangd/ParsedAST.h
@@ -41,6 +41,7 @@
#include <vector>
namespace clang {
+class Sema;
namespace clangd {
class HeuristicResolver;
class SymbolIndex;
@@ -68,6 +69,8 @@
ASTContext &getASTContext();
const ASTContext &getASTContext() const;
+ Sema &getSema();
+
Preprocessor &getPreprocessor();
std::shared_ptr<Preprocessor> getPreprocessorPtr();
const Preprocessor &getPreprocessor() const;
Index: clang-tools-extra/clangd/ParsedAST.cpp
===================================================================
--- clang-tools-extra/clangd/ParsedAST.cpp
+++ clang-tools-extra/clangd/ParsedAST.cpp
@@ -558,6 +558,8 @@
return Clang->getASTContext();
}
+Sema &ParsedAST::getSema() { return Clang->getSema(); }
+
Preprocessor &ParsedAST::getPreprocessor() { return Clang->getPreprocessor(); }
std::shared_ptr<Preprocessor> ParsedAST::getPreprocessorPtr() {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116490.396906.patch
Type: text/x-patch
Size: 1456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220102/fbb4bfd0/attachment.bin>
More information about the cfe-commits
mailing list