[LLVMdev] ParamAttr Patch - Alignment fix

Gordon Henriksen gordonhenriksen at mac.com
Sat Apr 26 16:33:31 PDT 2008


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





More information about the llvm-dev mailing list