> 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 ?
Hi Julien,>> 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 ?probably it can be extracted from debug info, but what if there is no debug info? Can you please explain what you intend to do with this information - then maybe we can suggest another way to solve your problem. Ciao, Duncan.
>> 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 ? > > probably it can be extracted from debug info, but what if there is no debug > info? Can you please explain what you intend to do with this information - > then maybe we can suggest another way to solve your problem. >Thanks for your help. Actually, I'm working on a static analyzer that computes invariants at each basicBlock: "In basicBlock B, what is the set of possible assignments for each live values ?" and I obtains results such as "In B, we have 0 <= x <= 42" For an function's argument of type T, at the beginning of my analysis, I consider its set of possible values is all the set of all elements of type T. In the case of an int, it is [-2^31; 2^31-1], whereas it is [0, 2^32-1] for an unsigned... That's the reason why I was searching in the llvm bitcode something distinguishing these two types. Julien Henry