+2018-05-20 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * common/traits.h (HAVE_IS_TRIVIALLY_COPYABLE): Rename the wrong
+ instance to...
+ (HAVE_IS_TRIVIALLY_CONSTRUCTIBLE): ... this.
+ * objfiles.c (get_objfile_bfd_data): Allocate
+ objfile_per_bfd_storage with obstack_new when allocating on
+ obstack.
+
2018-05-20 Simon Marchi <simon.marchi@ericsson.com>
* ada-lang.c (cache_symbol): Use XOBNEW and/or XOBNEWVEC and/or
in GCC 5. */
#if (__has_feature(is_trivially_constructible) \
|| (defined __GNUC__ && __GNUC__ >= 5))
-# define HAVE_IS_TRIVIALLY_COPYABLE 1
+# define HAVE_IS_TRIVIALLY_CONSTRUCTIBLE 1
#endif
namespace gdb {
storage
= ((struct objfile_per_bfd_storage *)
bfd_alloc (abfd, sizeof (struct objfile_per_bfd_storage)));
+ /* objfile_per_bfd_storage is not trivially constructible, must
+ call the ctor manually. */
+ storage = new (storage) objfile_per_bfd_storage ();
set_bfd_data (abfd, objfiles_bfd_data, storage);
}
else
- storage = XOBNEW (&objfile->objfile_obstack, objfile_per_bfd_storage);
-
- /* objfile_per_bfd_storage is not trivially constructible, must
- call the ctor manually. */
- storage = new (storage) objfile_per_bfd_storage ();
+ storage
+ = obstack_new<objfile_per_bfd_storage> (&objfile->objfile_obstack);
/* Look up the gdbarch associated with the BFD. */
if (abfd != NULL)