[cfe-dev] Unable to do even basic Clang tutorial

Bill White bill.white at griggsinst.com
Tue Jul 10 14:04:51 PDT 2012


So, here's a followon question.  If one was starting a new project,
would one use libclang,
write a plug-in, or use the libtooling library?  For my application,
at least initially, libclang
seems like a good starting point.  But the tooling library would give
me access to the
compilation database, which would let me tell the clang parser what -I
and -D flags to use.  I'm
not sure how to do that with the libclang interface today.  The
documentation is not
clear.  Also, I'm not sure how system headers and definitions are to
be supplied.  But in
my application I would have to specify these separately, as we are
very sensitive to the
system headers, or at least to the version of the gcc headers which
are included.

In particular, I'd like to write an indexing tool,
like ctags but better.  There seems to be a lot of interest and
discussion of it, but nothing
seems to be usable.  I particularly want a tool which can be usable by
emacs, which is my
main editor, but with the kind of facilities that Eclipse CDT has.  These are:
  1.) The ability to dive on an identifier and tell (a) where the identifier is
      declared, and (b) the static type of the identifier.
  2.) The ability to dive on a class name and display the entire class
hierarchy,
      both base classes and classes derived from the class.  I've used
this is Java
      under Eclipse, and found it enormously useful.
  3.) The ability to show, in some sort of a pop-up window, the result
of expanding
      a macro invocation, or some kind of way of telling that a
template is being
      expanded.  These seem secondary to (1) and (2), though.

If I'm missing some progress in this area, I apologize.  It seems as
if there has been a lot
of discussion, but I haven't seen anything usable, and I'm coming into
some time to
work on it.  Does libclang seem usable?

Thanks.



More information about the cfe-dev mailing list