[LLVMdev] C Types -> LLVM Objects

Chris Lattner sabre at nondot.org
Sun Oct 30 22:28:28 PST 2005

On Mon, 31 Oct 2005, Chris Lattner wrote:
>> I'm thinking that a better solution would be to write some tool that takes 
>> the "null" bytecode and outputs a C++ file so I don't need to link my 
>> compiler with the bytecode reader, or be able to find the "nullmodule.bc" 
>> file. Are there any better ways to do this?
> Unfortunately, I'm not aware of a better way to do this.  If you care about a 
> few specific functions, you can hard code them into the compiler. If you care 
> about general functions or a large number of them, this is a reasonable 
> approach.

One thing I should mention: this is only if you REALLY care about the 
types that a function takes (e.g. what FILE is on the system).  For most 
uses, you can just prototype a function as taking an 'sbyte*' and cast 
pointer values to sbyte* before calling the function.  This could simplify 
things enough that you can do simple things instead of grand and 
complicated ones.



More information about the llvm-dev mailing list