[LLVMdev] Extracting all BasicBlocks of a Function into new Function

Chris Lattner sabre at nondot.org
Fri Oct 6 15:01:12 PDT 2006

On Thu, 5 Oct 2006, Bram Adams wrote:
>> Why not va_copy the input valist?
> ... and so would this. The only problem left is that both require an
> easy way to replace each use of the original va_list situated AFTER a
> (to be removed) va_end with the second va_list. This seems a task for
> a control flow graph based function checking the (possibly partial)
> order between two Instructions, i.e. to check whether a Use is
> situated after a CallInst to va_end.
> Does such a method already exist in one of the transform or analysis
> passes? Or does a replaceAllUsesAfterThisInstruction() method exist?


> A related question: What's the easiest way to replace all uses of a
> Value, but only within, say, a Function?

What sort of value?  If the 'old' value is an instruction, argument, or 
basicblock, you know that the only uses can be within the current 
function.  Thus, replaceAllUsesWith should do the trick.



More information about the llvm-dev mailing list