Hi Is there any rationale written down for why integer types don't carry (perhaps optional) signs somewhere? I feel like I might have read it somewhere before (and I see that it used to exist pre 2.0), but I can't find anything now. Relatedly, is there a reasonable way to attach user-data to a type or something? It feels very cumbersome to have to wrap all values and types in my front end. For example, I know I want to load a function argument, either sign-extend or zero-extend it, and then store it into a local. I have to mirror LLVM's object model for types, values, functions, etc. because I can't just get the parameter value from the function, ask it for it's type, and convert it in the correct way. thanks, scott
On Fri, Sep 19, 2008 at 2:16 PM, Scott Graham <scott.llvm at h4ck3r.net> wrote:> Is there any rationale written down for why integer types don't carry > (perhaps optional) signs somewhere?http://nondot.org/sabre/LLVMNotes/TypeSystemChanges.txt> Relatedly, is there a reasonable way to attach user-data to a type or > something? It feels very cumbersome to have to wrap all values and > types in my front end. For example, I know I want to load a function > argument, either sign-extend or zero-extend it, and then store it into > a local. I have to mirror LLVM's object model for types, values, > functions, etc. because I can't just get the parameter value from the > function, ask it for it's type, and convert it in the correct way.http://llvm.org/docs/LangRef.html#int_general might be helpful? If you just need it while you're doing the translation, though, you could just keep around additional information for variables in your own data structures. -Eli
On Sep 19, 2008, at 2:16 PM, Scott Graham wrote:> Hi > > Is there any rationale written down for why integer types don't carry > (perhaps optional) signs somewhere? I feel like I might have read it > somewhere before (and I see that it used to exist pre 2.0), but I > can't find anything now.There is some motivation in this talk: http://llvm.org/pubs/2007-07-25-LLVM-2.0-and-Beyond.html -Chris