<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Hi,</div><div><br></div><div>I recently upgraded to the latest LLVM build and encountered a problem where the API for Argument::addAttr has changed.</div><div><br></div><div>Previously it was Argument::addAttr(Attribute A) and I was able to work with this.</div><div><br></div><div>The latest build has changed the method addAttr so that it requires an AttributeSet argument (Argument::addAttr(AttributeSet AS).</div><div><br></div><div>I'm not sure how to adjust to this change. The AttributeSet object seems to store an array of Attribute(s) to construct an AttributeSet argument for addAttr I need to know the index of the Argument in the function?</div><div><br></div><div>I can follow the lead of this code from Core.cpp:</div><div><br></div><div><div><font face="Courier">void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA) {</font></div><div><font face="Courier"> Argument *A = unwrap<Argument>(Arg);</font></div><div><font face="Courier"> AttrBuilder B(PA);</font></div><div><font face="Courier"> A->addAttr(AttributeSet::get(A->getContext(), A->getArgNo() + 1, B));</font></div><div><font face="Courier">}</font></div></div><div><br></div><div><br></div><div>Is this all I need? What does the A->getArgNo()+1 provide? The index of the argument in the function argument list+1?</div><div><br></div><div>Is this change to the API described anywhere?</div><div><br></div><div>Best,</div><div><br></div><div>.Chris.</div><div><br></div><div><br></div></body></html>