aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/pragma-loop-safety.cpp
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2018-06-19 23:46:52 +0000
committerMichael Kruse <llvm@meinersbur.de>2018-06-19 23:46:52 +0000
commitc4f93467258f0fbdc966ffd42aead1e8da616572 (patch)
tree4b98b3a5cd687392f8c09d11ed43c07febf61bc4 /test/Parser/pragma-loop-safety.cpp
parentc3261ea295e010b1720e19b4ddd05b966366fea1 (diff)
Append new attributes to the end of an AttributeList.
... instead of prepending it at the beginning (the original behavior since implemented in r122535 2010-12-23). This builds up an AttributeList in the the order in which the attributes appear in the source. The reverse order caused nodes for attributes in the AST (e.g. LoopHint) to be in the reverse, and therefore printed in the wrong order by -ast-dump. Some TODO comments mention this. The order was explicitly reversed for enable_if attribute overload resolution and name mangling, which is not necessary anymore with this patch. The change unfortunately has some secondary effects, especially for diagnostic output. In the simplest cases, the CHECK lines or expected diagnostic were changed to the the new output. If the kind of error/warning changed, the attribute's order was changed instead. It also causes some 'previous occurrence here' hints to be textually after the main marker. This typically happens when attributes are merged, but are incompatible. Interchanging the role of the the main and note SourceLocation will also cause the case where two different declaration's attributes (in contrast to multiple attributes of the same declaration) are merged to be reversed. There is no easy fix because sometimes previous attributes are merged into a new declaration's attribute list, sometimes new attributes are added to a previous declaration's attribute list. Since 'previous occurrence here' pointing to locations after the main marker is not rare, I left the markers as-is; it is only relevant when the attributes are declared in the same declaration anyway, which often is on the same line. Differential Revision: https://reviews.llvm.org/D48100 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/pragma-loop-safety.cpp')
-rw-r--r--test/Parser/pragma-loop-safety.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/Parser/pragma-loop-safety.cpp b/test/Parser/pragma-loop-safety.cpp
index ab87dcdcb6..1393cf7474 100644
--- a/test/Parser/pragma-loop-safety.cpp
+++ b/test/Parser/pragma-loop-safety.cpp
@@ -25,10 +25,10 @@ void test(int *List, int Length) {
List[i] = i;
}
-/* expected-error {{duplicate directives 'vectorize(assume_safety)' and 'vectorize(enable)'}} */ #pragma clang loop vectorize(enable)
-#pragma clang loop vectorize(assume_safety)
-/* expected-error {{duplicate directives 'interleave(assume_safety)' and 'interleave(enable)'}} */ #pragma clang loop interleave(enable)
-#pragma clang loop interleave(assume_safety)
+#pragma clang loop vectorize(enable)
+/* expected-error {{duplicate directives 'vectorize(enable)' and 'vectorize(assume_safety)'}} */ #pragma clang loop vectorize(assume_safety)
+#pragma clang loop interleave(enable)
+/* expected-error {{duplicate directives 'interleave(enable)' and 'interleave(assume_safety)'}} */ #pragma clang loop interleave(assume_safety)
while (i-9 < Length) {
List[i] = i;
}