[NFC] Fixes ModuleMaker example build failure caused by c143b77b30fc23f70aac94be66e41...
authorVasileios Porpodas <vporpodas@google.com>
Wed, 14 Dec 2022 21:29:10 +0000 (13:29 -0800)
committerVasileios Porpodas <vporpodas@google.com>
Wed, 14 Dec 2022 22:52:02 +0000 (14:52 -0800)
Differential Revision: https://reviews.llvm.org/D140052

llvm/examples/ModuleMaker/ModuleMaker.cpp

index e409dd6..033f91d 100644 (file)
@@ -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());