[LLVMdev] non-signed integer Type

Eli Friedman eli.friedman at gmail.com
Fri Sep 19 15:07:10 PDT 2008


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



More information about the llvm-dev mailing list