[3/8] gdb/dwarf: move dwarf2_cu::section to cu.c
Checks
Commit Message
From: Simon Marchi <simon.marchi@efficios.com>
Following the previous patch that moves the dwo_unit structure from
dwarf2/read.c to dwarf2/read.h, dwarf2_cu::section has no reason to be
implemented in dwarf2/read.c anymore. Move it to dwarf2/cu.c.
Change-Id: I67e2bb42d878ac18e4bf3460d75f1394477a46ce
---
gdb/dwarf2/cu.c | 11 +++++++++++
gdb/dwarf2/read.c | 14 +-------------
2 files changed, 12 insertions(+), 13 deletions(-)
@@ -58,6 +58,17 @@ dwarf2_cu::dwarf2_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile)
/* See cu.h. */
+const dwarf2_section_info &
+dwarf2_cu::section () const
+{
+ if (this->dwo_unit != nullptr)
+ return *this->dwo_unit->section;
+ else
+ return *this->per_cu->section ();
+}
+
+/* See cu.h. */
+
struct type *
dwarf2_cu::addr_sized_int_type (bool unsigned_p) const
{
@@ -5806,19 +5806,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
}
}
-/* See cu.h.
-
- This function is defined in this file (instead of cu.c) because it needs
- to see the definition of struct dwo_unit. */
-
-const dwarf2_section_info &
-dwarf2_cu::section () const
-{
- if (this->dwo_unit != nullptr)
- return *this->dwo_unit->section;
- else
- return *this->per_cu->section ();
-}
+/* See cu.h. */
/* See cu.h.