[PATCH] D19181: Map Attribute in the C API.

Amaury SECHET via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 10:08:01 PDT 2016


deadalnix added a comment.

There is no such thing as int attributes. There are attributes with int parameters, which is different. These are irrelevant as far as setting/getting attributes goes.


================
Comment at: include/llvm-c/Core.h:388-391
@@ +387,6 @@
+enum {
+  LLVMAttributeReturnIndex = 0U,
+  // ISO C restricts enumerator values to range of 'int'
+  // (4294967295 is too large)
+  // LLVMAttributeFunctionIndex = ~0U,
+  LLVMAttributeFunctionIndex = -1,
----------------
Wallbraker wrote:
> This will be a really annoying off by one situation, how are arguments addressed in other parts of the API, if they start with zero so should this.
> 
> Make function and return be -1 and -2.
> 
This is how it works on the C++ side, and is unlikely to change anytime soon.


http://reviews.llvm.org/D19181





More information about the llvm-commits mailing list