The LLVM project does not distinguish between signed and unsigned integers, as described here . There are situations when you need to know whether a particular variable should be interpreted as signed or unsigned, for example, when it is expanded in size or when it is used in a unit. My solution is to keep separate type information for each variable, which describes whether it is integer or cardinal.
However, I wonder if there is no way to "attribute" the LLVM type this way? I was looking for some “user data” that could be added to the type, but it seems nothing. This was supposed to happen somehow when a type is created, since the same types are generated only once in LLVM.
So my question is:
Is there a way to keep track of whether the integer variable should be interpreted as signed or unsigned in the LLVM framework, or is it the only way to keep separate information like me?
thanks
llvm llvm-ir llvm-c ++ - api
Herr_Doktor
source share