Remove TYPE_TAG_NAME
[deliverable/binutils-gdb.git] / gdb / python / py-type.c
index 80055b05e05c72f9f9c10994984f5d1529854284..dd8c0aa9dcb471a1a03ebf4568f725a66e153b42 100644 (file)
@@ -416,10 +416,16 @@ static PyObject *
 typy_get_tag (PyObject *self, void *closure)
 {
   struct type *type = ((type_object *) self)->type;
+  const char *tagname = nullptr;
 
-  if (!TYPE_TAG_NAME (type))
+  if (TYPE_CODE (type) == TYPE_CODE_STRUCT
+      || TYPE_CODE (type) == TYPE_CODE_UNION
+      || TYPE_CODE (type) == TYPE_CODE_ENUM)
+    tagname = TYPE_NAME (type);
+
+  if (tagname == nullptr)
     Py_RETURN_NONE;
-  return PyString_FromString (TYPE_TAG_NAME (type));
+  return PyString_FromString (tagname);
 }
 
 /* Return the type, stripped of typedefs. */
This page took 0.032614 seconds and 4 git commands to generate.