[LLVMdev] ParamAttr Patch - Alignment fix

Anders Johnsen skabet at gmail.com
Mon Apr 28 08:07:08 PDT 2008


On Sunday 27 April 2008 01:33:31 Gordon Henriksen wrote:
> On Apr 26, 2008, at 19:09, Anders Johnsen wrote:
> > On Sunday 27 April 2008 00:48:00 Gordon Henriksen wrote:
> >> On Apr 26, 2008, at 17:41, Anders Johnsen wrote:
> >>> +void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
> >>> unsigned align) {
> >>> +  CallSite Call = CallSite(unwrap<Instruction>(Instr));
> >>> +  Call.setParamAttrs(
> >>> +    Call.getParamAttrs().addAttr(index,
> >>> +        ParamAttr::constructAlignmentFromInt(align)));
> >>> +}
> >>
> >> If I call this twice with different values, don't I get the bitwise
> >> OR of the two constructAlignmentFromInt values? Does PAListPtr
> >> provide a better API for this?
> >
> > You are not allowed to set alignment twice - tried it, and got
> > myself an assert. (Is this expected behavior?)
>
> Classy!
>
> — Gordon
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Should hopefully be the last one :)

Anders Johnsen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParamAttr.patch
Type: text/x-diff
Size: 5469 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080428/20f6ea72/attachment.patch>


More information about the llvm-dev mailing list