[llvm] Added clarifying comment to 'LLVMLinkInMCJIT' and 'LLVMLinkInInterpreter' (PR #92467)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 15:22:53 PDT 2024


https://github.com/Minding000 created https://github.com/llvm/llvm-project/pull/92467

## Issue

- The purpose of `LLVMLinkInMCJIT` and `LLVMLinkInInterpreter` is not obvious (especially when using a pre-built library)
- [Many projects](https://github.com/search?q=LLVMLinkInMCJIT%28%29+%28language%3AJava+OR+language%3AKotlin%29&type=code) call these functions when using pre-built LLVM libraries

## Changes

- Added clarifying comment to `LLVMLinkInMCJIT` and `LLVMLinkInInterpreter`

>From 8dd1d7fc70f04acfa624055ce8758dc1eb9ae1e8 Mon Sep 17 00:00:00 2001
From: Paul Ohlhauser <bendix.ohlhauser at gmail.com>
Date: Fri, 17 May 2024 00:12:13 +0200
Subject: [PATCH] Added comments.

---
 llvm/include/llvm-c/ExecutionEngine.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/llvm/include/llvm-c/ExecutionEngine.h b/llvm/include/llvm-c/ExecutionEngine.h
index c5fc9bdb4d07f..99f6669019d95 100644
--- a/llvm/include/llvm-c/ExecutionEngine.h
+++ b/llvm/include/llvm-c/ExecutionEngine.h
@@ -33,7 +33,15 @@ LLVM_C_EXTERN_C_BEGIN
  * @{
  */
 
+/**
+ * Empty function used to force the linker to link MCJIT.
+ * Calling this function on a pre-build library has no effect.
+ */
 void LLVMLinkInMCJIT(void);
+/**
+ * Empty function used to force the linker to link the LLVM interpreter.
+ * Calling this function on a pre-build library has no effect.
+ */
 void LLVMLinkInInterpreter(void);
 
 typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef;



More information about the llvm-commits mailing list