[lldb] NFC remove DISALLOW_COPY_AND_ASSIGN
Summary:
This is how I applied my clang-tidy check (see
https://reviews.llvm.org/D80531) in order to remove
`DISALLOW_COPY_AND_ASSIGN` and have deleted copy ctors and deleted
assignment operators instead.
```
lang=bash
grep DISALLOW_COPY_AND_ASSIGN /opt/notnfs/kkleine/llvm/lldb -r -l | sort | uniq > files
for i in $(cat files);
do
clang-tidy \
--checks="-*,modernize-replace-disallow-copy-and-assign-macro" \
--format-style=LLVM \
--header-filter=.* \
--fix \
-fix-errors \
$i;
done
```
Reviewers: espindola, labath, aprantl, teemperor
Reviewed By: labath, aprantl, teemperor
Subscribers: teemperor, aprantl, labath, emaste, sbc100, aheejin, MaskRay, arphaman, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D80543
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index 4cc4666..b1e2075 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -226,7 +226,9 @@
void *m_decompression_scratch = nullptr;
#endif
- DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunication);
+ GDBRemoteCommunication(const GDBRemoteCommunication &) = delete;
+ const GDBRemoteCommunication &
+ operator=(const GDBRemoteCommunication &) = delete;
};
} // namespace process_gdb_remote
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
index bd4a254..8df08cb 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -621,7 +621,9 @@
LazyBool GetThreadPacketSupported(lldb::tid_t tid, llvm::StringRef packetStr);
private:
- DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationClient);
+ GDBRemoteCommunicationClient(const GDBRemoteCommunicationClient &) = delete;
+ const GDBRemoteCommunicationClient &
+ operator=(const GDBRemoteCommunicationClient &) = delete;
};
} // namespace process_gdb_remote
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.h
index 6558729..c13e5ee 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationReplayServer.h
@@ -76,7 +76,10 @@
bool m_skip_acks;
private:
- DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationReplayServer);
+ GDBRemoteCommunicationReplayServer(
+ const GDBRemoteCommunicationReplayServer &) = delete;
+ const GDBRemoteCommunicationReplayServer &
+ operator=(const GDBRemoteCommunicationReplayServer &) = delete;
};
} // namespace process_gdb_remote
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
index 93150ff..a7c2ea4 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
@@ -74,7 +74,9 @@
PacketResult SendOKResponse();
private:
- DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationServer);
+ GDBRemoteCommunicationServer(const GDBRemoteCommunicationServer &) = delete;
+ const GDBRemoteCommunicationServer &
+ operator=(const GDBRemoteCommunicationServer &) = delete;
};
class PacketUnimplementedError
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
index f2cb3a8..3ce2859 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
@@ -224,7 +224,10 @@
void StopSTDIOForwarding();
// For GDBRemoteCommunicationServerLLGS only
- DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationServerLLGS);
+ GDBRemoteCommunicationServerLLGS(const GDBRemoteCommunicationServerLLGS &) =
+ delete;
+ const GDBRemoteCommunicationServerLLGS &
+ operator=(const GDBRemoteCommunicationServerLLGS &) = delete;
};
} // namespace process_gdb_remote
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
index 8a8d113..a8cacea 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
@@ -100,7 +100,10 @@
static FileSpec GetDomainSocketPath(const char *prefix);
- DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationServerPlatform);
+ GDBRemoteCommunicationServerPlatform(
+ const GDBRemoteCommunicationServerPlatform &) = delete;
+ const GDBRemoteCommunicationServerPlatform &
+ operator=(const GDBRemoteCommunicationServerPlatform &) = delete;
};
} // namespace process_gdb_remote
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
index 87e492e..0158625 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
@@ -120,7 +120,9 @@
bool SetPrimordialRegister(const RegisterInfo *reg_info,
GDBRemoteCommunicationClient &gdb_comm);
- DISALLOW_COPY_AND_ASSIGN(GDBRemoteRegisterContext);
+ GDBRemoteRegisterContext(const GDBRemoteRegisterContext &) = delete;
+ const GDBRemoteRegisterContext &
+ operator=(const GDBRemoteRegisterContext &) = delete;
};
} // namespace process_gdb_remote
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index 6ed75dd..22d86d6 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -450,7 +450,8 @@
llvm::DenseMap<ModuleCacheKey, ModuleSpec, ModuleCacheInfo>
m_cached_module_specs;
- DISALLOW_COPY_AND_ASSIGN(ProcessGDBRemote);
+ ProcessGDBRemote(const ProcessGDBRemote &) = delete;
+ const ProcessGDBRemote &operator=(const ProcessGDBRemote &) = delete;
};
} // namespace process_gdb_remote