[llvm] [SandboxIR] Implement PHINodes (PR #101111)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 19:15:13 PDT 2024


================
@@ -1301,6 +1407,11 @@ Context::createGetElementPtrInst(llvm::GetElementPtrInst *I) {
   return cast<GetElementPtrInst>(registerValue(std::move(NewPtr)));
 }
 
+PHINode *Context::createPHINode(llvm::PHINode *I) {
+  auto NewPtr = std::unique_ptr<PHINode>(new PHINode(I, *this));
+  return cast<PHINode>(registerValue(std::move(NewPtr)));
----------------
vporpo wrote:

nit: Perehaps `return cast<PHINode>(registerValue(std::unique_ptr<PHINode>(new PHINode(I, *this))));` ?

https://github.com/llvm/llvm-project/pull/101111


More information about the llvm-commits mailing list