• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisiónd6541620447f43985b34e9a39488bafb38158221 (tree)
Tiempo2017-09-19 18:10:03
AutorYao Qi <yao.qi@lina...>
CommiterYao Qi

Log Message

Use DISABLE_COPY_AND_ASSIGN

We have many classes that copy cotr and assignment operator are deleted,
so this patch replaces these existing mechanical code with macro
DISABLE_COPY_AND_ASSIGN.

gdb:

2017-09-19 Yao Qi <yao.qi@linaro.org>

* annotate.h (struct annotate_arg_emitter): Use
DISABLE_COPY_AND_ASSIGN.
* common/refcounted-object.h (refcounted_object): Likewise.
* completer.h (struct completion_result): Likewise.
* dwarf2read.c (struct dwarf2_per_objfile): Likewise.
* filename-seen-cache.h (filename_seen_cache): Likewise.
* gdbcore.h (thread_section_name): Likewise.
* gdb_regex.h (compiled_regex): Likewise.
* gdbthread.h (scoped_restore_current_thread): Likewise.
* inferior.h (scoped_restore_current_inferior): Likewise.
* jit.c (jit_reader): Likewise.
* linespec.h (struct linespec_result): Likewise.
* mi/mi-parse.h (struct mi_parse): Likewise.
* nat/fork-inferior.c (execv_argv): Likewise.
* progspace.h (scoped_restore_current_program_space): Likewise.
* python/python-internal.h (class gdbpy_enter): Likewise.
* regcache.h (regcache): Likewise.
* target-descriptions.c (struct tdesc_reg): Likewise.
(struct tdesc_type): Likewise.
(struct tdesc_feature): Likewise.
* ui-out.h (ui_out_emit_type): Likewise.

Cambiar Resumen

