[llvm] [LLVM] Add a C API for creating instructions with custom syncscopes. (PR #104775)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 19 07:19:42 PDT 2024
================
@@ -646,6 +646,26 @@ unsigned LLVMGetMDKindIDInContext(LLVMContextRef C, const char *Name,
unsigned SLen);
unsigned LLVMGetMDKindID(const char *Name, unsigned SLen);
+/**
+ * Maps a synchronization scope name to a ID unique within this context.
+ */
+unsigned LLVMGetSyncScopeIDInContext(LLVMContextRef C, const char *Name,
+ unsigned SLen);
+
+/**
+ * Maps a synchronization scope name to a unique ID.
+ *
+ * This is equivalent to calling LLVMGetSyncScopeIDInContext with
+ * LLVMGetGlobalContext() as the context parameter.
+ */
+unsigned LLVMGetSyncScopeID(const char *Name, unsigned SLen);
----------------
nikic wrote:
Don't add new function using global context. You can use the name LLVMGetSyncScopeID for the function accepting LLVMContextRef.
https://github.com/llvm/llvm-project/pull/104775
More information about the llvm-commits
mailing list