index-test

http://clang.llvm.org/docs/libIndex.html describes how to use tool
index-test, but this tools was apparently removed according to an ealier
post (yet no one updated the doc! doh!).

I found c-index-test which has similar functionality but takes different
arguments. I would like to be able to study this tool to see how the
CIndex API works, so would love it if someone could document how to use
c-index-test. I can only figure out how to do simple things from the
usage. For example, I created a pch from a source file with -write-pch
but have no idea what it's good for. Is this the "PCH preamble"
discussed in a resply to my previous email?

   $/home/dawn/dev/llvm/Debug+Asserts/bin/c-index-test -write-pch /tmp/x.pch /tmp/x.c

Now what? I want to use /tmp/x.pch instead of /tmp/x.c.
Ultimate goal - to create and use a PCH preamble with code completion to see how it works.

Thanks,
-Dawn

http://clang.llvm.org/docs/libIndex.html describes how to use tool
index-test, but this tools was apparently removed according to an ealier
post (yet no one updated the doc! doh!).

Oops. I'll kill the dead documentation.

I found c-index-test which has similar functionality but takes different
arguments. I would like to be able to study this tool to see how the
CIndex API works, so would love it if someone could document how to use
c-index-test. I can only figure out how to do simple things from the
usage. For example, I created a pch from a source file with -write-pch
but have no idea what it's good for. Is this the "PCH preamble"
discussed in a resply to my previous email?

No. It just creates a PCH file, and is equivalent to using the -x c-header or -x c++-header arguments to the normal clang driver.

  $/home/dawn/dev/llvm/Debug+Asserts/bin/c-index-test -write-pch /tmp/x.pch /tmp/x.c

Now what? I want to use /tmp/x.pch instead of /tmp/x.c.

-include /tmp/x

will include it as a precompiled prefix header. That's just normal PCH usage, as documented in the user manual.

Ultimate goal - to create and use a PCH preamble with code completion to see how it works.

PCH preambles are automatic in libclang, but turning them on is a total hack. Set the CINDEXTEST_EDITING environment variables, as we do in the test suite, to enable them.