aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2codeview.h
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2024-08-26 22:40:56 +0100
committerMark Harmstone <mark@harmstone.com>2024-08-29 02:53:08 +0100
commitc5043d89449758ecf6a3f1475e027a73976f58c3 (patch)
tree981815fa92a4f0326eb1928b39068fa80b5181a0 /gcc/dwarf2codeview.h
parent6a9932ecdaac16c0fa21cc7c39589a3cd7cacf0f (diff)
downloadgcc-c5043d89449758ecf6a3f1475e027a73976f58c3.zip
gcc-c5043d89449758ecf6a3f1475e027a73976f58c3.tar.gz
gcc-c5043d89449758ecf6a3f1475e027a73976f58c3.tar.bz2
Record member functions in CodeView struct definitions
CodeView has two ways of recording struct member functions. Non-overloaded functions have an LF_ONEMETHOD sub-type in the field list, which records the name and the function type (LF_MFUNCTION). Overloaded functions have an LF_METHOD instead, which points to an LF_METHODLIST, which is an array of links to various LF_MFUNCTION types. gcc/ * dwarf2codeview.cc (enum cv_leaf_type): Add LF_MFUNCTION, LF_METHODLIST, LF_METHOD, and LF_ONEMETHOD. (struct codeview_subtype): Add lf_onemethod and lf_method to union. (struct lf_methodlist_entry): New type. (struct codeview_custom_type): Add lf_mfunc_id, lf_mfunction, and lf_methodlist to union. (struct codeview_method): New type. (struct method_hasher): New type. (get_type_num_subroutine_type): Add forward declaration. (write_lf_fieldlist): Handle LF_ONEMETHOD and LF_METHOD. (write_lf_mfunction): New function. (write_lf_methodlist): New function. (write_custom_types): Handle LF_MFUNCTION and LF_METHODLIST. (add_struct_function): New function. (get_mfunction_type): New function. (is_templated_func): New function. (get_type_num_struct): Handle DW_TAG_subprogram child DIEs. (get_type_num_subroutine_type): Add containing_class_type, this_type, and this_adjustment params, and handle creating LF_MFUNCTION types as well as LF_PROCEDURE. (get_type_num): New params for get_type_num_subroutine_type. (add_function): New params for get_type_num_subroutine_type. * dwarf2codeview.h (CV_METHOD_VANILLA, CV_METHOD_VIRTUAL): Define. (CV_METHOD_STATIC, CV_METHOD_FRIEND, CV_METHOD_INTRO): Likewise. (CV_METHOD_PUREVIRT, CV_METHOD_PUREINTRO): Likewise.
Diffstat (limited to 'gcc/dwarf2codeview.h')
-rw-r--r--gcc/dwarf2codeview.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/dwarf2codeview.h b/gcc/dwarf2codeview.h
index 8ede1b2..c631349 100644
--- a/gcc/dwarf2codeview.h
+++ b/gcc/dwarf2codeview.h
@@ -66,6 +66,15 @@ along with GCC; see the file COPYING3. If not see
#define CV_ACCESS_PROTECTED 2
#define CV_ACCESS_PUBLIC 3
+/* CV_methodprop_e values in cvinfo.h, shifted by 2 for CV_fldattr_t. */
+#define CV_METHOD_VANILLA 0x00
+#define CV_METHOD_VIRTUAL 0x04
+#define CV_METHOD_STATIC 0x08
+#define CV_METHOD_FRIEND 0x0c
+#define CV_METHOD_INTRO 0x10
+#define CV_METHOD_PUREVIRT 0x14
+#define CV_METHOD_PUREINTRO 0x18
+
#define CV_PROP_FWDREF 0x80
/* Debug Format Interface. Used in dwarf2out.cc. */