[PATCH] D18260: Expose IRBuilder::CreateAtomicCmpXchg as LLVMBuildAtomicCmpXchg in the C API.

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 18 20:40:34 PDT 2016

joker.eph added inline comments.

Comment at: include/llvm-c/Core.h:2949
@@ +2948,3 @@
+LLVMBool LLVMGetSingleThread(LLVMValueRef MemoryAccessInst);
+void LLVMSetSingleThread(LLVMValueRef MemoryAccessInst, LLVMBool SingleThread);
Returning a bool, I'd prefix it `isXXX` instead of `getXXX`

Comment at: lib/IR/Core.cpp:2941
@@ +2940,3 @@
+LLVMAtomicOrdering LLVMGetSuccessOrdering(LLVMValueRef MemoryAccessInst)  {
+  Value *P = unwrap<Value>(MemoryAccessInst);
I'd name it so that it is explicit that it only operates on cmpxchg.
Something like: `LLVMGetCmpXchgSuccessOrdering(LLVMValueRef CmpXchgInst)`
(same in the other API)


More information about the llvm-commits mailing list