GNU Binutils with patches for OS216
Revisión | d6541620447f43985b34e9a39488bafb38158221 (tree) |
---|---|
Tiempo | 2017-09-19 18:10:03 |
Autor | Yao Qi <yao.qi@lina...> |
Commiter | Yao Qi |
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.
@@ -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 | + | |
1 | 25 | 2017-09-18 Simon Marchi <simon.marchi@ericsson.com> |
2 | 26 | |
3 | 27 | * dwarf2expr.c (dwarf_expr_context::execute_stack_op): Remove |
@@ -81,8 +81,7 @@ struct annotate_arg_emitter | ||
81 | 81 | annotate_arg_emitter () { annotate_arg_begin (); } |
82 | 82 | ~annotate_arg_emitter () { annotate_arg_end (); } |
83 | 83 | |
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); | |
86 | 85 | }; |
87 | 86 | |
88 | 87 | extern void annotate_source (char *, int, int, int, |
@@ -45,9 +45,7 @@ public: | ||
45 | 45 | int refcount () const { return m_refcount; } |
46 | 46 | |
47 | 47 | 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); | |
51 | 49 | |
52 | 50 | /* The reference count. */ |
53 | 51 | int m_refcount = 0; |
@@ -85,9 +85,7 @@ struct completion_result | ||
85 | 85 | /* Destroy a result. */ |
86 | 86 | ~completion_result (); |
87 | 87 | |
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); | |
91 | 89 | |
92 | 90 | /* Move a result. */ |
93 | 91 | completion_result (completion_result &&rhs); |
@@ -146,9 +144,7 @@ public: | ||
146 | 144 | completion_tracker (); |
147 | 145 | ~completion_tracker (); |
148 | 146 | |
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); | |
152 | 148 | |
153 | 149 | /* Add the completion NAME to the list of generated completions if |
154 | 150 | it is not there already. If too many completions were already |
@@ -232,9 +232,7 @@ struct dwarf2_per_objfile | ||
232 | 232 | |
233 | 233 | ~dwarf2_per_objfile (); |
234 | 234 | |
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); | |
238 | 236 | |
239 | 237 | /* Free all cached compilation units. */ |
240 | 238 | void free_cached_comp_units (); |
@@ -28,9 +28,7 @@ public: | ||
28 | 28 | filename_seen_cache (); |
29 | 29 | ~filename_seen_cache (); |
30 | 30 | |
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); | |
34 | 32 | |
35 | 33 | /* Empty the cache, but do not delete it. */ |
36 | 34 | void clear (); |
@@ -43,9 +43,7 @@ public: | ||
43 | 43 | |
44 | 44 | ~compiled_regex (); |
45 | 45 | |
46 | - /* Disable copy. */ | |
47 | - compiled_regex (const compiled_regex&) = delete; | |
48 | - void operator= (const compiled_regex&) = delete; | |
46 | + DISABLE_COPY_AND_ASSIGN (compiled_regex); | |
49 | 47 | |
50 | 48 | /* Wrapper around ::regexec. */ |
51 | 49 | int exec (const char *string, |
@@ -258,9 +258,7 @@ public: | ||
258 | 258 | const char *c_str () const |
259 | 259 | { return m_section_name; } |
260 | 260 | |
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); | |
264 | 262 | |
265 | 263 | private: |
266 | 264 | /* Either a pointer into M_STORAGE, or a pointer to the name passed |
@@ -597,11 +597,7 @@ public: | ||
597 | 597 | scoped_restore_current_thread (); |
598 | 598 | ~scoped_restore_current_thread (); |
599 | 599 | |
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); | |
605 | 601 | |
606 | 602 | private: |
607 | 603 | thread_info *m_thread; |
@@ -527,11 +527,7 @@ public: | ||
527 | 527 | ~scoped_restore_current_inferior () |
528 | 528 | { set_current_inferior (m_saved_inf); } |
529 | 529 | |
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); | |
535 | 531 | |
536 | 532 | private: |
537 | 533 | inferior *m_saved_inf; |
@@ -163,8 +163,7 @@ struct jit_reader | ||
163 | 163 | functions->destroy (functions); |
164 | 164 | } |
165 | 165 | |
166 | - jit_reader (const jit_reader &) = delete; | |
167 | - jit_reader &operator= (const jit_reader &) = delete; | |
166 | + DISABLE_COPY_AND_ASSIGN (jit_reader); | |
168 | 167 | |
169 | 168 | struct gdb_reader_funcs *functions; |
170 | 169 | gdb_dlhandle_up handle; |
@@ -58,8 +58,7 @@ struct linespec_result | ||
58 | 58 | linespec_result () = default; |
59 | 59 | ~linespec_result (); |
60 | 60 | |
61 | - linespec_result (const linespec_result &) = delete; | |
62 | - linespec_result &operator= (const linespec_result &) = delete; | |
61 | + DISABLE_COPY_AND_ASSIGN (linespec_result); | |
63 | 62 | |
64 | 63 | /* If true, the linespec should be displayed to the user. This |
65 | 64 | is used by "unusual" linespecs where the ordinary `info break' |
@@ -44,8 +44,7 @@ struct mi_parse | ||
44 | 44 | mi_parse (); |
45 | 45 | ~mi_parse (); |
46 | 46 | |
47 | - mi_parse (const mi_parse &) = delete; | |
48 | - mi_parse &operator= (const mi_parse &) = delete; | |
47 | + DISABLE_COPY_AND_ASSIGN (mi_parse); | |
49 | 48 | |
50 | 49 | enum mi_command_type op; |
51 | 50 | char *command; |
@@ -56,9 +56,7 @@ public: | ||
56 | 56 | } |
57 | 57 | |
58 | 58 | 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); | |
62 | 60 | |
63 | 61 | /* Helper methods for constructing the argument vector. */ |
64 | 62 |
@@ -273,11 +273,7 @@ public: | ||
273 | 273 | ~scoped_restore_current_program_space () |
274 | 274 | { set_current_program_space (m_saved_pspace); } |
275 | 275 | |
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); | |
281 | 277 | |
282 | 278 | private: |
283 | 279 | program_space *m_saved_pspace; |
@@ -624,8 +624,7 @@ class gdbpy_enter | ||
624 | 624 | |
625 | 625 | ~gdbpy_enter (); |
626 | 626 | |
627 | - gdbpy_enter (const gdbpy_enter &) = delete; | |
628 | - gdbpy_enter &operator= (const gdbpy_enter &) = delete; | |
627 | + DISABLE_COPY_AND_ASSIGN (gdbpy_enter); | |
629 | 628 | |
630 | 629 | private: |
631 | 630 |
@@ -255,8 +255,7 @@ public: | ||
255 | 255 | /* Create a readonly regcache from a non-readonly regcache. */ |
256 | 256 | regcache (readonly_t, const regcache &src); |
257 | 257 | |
258 | - regcache (const regcache &) = delete; | |
259 | - void operator= (const regcache &) = delete; | |
258 | + DISABLE_COPY_AND_ASSIGN (regcache); | |
260 | 259 | |
261 | 260 | /* class regcache is only extended in unit test, so only mark it |
262 | 261 | virtual when selftest is enabled. */ |
@@ -93,9 +93,7 @@ typedef struct tdesc_reg : tdesc_element | ||
93 | 93 | xfree (group); |
94 | 94 | } |
95 | 95 | |
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); | |
99 | 97 | |
100 | 98 | /* The name of this register. In standard features, it may be |
101 | 99 | recognized by the architecture support code, or it may be purely |
@@ -229,9 +227,8 @@ typedef struct tdesc_type : tdesc_element | ||
229 | 227 | } |
230 | 228 | xfree ((char *) name); |
231 | 229 | } |
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); | |
235 | 232 | |
236 | 233 | /* The name of this type. If this type is a built-in type, this is |
237 | 234 | a pointer to a constant string. Otherwise, it's a |
@@ -302,9 +299,7 @@ typedef struct tdesc_feature : tdesc_element | ||
302 | 299 | xfree (name); |
303 | 300 | } |
304 | 301 | |
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); | |
308 | 303 | |
309 | 304 | /* The name of this feature. It may be recognized by the architecture |
310 | 305 | support code. */ |
@@ -204,9 +204,7 @@ public: | ||
204 | 204 | m_uiout->end (Type); |
205 | 205 | } |
206 | 206 | |
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>); | |
210 | 208 | |
211 | 209 | private: |
212 | 210 |