DECL_NAME() yields ._69 for anonymous union parsed with g++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am analysing the AST of the following code (of GCC):

  struct ssa_use_operand_d {
    struct ssa_use_operand_d *prev;
    struct ssa_use_operand_d *next;
    union {
       gimple stmt;
       tree ssa_name;
    } loc;
     tree *use;
  };

DECL_NAME(TYPE_NAME(t)) of the union type node should equal
NULL_TREE, since it is an unnamed entity. However, if I parse
the above code using g++, the returned identifier is "._69".

Converting the AST back to C code using the gcc-lua plugin, this yields

  union ._69 {
    gimple stmt;
    tree ssa_name;
  };
  struct ssa_use_operand_d {
    struct ssa_use_operand_d *prev;
    struct ssa_use_operand_d *next;
    union ._69 loc;
    tree *use;
  };

Why does g++ assign an identifier to an unnamed (artificial) TYPE_DECL?

How can one differentiate between a named and an unnamed union, if
the TYPE_DECL node has an (user- or compiler-generated) identifier
in both cases?

Thanks,
Peter


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux