[llvm-commits] [llvm] r46565 - in /llvm/trunk: lib/CodeGen/MachineModuleInfo.cpp test/DebugInfo/globalGetElementPtr.ll
Dale Johannesen
dalej at apple.com
Thu Jan 31 10:46:25 PST 2008
On Jan 31, 2008, at 9:55 AM, Duncan Sands wrote:
>>> Hi Dale, maybe you could use IntrinsicInst::StripPointerCasts
>>> instead?
>>
>> Didn't know about this, thanks. It recurses and I don't think that's
>> what I want in this case. I did, however, steal its looping code:)
>
> Are you sure you don't want it to be recursive? I can take a global
> variable, bitcast it, do a GEP 0 on that, bitcast the result, etc.
> The final result will be equivalent to a single bitcast of the
> original
> global. So shouldn't this code handle it? Of course if the
> optimizers
> are run then they would simplify such a silly example. But it seems
> wrong to me to assume that the IR has been optimized...
No I'm not sure, but I know of no case where this is useful or
desirable.
The code in question is handling the debug info for global variables,
specifically the part that points to the global variable itself.
That's under the control of the front ends, although the optimizers
can do simplifications. I don't think there's a need to handle more
general expressions here.
More information about the llvm-commits
mailing list