[PATCH] D18733: Add support for attribute for call and invoke instruction in the C API

Jakob Bornecrantz via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 3 03:18:27 PDT 2016


Wallbraker added a subscriber: Wallbraker.
Wallbraker requested changes to this revision.
Wallbraker added a reviewer: Wallbraker.
Wallbraker added a comment.
This revision now requires changes to proceed.

Can we please have one release with the new and old functions. Removing and adding replacement functions in the same release makes the upgrade path much harder. I can not upgrade the LLVM version I use because it breaks my build (build bots, other users and so on). And I can not change my code without breaking anything that still uses the old version (build bots, other users and so on). This is all made worse that the symbols are still there but their semantics have change, so it will just be hard to debug black magic errors.

So adding LLVMAddInstrAttribute2 and LLVMRemoveInstrAttribute2 and keeping the old functions but mark them as deprecated, removing them the release after that (3.10).

Maybe we should add a way to get the number of attribute a function has and be able to get a list of them?

  size_t LLVMInstrGetNumAttribute(LLVMValueRef val);
  LLVMBool LLVMInstrGetNumAttribute(LLVMValueRef val, size_t index, unsigned int *KindID);
  
  ...
  
  
  auto num = LLVMInstrGetNumAttribute(val);
  uint[] arr;
  arr.length = num;
  foreach (i, ref e; arr) {
      LLVMInstrGetAttributeAtIndex(val, i, &e);
  }


http://reviews.llvm.org/D18733





More information about the llvm-commits mailing list