[llvm] [llvm-c] Add getters for LLVMContextRef for various types (PR #99087)

Bogdan-Alexandru Geană via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 12:51:04 PDT 2024


================
@@ -3434,6 +3441,13 @@ void LLVMMoveBasicBlockBefore(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos);
  */
 void LLVMMoveBasicBlockAfter(LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos);
 
+/**
+ * Obtain the context to which this basic block is associated.
+ *
+ * @see llvm::Module::getContext()
+ */
+LLVMContextRef LLVMGetBasicBlockContext(LLVMBasicBlockRef BB);
----------------
abgeana wrote:

I am planning to use this via [llvm-sys.rs](https://gitlab.com/taricorp/llvm-sys.rs), and that would make the API more consistent both in C and in the rust bindings.

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


More information about the llvm-commits mailing list