[LLVMdev] Transforming ConstantExprs to Instructions
matthijs at stdin.nl
Wed Jun 18 01:36:49 PDT 2008
> > [ Snip replacing constantexprs with instructions ]
> Ok, this is not possible in general though, global variable initializers
> have to be constants, not instructions.
Yeah, so if not all uses can be replaced, my pass will just have to skip the
> Is it possible to design the pass to work with both? The general approach
> is to make stuff handle "User"s instead of Instructions. It is much more
> compile time efficient to just handle the two forms rather than converting
> them back and forth.
With both I assume you mean both GEP instrs and GEP constantexprs? If so then
yes, I am intending to make it work with both, and that's exactly why I need
to convert the constantexprs to instructions (Since, unless I'm very much
mistaken, a gepconstantexpr won't work with an alloca, so I can't leave them
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: Digital signature
More information about the llvm-dev