[llvm] [SandboxIR] Implement LoadInst (PR #99597)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 19 08:16:09 PDT 2024


================
@@ -568,6 +611,17 @@ Value *Context::getOrCreateValueInternal(llvm::Value *LLVMV, llvm::User *U) {
     return nullptr;
   }
   assert(isa<llvm::Instruction>(LLVMV) && "Expected Instruction");
+
+  switch (cast<llvm::Instruction>(LLVMV)->getOpcode()) {
+  case llvm::Instruction::Load: {
+    auto *LLVMLd = cast<llvm::LoadInst>(LLVMV);
+    It->second = std::unique_ptr<LoadInst>(new LoadInst(LLVMLd, *this));
----------------
vporpo wrote:

Just like the lines above we can't use `make_unique` because the constructors are private.

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


More information about the llvm-commits mailing list