Add inherited attributes before parsed attributes.
authorMichael Kruse <llvm@meinersbur.de>
Mon, 24 Sep 2018 06:31:37 +0000 (06:31 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Mon, 24 Sep 2018 06:31:37 +0000 (06:31 +0000)
commit4c99f5fe2b5ca6a880e6a6d3858893f88b6eefe5
tree7e11d6ed0ae11140582633fd440be72925c60050
parent2b8107614c1c9c84007c2882875bb8366f120491
Add inherited attributes before parsed attributes.

Currently, attributes from previous declarations ('inherited attributes')
are added to the end of a declaration's list of attributes. Before
r338800, the attribute list was in reverse. r338800 changed the order
of non-inherited (parsed from the current declaration) attributes, but
inherited attributes are still appended to the end of the list.

This patch appends inherited attributes after other inherited
attributes, but before any non-inherited attribute. This is to make the
order of attributes in the AST correspond to the order in the source
code.

Differential Revision: https://reviews.llvm.org/D50214

llvm-svn: 342861
clang/include/clang/AST/DeclBase.h
clang/lib/AST/DeclBase.cpp
clang/test/Misc/ast-dump-attr.cpp
clang/test/Sema/attr-availability-ios.c
clang/test/Sema/attr-availability-tvos.c
clang/test/Sema/attr-availability-watchos.c