[LLVMdev] Integer handling

OvermindDL1 overminddl1 at gmail.com
Mon Sep 29 14:48:30 PDT 2008


I know why it was removed, and it does make sense, just would be nice
if there was an option to be able to get two pointer to a specific
llvm::IntegerType, functionally they would be identical, but for user
code (hence, my code) would be useful as I could match it for the
different ones at generate different code for each.

With some discussion with others I think we came up with an acceptable
method (which allows me to completely kill my type duplication system,
thank god).  I am going to go down the area of
Java/Python/Lua/whatever_else and just have normal operators (/,
shifts, etc...) act as if the integers are signed.  But there will
also be named ops (udiv/sdiv) which can be used in place of a symbol
op (such as /) to be explicit for those who really need unsigned
usage.  I plan for the operators to actually all be named (so instead
of + someone could put add instead for example), and am just allowing
the symbol ones to allow it to be easier to pick up for
non-such-low-level-programmers.  I think it is a decent enough
compromise (and it was not entirely my idea, I like the back-end ugly
coding, not front-end pretty syntax :) ).

The main issue I was having with my type system was not that is was
hard (I think it is actually well designed and powerful), it just
caused me to have to write 'wrappers' around near everything in llvm,
from functions and blocks to expressions and all, it literally just
started snowballing, and since I am programming by myself, I need
something a little more efficient in this case...

Either way, what do you think of the above style for handling integers
now, think it will work?  See any major issues with it?  You think
people would have trouble using that style?



More information about the llvm-dev mailing list