mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 06:46:33 +00:00
[NFC] Complete proper copying and resource cleanup in classes. (#118655)
Provide, where missing, a copy constructor, a copy assignment operator or a destructor to prevent potential issues that can arise.
This commit is contained in:
parent
2bd3174226
commit
f59b600c21
@ -81,6 +81,9 @@ public:
|
||||
|
||||
~ClangTidyContext();
|
||||
|
||||
ClangTidyContext(const ClangTidyContext &) = delete;
|
||||
ClangTidyContext &operator=(const ClangTidyContext &) = delete;
|
||||
|
||||
/// Report any errors detected using this method.
|
||||
///
|
||||
/// This is still under heavy development and will likely change towards using
|
||||
|
@ -31,6 +31,8 @@ class NoLintDirectiveHandler {
|
||||
public:
|
||||
NoLintDirectiveHandler();
|
||||
~NoLintDirectiveHandler();
|
||||
NoLintDirectiveHandler(const NoLintDirectiveHandler &) = delete;
|
||||
NoLintDirectiveHandler &operator=(const NoLintDirectiveHandler &) = delete;
|
||||
|
||||
bool shouldSuppress(DiagnosticsEngine::Level DiagLevel,
|
||||
const Diagnostic &Diag, llvm::StringRef DiagName,
|
||||
|
@ -73,6 +73,9 @@ public:
|
||||
/// The destructor blocks on any outstanding background tasks.
|
||||
~ClangdLSPServer();
|
||||
|
||||
ClangdLSPServer(const ClangdLSPServer &other) = delete;
|
||||
ClangdLSPServer &operator=(const ClangdLSPServer &other) = delete;
|
||||
|
||||
/// Run LSP server loop, communicating with the Transport provided in the
|
||||
/// constructor. This method must not be executed more than once.
|
||||
///
|
||||
|
@ -59,6 +59,9 @@ public:
|
||||
|
||||
~ParsedAST();
|
||||
|
||||
ParsedAST(const ParsedAST &Other) = delete;
|
||||
ParsedAST &operator=(const ParsedAST &Other) = delete;
|
||||
|
||||
/// Note that the returned ast will not contain decls from the preamble that
|
||||
/// were not deserialized during parsing. Clients should expect only decls
|
||||
/// from the main file to be in the AST.
|
||||
|
@ -411,6 +411,9 @@ public:
|
||||
if (Throttler)
|
||||
Throttler->release(ID);
|
||||
}
|
||||
PreambleThrottlerRequest(const PreambleThrottlerRequest &) = delete;
|
||||
PreambleThrottlerRequest &
|
||||
operator=(const PreambleThrottlerRequest &) = delete;
|
||||
|
||||
private:
|
||||
PreambleThrottler::RequestID ID;
|
||||
@ -621,7 +624,8 @@ public:
|
||||
AsyncTaskRunner *Tasks, Semaphore &Barrier,
|
||||
const TUScheduler::Options &Opts, ParsingCallbacks &Callbacks);
|
||||
~ASTWorker();
|
||||
|
||||
ASTWorker(const ASTWorker &other) = delete;
|
||||
ASTWorker &operator=(const ASTWorker &other) = delete;
|
||||
void update(ParseInputs Inputs, WantDiagnostics, bool ContentChanged);
|
||||
void
|
||||
runWithAST(llvm::StringRef Name,
|
||||
|
@ -242,6 +242,9 @@ public:
|
||||
std::unique_ptr<ParsingCallbacks> ASTCallbacks = nullptr);
|
||||
~TUScheduler();
|
||||
|
||||
TUScheduler(const TUScheduler &other) = delete;
|
||||
TUScheduler &operator=(const TUScheduler &other) = delete;
|
||||
|
||||
struct FileStats {
|
||||
std::size_t UsedBytesAST = 0;
|
||||
std::size_t UsedBytesPreamble = 0;
|
||||
|
@ -328,6 +328,9 @@ public:
|
||||
Preprocessor(const TokenStream &In, TokenStream &Out) : In(In), Out(Out) {}
|
||||
~Preprocessor() { Out.finalize(); }
|
||||
|
||||
Preprocessor(const Preprocessor &other) = delete;
|
||||
Preprocessor &operator=(const Preprocessor &other) = delete;
|
||||
|
||||
void walk(const DirectiveTree &T) {
|
||||
for (const auto &C : T.Chunks)
|
||||
std::visit(*this, C);
|
||||
|
@ -46,6 +46,8 @@ class Module {
|
||||
public:
|
||||
Module(llvm::StringRef Name, bool Problem);
|
||||
~Module();
|
||||
Module(const Module &other) = delete;
|
||||
Module &operator=(const Module &other) = delete;
|
||||
bool output(llvm::raw_fd_ostream &OS, int Indent);
|
||||
Module *findSubModule(llvm::StringRef SubName);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user