reading & writing bitcode from non file, e.g. GDBM store (or MySQL database)

Hello All,

(Sorry, I probably did already ask something similar before, but I cannot recall it easily)

First, I don't understand what precisely is in the /usr/local/include/llvm/Support/ directory

In particular, it seems to me that nothing in the documentation says that MemoryBuffer.h in inside it....

I'm quite annoyed to understand what exactly is the public interface to LLVM!
The doxygen documentation does not help: some classes or includes are conceptually private to the LLVM implementation, i.e. not available in /usr/local/include/ after a standard installation

May I suggest to add (progressively) into the LLVM doxygen-ed documentation some conventional comments to explain that such & such stuff is private to the implementation, or available to users after a standard installation (and without any tweaking of LLVM sources!)

I want to store modules inside non-files, for example inside GDBM entries (or inside MySQL databases). Apparently, I can read a module from a GDBM store with something like (all error handling is skipped)

   datum keyd, vald; // GDBM key & value
   // fill keyd appropriately
   vald = gdbm_fetch (bark_gdbm, keyd);
   MemoryBuffer* membuf = MemoryBuffer::getMemBuffer(vald.dptr,
          vald.dptr+vald.dsize, bufnam);
   Module* lmodu = ParseBitcodeFile(membuf, &errmsg);
   // do something appropriate with the llvm module lmodu

Unfortunately, there is no way of dumping into memory, except by going thru a stdc++ memory output buffer. Or am I wrong on this?

Regards, and thanks for your patience & reading.

First, I don't understand what precisely is in the /usr/local/include/llvm/Support/ directory

In particular, it seems to me that nothing in the documentation says that MemoryBuffer.h in inside it....

I'm quite annoyed to understand what exactly is the public interface to LLVM!
The doxygen documentation does not help: some classes or includes are conceptually private to the LLVM implementation, i.e. not available in /usr/local/include/ after a standard installation

That is a bit frustrating. If a symbol is defined under "include/llvm", then it is public (installed). If it comes from "lib" someplace, then it is private (not installed). doxygen includes this information on some pages [1]. Reading the headers directly might make it clearer.

The doxygen documentation is complimentary to the documentation in prose [2], so you might look there first.

I want to store modules inside non-files, for example inside GDBM entries (or inside MySQL databases). Apparently, I can read a module from a GDBM store with something like (all error handling is skipped)
...
Unfortunately, there is no way of dumping into memory, except by going thru a stdc++ memory output buffer. Or am I wrong on this?

I think you've answered your own question!

— Gordon

[1] Like here, right at the top: http://llvm.org/doxygen/Type_8h.html
[2] http://llvm.org/docs/ etc., especially http://llvm.org/docs/ProgrammersManual\.html