On Fri, Jun 6, 2014 at 5:32 PM, Tyler Nowicki <[email protected]> wrote:
> Sorry this was supposed to go to cfe-commits.
>
>> Hi Aaron,
>>
>> Previously we discussed the problem of the AttributeList
>>
>>>> [Tyler] There was a question about why I reversed the iteration over the 
>>>> attribute
>>>> list. The answer is that the attribute list built by ParsedAttributes 
>>>> stores
>>>> attributes in reverse order. However, this is wrong because the correct
>>>> order should be maintained for serialization/deserialization and error
>>>> reporting. So we have to iterate rbegin->rend. Ideally the ParsedAttributes
>>>> list should be fixed to store attributes in the order they appear but this
>>>> looks like a lot of work.
>>>
>>> [Aaron] Ah, yes. That problem keeps rearing its ugly head. :-/
>>
>>
>>>> [Aaron] When you reintroduce your changes, I think I would prefer to leave 
>>>> the
>>>> iteration in its current (forward) order instead of reverse order (as
>>>> you have it in your patch). That's simply a bug, and working around it
>>>> here is likely to ensure that bug sticks around even longer. Once you
>>>> have introduced your changes, I'd appreciate an extra test case which
>>>> uses -ast-print and demonstrates the reversed order (I am okay with us
>>>> XFAILing that test) so that gives us a target test to use to verify
>>>> the fix when it does happen.
>>>
>>> [Tyler] I’ll add the test case in a separate patch since it isn’t related 
>>> to this work.
>>
>> Here is an XFAILing test case for this.

Thank you! It's a bit weird that this test requires PCH though as
there's nothing PCH-specific about this. Here is more along the lines
of what I was after. This should be committed along with the Pragma
spelling patch.

~Aaron
// RUN: %clang_cc1 %s -ast-print -o - | FileCheck %s

// FIXME: Test fails because attribute order is reversed by ParsedAttributes.
// XFAIL: *

void run1(int *List, int Length) {
  int i = 0;
// CEHCK: #pragma loop vectorize(4)
// CHECK-NEXT: #pragma loop interleave(8)
// CHECK-NEXT: #pragma loop vectorize(enable)
// CHECK-NEXT: #pragma loop interleave(enable)
#pragma loop vectorize(4)
#pragma loop interleave(8)
#pragma loop vectorize(enable)
#pragma loop interleave(enable)
// CHECK-NEXT: while (i < Length)
  while (i < Length) {
    List[i] = i;
    i++;
  }
}

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to