Hi, I'm trying to know if an llvm::Value Object is signed or unsigned (when its Type is integer). I don't find where this information is located. Do you have an idea ? Julien Henry
Hi Julien,> I'm trying to know if an llvm::Value Object is signed or unsigned (when > its Type is integer). > I don't find where this information is located. > Do you have an idea ?this information does not exist: integer types are not signed or unsigned. Instead, operations on integers that work differently depending on the sign have signed and unsigned versions in LLVM. For example LLVM has both udiv and sdiv instructions (unsigned and signed divisions). Ciao, Duncan.
Hello> I'm trying to know if an llvm::Value Object is signed or unsigned (when > its Type is integer). > I don't find where this information is located. > Do you have an idea ?Values cannot be signed or unsigned since they represent some object in memory / register. It's the operation which says whether the value should be treated as signed or not. -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
> Values cannot be signed or unsigned since they represent some object > in memory / register. It's the operation which says whether the value > should be treated as signed or not.Ok. But typically if I compile a program with a variable of type "unsigned" and another one of type "int": void f() { unsigned x; int y; ... } The compiler remembers for debugging purpose that x is defined as unsigned, and y as signed, no ? I'm not familiar with LLVM debug info, but maybe I can find this info there ?