[LLVMdev] Attributes & CloneFunctionInto
Chareos at gmx.de
Wed May 15 08:51:09 PDT 2013
thanks for the pointer. However, I'd rather avoid rolling a custom
implementation. After all, it's not like I want to do something
I had sorted out the problem for 3.2 as well as a previous version of
3.3 trunk, but the API changed about a hundred times. Now as it
apparently has stabilized, I moved to a the 3.3 release branch just to
find that even my previous workarounds don't work anymore.
I can't understand why the API of llvm::Function does not simply provide
- setAttribute(unsigned paramIdx, AttributeKind A) and
- removeAttribute(unsigned paramIdx, AttributeKind A).
On 5/15/13 5:39 PM, John Criswell wrote:
> On 5/15/13 10:27 AM, Ralf Karrenberg wrote:
>> I am again struggling to find my way around the Attribute classes.
>> What I want to do is clone a function into a declaration where some
>> parameters may have a different alignment.
>> CloneFunctionInto in debug mode hits an assertion which is marked with
>> a FIXME (Attributes.cpp:673).
>> I would be totally fine with any kind of workaround, e.g. removing all
>> attributes from the target declaration, then cloning, and then setting
>> the correct attributes.
>> However, I can't find a way to modify an existing alignment *in any
>> way* without hitting an assertion (the other one being line 727 for
>> removeAttributes). I've also tried using addAttributes() and
>> setAttributes() to set the alignment to 0, but this seems to be
> SAFECode clones a function to change the alignment of byval arguments.
> You can look at the code at
> Note that the code works with LLVM 3.2.
> -- John T.
>> Any help on this? :)
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev