[go: nahoru, domu]

Script remove more DISALLOW_COPY_AND_ASSIGNs

This applies a script previously used for large directories on all
remaining (smaller) directories as a single chunk.

This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: I572936462f763e1dd15dd88cdcf451ee14b34dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3182480
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#925533}
diff --git a/courgette/adjustment_method_2.cc b/courgette/adjustment_method_2.cc
index 467e79a2..e7569f5 100644
--- a/courgette/adjustment_method_2.cc
+++ b/courgette/adjustment_method_2.cc
@@ -1228,6 +1228,10 @@
 class Adjuster : public AdjustmentMethod {
  public:
   Adjuster() : prog_(nullptr), model_(nullptr) {}
+
+  Adjuster(const Adjuster&) = delete;
+  Adjuster& operator=(const Adjuster&) = delete;
+
   ~Adjuster() = default;
 
   bool Adjust(const AssemblyProgram& model, AssemblyProgram* program) {
@@ -1285,9 +1289,6 @@
   const AssemblyProgram* model_;  // Program to be mimicked, owned by caller.
 
   LabelInfoMaker label_info_maker_;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(Adjuster);
 };
 
 ////////////////////////////////////////////////////////////////////////////////