[APINotes] Record what version caused an annotation to get replaced. (#123)

Now that -fapinotes-swift-version=3 can pick up API notes for
"Version: 4", the information for /inactive/ API notes isn't
sufficient to tell what would have happened under a different version.
That is, I can't ask "what would happen under version 4", because I
can't tell if the active annotations are active because they were
specified for version 3 or version 4. The inactive, unversioned
attributes were no help, either: they just said "version 0".

Fix this by adding a new flag 'IsReplacedByActive' to
SwiftVersionedAttr and SwiftVersionedRemovalAttr. When set, the
'Version' field refers to the API note that caused this annotation to
become inactive.

Note that "version 0" can still exist: when an attribute written in
source is replaced by an unversioned attribute in the API notes.

(cherry picked from commit b9c72518b27163388c82f3fa5f2577c49a868070)
6 files changed