This is an archive of the discontinued LLVM Phabricator instance.

Change attribute merge order [RFC]
AbandonedPublic

Authored by Meinersbur on Aug 2 2018, 7:37 PM.

Details

Reviewers
None
Summary

This is a very crude attempt to fix the diagnostic marker order ('note: previous declaration here' pointing to a source location before the main error marker) from D48100.

Approach:

  • After parsing, remove all attributes from the new declaration
  • Merge-in all inherited attributes (since the Decl's attribute list is empty, this should not result in any message)
  • Merge-in the previously removed parsed attributes again

This ensures that

  • Inherited attributes are listed before all non-inherited attributes (and corresponds textual order)
  • Attribute merging happens the same way as adding a new attribute to the currently parsed declaration's attribute list

Patch is unfinished and ugly

Diff Detail