[llvm] [SandboxIR] Implement SandboxIR Type (PR #106294)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 10:06:10 PDT 2024
vporpo wrote:
> I thought we were going to just use llvm::Type. Can you add in the description why we need this?
There are a couple of reasons:
- Creating an `llvm::Type` from within SandboxIR-only code doesn't work well because it requires you to pass `llvm::Context` to functions like `llvm::Type::getInt32Ty(C)`, but you wouldn't normally have access to llvm::Context. In unit tests this is not such a big deal because you have access to both, but it will become an issue in SandboxIR-only code.
- Not being able to get the `sandboxir::Context` from `llvm::Type` results in awkward sandboir APIs with additional `sandboxir::Context` arguments.
- `llvm::Type::getContext()` can basically give you access to the whole LLVM IR, which we should try to avoid.
https://github.com/llvm/llvm-project/pull/106294
More information about the llvm-commits
mailing list