This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gengtype not support #if (GCC_MAJOR < 6)? how to support both for GCC v4.x and v6.x?

Hi GCC developers,

As ChangeLog-2014 mentioned: Remove support for if_marked and param_is about ggc, so I migrate to GCC v6.x, for example:

#if (GCC_MAJOR < 6)
// FIXME: gengtype not support macro?
//static GTY((if_marked("tree2int_marked_p"), param_is(struct tree2int)))
//    htab_t intCache;
struct intCacheHasher : ggc_cache_ptr_hash<tree2int> {
  static inline hashval_t hash(tree2int *t2i) {
    return tree_map_base_hash(t2i->base);

  static inline bool equal(tree2int *a, tree2int *b) {
    return a->base.from == b->base.from;

  static int keep_cache_entry(tree2int *&t2i) {
    return ggc_marked_p(t2i->base.from);
static GTY((cache))
    hash_table<intCacheHasher> *intCache;

$ gcc-6.3.0/build/gcc/build/gengtype -r gcc-6.3.0/build/gcc/gtype.state -P /tmp/ Input.cpp

but it still parse the deprecated if_marked and param_is for GCC v4.x, please give me some hint, thanks a lot!

Leslie Zhai - a LLVM developer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]