public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* The AST tree modification. Edited.
@ 2011-10-03 22:51 niXman
  2011-10-04 20:50 ` Iyer, Balaji V
  0 siblings, 1 reply; 8+ messages in thread
From: niXman @ 2011-10-03 22:51 UTC (permalink / raw)
  To: gcc

Hi everybody!
It is necessary to implement a plug-in for GCC designed to collect the
information on types of translation unit, and generate static const
array of types rtti_ex _ on its base;
 //////////////////////////////////////
enum class type_ {
   char_, uchar_, short_, ushort_, int_, uint_, long_, ulong_,
   int64_, uint64_, array_, pointer_, double_, long_double_, float_,
   class_
};

struct rtti_ex_ { // <<<<<<<<<<<<<<<<<<<<<<<<<
   const char* name;
   const type_ type;
   const size_t size;
   const size_t align;
   const size_t offset;
};

// generated from plugin.
static const rtti_ex_ rtti_ex_array_[] = {
   {...},
   {...},
   {...}
};
/////////////////////////////////////

There aren't any problems with information collection from AST. There
is a complexity with AST modification:
1. How to declare a variable?
2. How to declare the typedef?
3. How to declare a structure?
4. How to declare an array of structures?
I suppose that there should be a function like: tree make_subtree
(const char* source); which result I could insert in the corresponding
node. But I haven't found it.

Please, give me some links on this subject. It is very desirable, if
you could give some links with examples.

Thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-15 17:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-03 22:51 The AST tree modification. Edited niXman
2011-10-04 20:50 ` Iyer, Balaji V
2011-10-04 21:10   ` niXman
2011-10-05  1:38     ` Ian Lance Taylor
2011-10-07  2:06   ` Andi Hellmund
     [not found]     ` <CAMPTgK0_VW2i_EoOXowFS=Zhaf_iWy4x5NU89Ro9xCCTABBU3w@mail.gmail.com>
2011-10-07  5:36       ` Fwd: " niXman
2011-10-12  5:03         ` niXman
2011-10-15 22:45           ` niXman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).