This is an archive of the discontinued LLVM Phabricator instance.

Add support for attribute for call and invoke instruction in the C API
AbandonedPublic

Authored by deadalnix on Apr 2 2016, 3:50 PM.

Details

Diff Detail

Event Timeline

deadalnix updated this revision to Diff 52483.Apr 2 2016, 3:50 PM
deadalnix retitled this revision from to Add support for attribute for call and invoke instruction in the C API.
deadalnix updated this object.
deadalnix added a subscriber: llvm-commits.
Wallbraker requested changes to this revision.Apr 3 2016, 3:18 AM
Wallbraker added a reviewer: Wallbraker.
Wallbraker added a subscriber: Wallbraker.

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);
}
This revision now requires changes to proceed.Apr 3 2016, 3:18 AM
whitequark resigned from this revision.Oct 13 2017, 11:23 PM
deadalnix abandoned this revision.Oct 14 2017, 6:36 AM

This is not relevent anymore.