Now that LLVM’s AnnotationManager is gone (it disappeared in the 2.6 release, I think?), how can I get the annotations for specific functions, globals, and instructions?
(For example, I have bitcode compiled from C void myFunction(__attribute__((annotate("foo"))) int var) — given an Argument * reference to this int var argument, how might I determine which annotate attributes are attached to it?)
To get annotations for a specific function, traverse the entry BasicBlock of the function to find its calls to the
@llvm.var.annotationintrinsic, as follows: