[LLVMdev] How to copy a Function

Jim Grosbach grosbach at apple.com
Mon May 17 16:29:10 PDT 2010


On May 17, 2010, at 3:36 PM, Jianzhou Zhao wrote:

> Hi,
> 
> I wanted to backup a Function before it is optimized. The Function
> class disallows assignment operations as it comments:
>  Function(const Function&); // DO NOT IMPLEMENT
>  void operator=(const Function&); // DO NOT IMPLEMENT
> Is there a way to construct a copy from an existing Function?
> 

CloneFunction() may do what you want. See:
llvm/include/llvm/Transforms/Utils/Cloning.h


> Thanks.
> -- 
> Jianzhou
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list