[mono] Put WeakAttribute support under an ifdef (#66213)
authorAleksey Kliger (λgeek) <alklig@microsoft.com>
Tue, 8 Mar 2022 14:08:40 +0000 (09:08 -0500)
committerGitHub <noreply@github.com>
Tue, 8 Mar 2022 14:08:40 +0000 (09:08 -0500)
commit8342a08b8bf0ff2ffb64cd5992e2d60c8d6d63c1
tree0a971a734fb40b11397f0d526fcf1980d4035c21
parent34880aaeb463cc17268b44aecb80dda0914cfa01
[mono] Put WeakAttribute support under an ifdef (#66213)

This code has been effectively dead in .NET 6 on all platforms since
System.WeakAttribute is not in CoreLib.

Not everything is removed:

- MonoClass:has_weak_fields bit is still present (and always 0).

- the AOT compiler still emits a (size 0) weak_field_indexes symbol (but the
  AOT runtime reader code is under an ifdef).  Likewise the AOT table
  definitions, etc are still there.  It seemed unnecessary to perturb the AOT
  format.
src/mono/cmake/config.h.in
src/mono/mono/metadata/class-init.c
src/mono/mono/metadata/custom-attrs.c
src/mono/mono/metadata/image.c
src/mono/mono/metadata/metadata-internals.h
src/mono/mono/metadata/object.c
src/mono/mono/mini/aot-compiler.c
src/mono/mono/mini/aot-runtime.c
src/mono/mono/mini/mini-runtime.c