[LLVMdev] Packages

Chris Lattner sabre at nondot.org
Tue Nov 18 00:30:01 PST 2003


> Yeah, you're right. I thought about it some more after I posted and it
> boils down to ExtraInfo actually needing to be notified about EVERY
> change. Not fun.

Yup.

> I've managed to get myself completely confused on this subject, but have
> just shed some "old think" from previous compilers.  The "old think" is
> that the source level symbol stuff must be completely segregated from
> the program itself (e.g. ELF debug sections).

Heh, LLVM requires a little bit of that.  :)

> But why?  Why shouldn't the source level information be coded right into
> the bytecode as part of the program? Why shouldn't it undergo
> optimization?  The only thing that I would need is a some kind of
> linkage class or flag that says "never, ever delete this".

We already have never, ever, delete this flags.  "weak" and external
linkage both guarantee that.  If there can be an external caller of some
function, for example, the optimizer CANNOT delete it, nor can it change
it's interface.

> If that was the case, I could use the full expression of LLVM assembly
> language to describe my source level information.  No?

I'm not sure exactly what you mean here, but yes, in principle, you should
be able to do exactly that.  You are limited to the LLVM type system and
such, but if that is sufficient, yes.

> This being the case, I could emit a function in each module that returns
> the source level information. To look at it, I just JIT load the module
> and call the function.  Any barriers to doing this?

None at all!

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list