[LLVMdev] Attributes & CloneFunctionInto

John Criswell criswell at illinois.edu
Wed May 15 08:39:33 PDT 2013

On 5/15/13 10:27 AM, Ralf Karrenberg wrote:
> Hi,
> 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 
> ignored...

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? :)
> Thanks,
> Ralf
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list