Diferencia incremental

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,27 @@
1+2017-09-19 Yao Qi <yao.qi@linaro.org>
2+
3+ * annotate.h (struct annotate_arg_emitter): Use
4+ DISABLE_COPY_AND_ASSIGN.
5+ * common/refcounted-object.h (refcounted_object): Likewise.
6+ * completer.h (struct completion_result): Likewise.
7+ * dwarf2read.c (struct dwarf2_per_objfile): Likewise.
8+ * filename-seen-cache.h (filename_seen_cache): Likewise.
9+ * gdbcore.h (thread_section_name): Likewise.
10+ * gdb_regex.h (compiled_regex): Likewise.
11+ * gdbthread.h (scoped_restore_current_thread): Likewise.
12+ * inferior.h (scoped_restore_current_inferior): Likewise.
13+ * jit.c (jit_reader): Likewise.
14+ * linespec.h (struct linespec_result): Likewise.
15+ * mi/mi-parse.h (struct mi_parse): Likewise.
16+ * nat/fork-inferior.c (execv_argv): Likewise.
17+ * progspace.h (scoped_restore_current_program_space): Likewise.
18+ * python/python-internal.h (class gdbpy_enter): Likewise.
19+ * regcache.h (regcache): Likewise.
20+ * target-descriptions.c (struct tdesc_reg): Likewise.
21+ (struct tdesc_type): Likewise.
22+ (struct tdesc_feature): Likewise.
23+ * ui-out.h (ui_out_emit_type): Likewise.
24+
125 2017-09-18 Simon Marchi <simon.marchi@ericsson.com>
226
327 * dwarf2expr.c (dwarf_expr_context::execute_stack_op): Remove
--- a/gdb/annotate.h
+++ b/gdb/annotate.h
@@ -81,8 +81,7 @@ struct annotate_arg_emitter
8181 annotate_arg_emitter () { annotate_arg_begin (); }
8282 ~annotate_arg_emitter () { annotate_arg_end (); }
8383
84- annotate_arg_emitter (const annotate_arg_emitter &) = delete;
85- annotate_arg_emitter &operator= (const annotate_arg_emitter &) = delete;
84+ DISABLE_COPY_AND_ASSIGN (annotate_arg_emitter);
8685 };
8786
8887 extern void annotate_source (char *, int, int, int,
--- a/gdb/common/refcounted-object.h
+++ b/gdb/common/refcounted-object.h
@@ -45,9 +45,7 @@ public:
4545 int refcount () const { return m_refcount; }
4646
4747 private:
48- /* Disable copy. */
49- refcounted_object (const refcounted_object &) = delete;
50- refcounted_object &operator=(const refcounted_object &) = delete;
48+ DISABLE_COPY_AND_ASSIGN (refcounted_object);
5149
5250 /* The reference count. */
5351 int m_refcount = 0;
--- a/gdb/completer.h
+++ b/gdb/completer.h
@@ -85,9 +85,7 @@ struct completion_result
8585 /* Destroy a result. */
8686 ~completion_result ();
8787
88- /* Disable copying, since we don't need it. */
89- completion_result (const completion_result &rhs) = delete;
90- void operator= (const completion_result &rhs) = delete;
88+ DISABLE_COPY_AND_ASSIGN (completion_result);
9189
9290 /* Move a result. */
9391 completion_result (completion_result &&rhs);
@@ -146,9 +144,7 @@ public:
146144 completion_tracker ();
147145 ~completion_tracker ();
148146
149- /* Disable copy. */
150- completion_tracker (const completion_tracker &rhs) = delete;
151- void operator= (const completion_tracker &rhs) = delete;
147+ DISABLE_COPY_AND_ASSIGN (completion_tracker);
152148
153149 /* Add the completion NAME to the list of generated completions if
154150 it is not there already. If too many completions were already
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -232,9 +232,7 @@ struct dwarf2_per_objfile
232232
233233 ~dwarf2_per_objfile ();
234234
235- /* Disable copy. */
236- dwarf2_per_objfile (const dwarf2_per_objfile &) = delete;
237- void operator= (const dwarf2_per_objfile &) = delete;
235+ DISABLE_COPY_AND_ASSIGN (dwarf2_per_objfile);
238236
239237 /* Free all cached compilation units. */
240238 void free_cached_comp_units ();
--- a/gdb/filename-seen-cache.h
+++ b/gdb/filename-seen-cache.h
@@ -28,9 +28,7 @@ public:
2828 filename_seen_cache ();
2929 ~filename_seen_cache ();
3030
31- /* Disable copy. */
32- filename_seen_cache (const filename_seen_cache &) = delete;
33- void operator= (const filename_seen_cache &) = delete;
31+ DISABLE_COPY_AND_ASSIGN (filename_seen_cache);
3432
3533 /* Empty the cache, but do not delete it. */
3634 void clear ();
--- a/gdb/gdb_regex.h
+++ b/gdb/gdb_regex.h
@@ -43,9 +43,7 @@ public:
4343
4444 ~compiled_regex ();
4545
46- /* Disable copy. */
47- compiled_regex (const compiled_regex&) = delete;
48- void operator= (const compiled_regex&) = delete;
46+ DISABLE_COPY_AND_ASSIGN (compiled_regex);
4947
5048 /* Wrapper around ::regexec. */
5149 int exec (const char *string,
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -258,9 +258,7 @@ public:
258258 const char *c_str () const
259259 { return m_section_name; }
260260
261- /* Disable copy. */
262- thread_section_name (const thread_section_name &) = delete;
263- void operator= (const thread_section_name &) = delete;
261+ DISABLE_COPY_AND_ASSIGN (thread_section_name);
264262
265263 private:
266264 /* Either a pointer into M_STORAGE, or a pointer to the name passed
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -597,11 +597,7 @@ public:
597597 scoped_restore_current_thread ();
598598 ~scoped_restore_current_thread ();
599599
600- /* Disable copy. */
601- scoped_restore_current_thread
602- (const scoped_restore_current_thread &) = delete;
603- void operator=
604- (const scoped_restore_current_thread &) = delete;
600+ DISABLE_COPY_AND_ASSIGN (scoped_restore_current_thread);
605601
606602 private:
607603 thread_info *m_thread;
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -527,11 +527,7 @@ public:
527527 ~scoped_restore_current_inferior ()
528528 { set_current_inferior (m_saved_inf); }
529529
530- /* Disable copy. */
531- scoped_restore_current_inferior
532- (const scoped_restore_current_inferior &) = delete;
533- void operator=
534- (const scoped_restore_current_inferior &) = delete;
530+ DISABLE_COPY_AND_ASSIGN (scoped_restore_current_inferior);
535531
536532 private:
537533 inferior *m_saved_inf;
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -163,8 +163,7 @@ struct jit_reader
163163 functions->destroy (functions);
164164 }
165165
166- jit_reader (const jit_reader &) = delete;
167- jit_reader &operator= (const jit_reader &) = delete;
166+ DISABLE_COPY_AND_ASSIGN (jit_reader);
168167
169168 struct gdb_reader_funcs *functions;
170169 gdb_dlhandle_up handle;
--- a/gdb/linespec.h
+++ b/gdb/linespec.h
@@ -58,8 +58,7 @@ struct linespec_result
5858 linespec_result () = default;
5959 ~linespec_result ();
6060
61- linespec_result (const linespec_result &) = delete;
62- linespec_result &operator= (const linespec_result &) = delete;
61+ DISABLE_COPY_AND_ASSIGN (linespec_result);
6362
6463 /* If true, the linespec should be displayed to the user. This
6564 is used by "unusual" linespecs where the ordinary `info break'
--- a/gdb/mi/mi-parse.h
+++ b/gdb/mi/mi-parse.h
@@ -44,8 +44,7 @@ struct mi_parse
4444 mi_parse ();
4545 ~mi_parse ();
4646
47- mi_parse (const mi_parse &) = delete;
48- mi_parse &operator= (const mi_parse &) = delete;
47+ DISABLE_COPY_AND_ASSIGN (mi_parse);
4948
5049 enum mi_command_type op;
5150 char *command;
--- a/gdb/nat/fork-inferior.c
+++ b/gdb/nat/fork-inferior.c
@@ -56,9 +56,7 @@ public:
5656 }
5757
5858 private:
59- /* Disable copying. */
60- execv_argv (const execv_argv &) = delete;
61- void operator= (const execv_argv &) = delete;
59+ DISABLE_COPY_AND_ASSIGN (execv_argv);
6260
6361 /* Helper methods for constructing the argument vector. */
6462
--- a/gdb/progspace.h
+++ b/gdb/progspace.h
@@ -273,11 +273,7 @@ public:
273273 ~scoped_restore_current_program_space ()
274274 { set_current_program_space (m_saved_pspace); }
275275
276- /* Disable copy. */
277- scoped_restore_current_program_space
278- (const scoped_restore_current_program_space &) = delete;
279- void operator=
280- (const scoped_restore_current_program_space &) = delete;
276+ DISABLE_COPY_AND_ASSIGN (scoped_restore_current_program_space);
281277
282278 private:
283279 program_space *m_saved_pspace;
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -624,8 +624,7 @@ class gdbpy_enter
624624
625625 ~gdbpy_enter ();
626626
627- gdbpy_enter (const gdbpy_enter &) = delete;
628- gdbpy_enter &operator= (const gdbpy_enter &) = delete;
627+ DISABLE_COPY_AND_ASSIGN (gdbpy_enter);
629628
630629 private:
631630
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -255,8 +255,7 @@ public:
255255 /* Create a readonly regcache from a non-readonly regcache. */
256256 regcache (readonly_t, const regcache &src);
257257
258- regcache (const regcache &) = delete;
259- void operator= (const regcache &) = delete;
258+ DISABLE_COPY_AND_ASSIGN (regcache);
260259
261260 /* class regcache is only extended in unit test, so only mark it
262261 virtual when selftest is enabled. */
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -93,9 +93,7 @@ typedef struct tdesc_reg : tdesc_element
9393 xfree (group);
9494 }
9595
96- /* Disable copying. */
97- tdesc_reg (const tdesc_reg &) = delete;
98- tdesc_reg &operator= (const tdesc_reg &) = delete;
96+ DISABLE_COPY_AND_ASSIGN (tdesc_reg);
9997
10098 /* The name of this register. In standard features, it may be
10199 recognized by the architecture support code, or it may be purely
@@ -229,9 +227,8 @@ typedef struct tdesc_type : tdesc_element
229227 }
230228 xfree ((char *) name);
231229 }
232- /* Disable copying. */
233- tdesc_type (const tdesc_type &) = delete;
234- tdesc_type &operator= (const tdesc_type &) = delete;
230+
231+ DISABLE_COPY_AND_ASSIGN (tdesc_type);
235232
236233 /* The name of this type. If this type is a built-in type, this is
237234 a pointer to a constant string. Otherwise, it's a
@@ -302,9 +299,7 @@ typedef struct tdesc_feature : tdesc_element
302299 xfree (name);
303300 }
304301
305- /* Disable copying. */
306- tdesc_feature (const tdesc_feature &) = delete;
307- tdesc_feature &operator= (const tdesc_feature &) = delete;
302+ DISABLE_COPY_AND_ASSIGN (tdesc_feature);
308303
309304 /* The name of this feature. It may be recognized by the architecture
310305 support code. */
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -204,9 +204,7 @@ public:
204204 m_uiout->end (Type);
205205 }
206206
207- ui_out_emit_type (const ui_out_emit_type<Type> &) = delete;
208- ui_out_emit_type<Type> &operator= (const ui_out_emit_type<Type> &)
209- = delete;
207+ DISABLE_COPY_AND_ASSIGN (ui_out_emit_type<Type>);
210208
211209 private:
212210