[PATCH] D159418: Move CallInst::CreateFree to IRBuilderBase

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 02:42:17 PDT 2023


nikic added inline comments.


================
Comment at: llvm/examples/BrainF/BrainF.cpp:129
+  // call free(i8 *%arr)
+  builder->SetInsertPoint(endbb->end());
+  builder->CreateFree(ptr_arr);
----------------
I don't think this is going to compile. Should be something like `builder->SetInsertPoint(endbb);`

You probably need to pass `-DLLVM_BUILD_EXAMPLES=ON` to cmake to build this code.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp:1404
         Bundles.push_back(OperandBundleDef(*Bundle));
-    auto *Free = CallInst::CreateFree(SetjmpTable, Bundles, I);
+    auto *Free = IRB.CreateFree(SetjmpTable, Bundles);
     Free->setDebugLoc(DL);
----------------
I think you may need an `IRB.SetInsertPoint(I)` here? I'm not sure what the insertion point of this IRB is at this point.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159418/new/

https://reviews.llvm.org/D159418



More information about the llvm-commits mailing list