diff --git a/llvm/examples/ModuleMaker/ModuleMaker.cpp b/llvm/examples/ModuleMaker/ModuleMaker.cpp index e409dd60e9b04..033f91d0830f2 100644 --- a/llvm/examples/ModuleMaker/ModuleMaker.cpp +++ b/llvm/examples/ModuleMaker/ModuleMaker.cpp @@ -55,10 +55,10 @@ int main() { "addresult"); // explicitly insert it into the basic block... - BB->getInstList().push_back(Add); + Add->insertAt(BB, BB->end()); // Create the return instruction and add it to the basic block - BB->getInstList().push_back(ReturnInst::Create(Context, Add)); + ReturnInst::Create(Context, Add)->insertAt(BB, BB->end()); // Output the bitcode file to stdout WriteBitcodeToFile(*M, outs());