[LLVMdev] Re: Newbie questions

Reid Spencer reid at x10sys.com
Wed Apr 26 15:12:08 PDT 2006

On Wed, 2006-04-26 at 16:32 -0500, Chris Lattner wrote:
> I still don't follow.  Having annotations on the IR is *exactly* 
> equivalant to having a map from IR objects to the things you want to 
> annotate them with.
> Why isn't this just as acceptable (and problematic) as annotations?

Because LLVM doesn't store that map, someone else has to. Furthermore,
LLVM doesn't assist with the on-disk association. The pointers in the
map are useless after the IR objects are written to disk and the program
terminates.  LLVM also doesn't have a facility for reconstruction of the
map when bytecode is read. 

We've talked about this before and loosely suggested that it might be
possible to:
     1. have llvm provide an interface for storing a "blob" at the end
        of a bytecode file. LLVM ignores this blob.
     2. Augment BytecodeHandler.h to allow for unique identifiers with
        each object being read (it does some of this now).
     3. Create something like BytecodeHandler for writing so that the
        unique identifiers can be associated with the user's map.
     4. Leave details of the "blob" construction up to the user.

If there's a better solution, I'm all ears.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060426/daaea2f2/attachment.sig>

More information about the llvm-dev mailing list