[PATCH] D18727: Add support for attribute in the C API

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 10:12:37 PDT 2016


rnk requested changes to this revision.
rnk added a comment.
This revision now requires changes to proceed.

First, you're breaking compatibility here with old programs using LLVMAttribute. We should ask Jeurgen about that. If we decide that LLVM's underlying attribute handling has changed so drastically that we're OK with a break, then we should delete the LLVMAttribute enum.

Second, you're exposing the C++ enum values of LLVM's attributes. I have a feeling that people will start adding enum attributes in the middle to keep related attributes together. If we want to go this way, where we leverage tablegen instead of maintaining a self-contained mapping the C API layer, then the tablegen records should have manually maintained attribute numbers. We'd either use those as the direct C++ enum values or use them to generate a switch to translate from C to C++. This would be just like protobuf field ids.


http://reviews.llvm.org/D18727





More information about the llvm-commits mailing list