Copy instruction from one function to another

How can I copy an instruction from one function to another.
Already seen cloneFunction.cpp and clone.h but still am not been able to
implement this thing.
facing an errors like "Instruction does not dominate all uses!", "Broken
module found, compilation aborted!" etc.
Can anyone help me on this implementation?