[llvm] [SandboxIR] Adds BasicBlock and adds functionality to Function and Context (PR #97637)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 8 10:46:04 PDT 2024
================
@@ -278,12 +381,55 @@ class Context {
DenseMap<llvm::Value *, std::unique_ptr<sandboxir::Value>>
LLVMValueToValueMap;
+ /// Take ownership of VPtr and store it in `LLVMValueToValueMap`.
+ Value *registerValue(std::unique_ptr<Value> &&VPtr);
+
+ /// Helper for avoiding recursion loop when creating SBConstants.
+ SmallDenseSet<llvm::Constant *, 8> VisitedConstants;
+
+ Value *getOrCreateValueInternal(llvm::Value *V, int Depth,
+ llvm::User *U = nullptr);
+
+ template <typename SBT, typename LLVMT>
+ SBT *getOrCreateGeneric(LLVMT *LLVMV) {
----------------
aeubanks wrote:
shouldn't `LLVMT` always be a `llvm::Value`?
https://github.com/llvm/llvm-project/pull/97637
More information about the llvm-commits
mailing list