From 6145a2d083468e7b68005c511a2e944446645f26 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Fri, 11 Nov 2016 18:39:40 +0100 Subject: [PATCH] Remove extracted linker sources and reuse them via submodule --- .gitmodules | 3 + external/linker | 1 + mcs/tools/Makefile | 1 - mcs/tools/linker/AUTHORS | 1 - mcs/tools/linker/MIT.X11 | 21 - .../linker/Mono.Linker.Steps/BaseStep.cs | 77 -- .../linker/Mono.Linker.Steps/BlacklistStep.cs | 132 -- .../linker/Mono.Linker.Steps/CleanStep.cs | 108 -- mcs/tools/linker/Mono.Linker.Steps/IStep.cs | 34 - .../Mono.Linker.Steps/LoadI18nAssemblies.cs | 102 -- .../Mono.Linker.Steps/LoadReferencesStep.cs | 55 - .../linker/Mono.Linker.Steps/MarkStep.cs | 1150 ----------------- .../linker/Mono.Linker.Steps/OutputStep.cs | 159 --- .../Mono.Linker.Steps/RegenerateGuidStep.cs | 48 - .../ResolveFromAssemblyStep.cs | 137 -- .../Mono.Linker.Steps/ResolveFromXApiStep.cs | 139 -- .../Mono.Linker.Steps/ResolveFromXmlStep.cs | 403 ------ .../linker/Mono.Linker.Steps/ResolveStep.cs | 57 - .../linker/Mono.Linker.Steps/SweepStep.cs | 228 ---- .../linker/Mono.Linker.Steps/TypeMapStep.cs | 307 ----- mcs/tools/linker/Mono.Linker.csproj | 103 -- mcs/tools/linker/Mono.Linker/Annotations.cs | 329 ----- .../linker/Mono.Linker/AssemblyAction.cs | 46 - mcs/tools/linker/Mono.Linker/AssemblyInfo.cs | 43 - .../linker/Mono.Linker/AssemblyResolver.cs | 71 - mcs/tools/linker/Mono.Linker/Driver.cs | 322 ----- .../linker/Mono.Linker/I18nAssemblies.cs | 47 - mcs/tools/linker/Mono.Linker/IXApiVisitor.cs | 47 - mcs/tools/linker/Mono.Linker/LinkContext.cs | 260 ---- mcs/tools/linker/Mono.Linker/MethodAction.cs | 36 - mcs/tools/linker/Mono.Linker/Pipeline.cs | 138 -- mcs/tools/linker/Mono.Linker/TypePreserve.cs | 37 - mcs/tools/linker/Mono.Linker/XApiReader.cs | 383 ------ mcs/tools/linker/README | 304 ----- .../Tests/Libs/nunit-console-runner.dll | Bin 16384 -> 0 bytes mcs/tools/linker/Tests/Libs/nunit-console.exe | Bin 3072 -> 0 bytes .../Tests/Libs/nunit-console.exe.config | 97 -- mcs/tools/linker/Tests/Libs/nunit.core.dll | Bin 86016 -> 0 bytes .../linker/Tests/Libs/nunit.framework.dll | Bin 45056 -> 0 bytes mcs/tools/linker/Tests/Libs/nunit.util.dll | Bin 86016 -> 0 bytes mcs/tools/linker/Tests/Makefile | 21 - .../linker/Tests/Mono.Linker.Tests.csproj | 69 - .../AbstractLinkingTestFixture.cs | 163 --- .../Mono.Linker.Tests/AbstractTestFixture.cs | 134 -- .../Tests/Mono.Linker.Tests/AssemblyInfo.cs | 42 - .../AssemblyLinkingTestFixture.cs | 67 - .../IntegrationTestFixture.cs | 123 -- .../XmlLinkingTestFixture.cs | 99 -- .../TestCases/Integration/Crypto/Test.cs | 16 - .../TestCases/Integration/Crypto/Test.exe | Bin 3072 -> 0 bytes .../TestCases/Integration/HelloWorld/Test.cs | 9 - .../TestCases/Integration/HelloWorld/Test.exe | Bin 3072 -> 0 bytes .../TestCases/Linker/Generics/Library.cs | 61 - .../TestCases/Linker/Generics/Library.dll | Bin 4096 -> 0 bytes .../Tests/TestCases/Linker/Generics/Makefile | 4 - .../Tests/TestCases/Linker/Generics/desc.xml | 5 - .../TestCases/Linker/Interface/Library.cs | 26 - .../TestCases/Linker/Interface/Library.dll | Bin 3072 -> 0 bytes .../Tests/TestCases/Linker/Interface/Makefile | 4 - .../Tests/TestCases/Linker/Interface/desc.xml | 5 - .../Linker/MultipleReferences/Bar.cs | 15 - .../Linker/MultipleReferences/Bar.dll | Bin 3072 -> 0 bytes .../Linker/MultipleReferences/Baz.cs | 13 - .../Linker/MultipleReferences/Baz.dll | Bin 3072 -> 0 bytes .../Linker/MultipleReferences/Foo.cs | 20 - .../Linker/MultipleReferences/Foo.dll | Bin 3072 -> 0 bytes .../Linker/MultipleReferences/Makefile | 9 - .../MultipleReferences/NotLinkedAttribute.cs | 5 - .../MultipleReferences/NotLinkedAttribute.dll | Bin 3072 -> 0 bytes .../Linker/MultipleReferences/Program.cs | 21 - .../Linker/MultipleReferences/Program.exe | Bin 3072 -> 0 bytes .../TestCases/Linker/NestedNested/Library.cs | 17 - .../TestCases/Linker/NestedNested/Library.dll | Bin 3584 -> 0 bytes .../TestCases/Linker/NestedNested/Makefile | 4 - .../TestCases/Linker/NestedNested/desc.xml | 5 - .../Linker/PreserveFieldsRequired/Library.cs | 34 - .../Linker/PreserveFieldsRequired/Library.dll | Bin 3584 -> 0 bytes .../Linker/PreserveFieldsRequired/Makefile | 4 - .../Linker/PreserveFieldsRequired/desc.xml | 7 - .../Linker/ReferenceInAttributes/LibLib.cs | 23 - .../Linker/ReferenceInAttributes/LibLib.dll | Bin 3072 -> 0 bytes .../Linker/ReferenceInAttributes/Library.cs | 71 - .../Linker/ReferenceInAttributes/Library.dll | Bin 4096 -> 0 bytes .../Linker/ReferenceInAttributes/desc.xml | 5 - .../ReferenceInVirtualMethod/Library.cs | 35 - .../ReferenceInVirtualMethod/Library.dll | Bin 3584 -> 0 bytes .../Linker/ReferenceInVirtualMethod/Makefile | 4 - .../Linker/ReferenceInVirtualMethod/desc.xml | 5 - .../Tests/TestCases/Linker/Simple/Library.cs | 37 - .../Tests/TestCases/Linker/Simple/Library.dll | Bin 3584 -> 0 bytes .../Tests/TestCases/Linker/Simple/Makefile | 5 - .../Tests/TestCases/Linker/Simple/Program.cs | 16 - .../Tests/TestCases/Linker/Simple/Program.exe | Bin 3072 -> 0 bytes .../TestCases/Linker/SimpleXml/Library.cs | 44 - .../TestCases/Linker/SimpleXml/Library.dll | Bin 3584 -> 0 bytes .../Tests/TestCases/Linker/SimpleXml/Makefile | 4 - .../Tests/TestCases/Linker/SimpleXml/desc.xml | 10 - .../TestCases/Linker/VirtualCall/Library.cs | 31 - .../TestCases/Linker/VirtualCall/Library.dll | Bin 3072 -> 0 bytes .../TestCases/Linker/VirtualCall/Makefile | 5 - .../TestCases/Linker/VirtualCall/Program.cs | 16 - .../TestCases/Linker/VirtualCall/Program.exe | Bin 3072 -> 0 bytes .../TestCases/Linker/XmlPattern/Library.cs | 36 - .../TestCases/Linker/XmlPattern/Library.dll | Bin 3584 -> 0 bytes .../TestCases/Linker/XmlPattern/Makefile | 4 - .../TestCases/Linker/XmlPattern/desc.xml | 7 - mcs/tools/linker/Tests/TestCases/config.make | 3 - mcs/tools/linker/configure | 23 - mcs/tools/linker/monolinker.exe.sources | 54 +- mcs/tools/linker/monolinker.in | 2 - mcs/tools/linker/profiler/Makefile | 8 - mcs/tools/linker/profiler/link.c | 362 ------ mcs/tools/linker/standalone.make | 44 - mcs/tools/tuner/Makefile | 15 - mcs/tools/tuner/Mono.Tuner-net_4_x.csproj | 116 -- mcs/tools/tuner/Mono.Tuner.csproj | 71 - mcs/tools/tuner/Mono.Tuner.dll.sources | 13 - .../tuner/Mono.Tuner/AdjustVisibility.cs | 164 --- .../Mono.Tuner/ApplyPreserveAttributeBase.cs | 164 --- mcs/tools/tuner/Mono.Tuner/CecilRocks.cs | 519 -------- mcs/tools/tuner/Mono.Tuner/CheckVisibility.cs | 375 ------ .../tuner/Mono.Tuner/CustomizeActions.cs | 93 -- mcs/tools/tuner/Mono.Tuner/Dispatcher.cs | 288 ----- mcs/tools/tuner/Mono.Tuner/Extensions.cs | 36 - .../tuner/Mono.Tuner/FilterAttributes.cs | 157 --- mcs/tools/tuner/Mono.Tuner/FixModuleFlags.cs | 20 - .../Mono.Tuner/InjectSecurityAttributes.cs | 500 ------- .../tuner/Mono.Tuner/MarkNSObjectsBase.cs | 149 --- .../Mono.Tuner/MoonlightA11yApiMarker.cs | 88 -- .../Mono.Tuner/MoonlightA11yAssemblyStep.cs | 54 - .../MoonlightA11yDescriptorGenerator.cs | 337 ----- .../Mono.Tuner/MoonlightA11yProcessor.cs | 179 --- .../MoonlightA11yUsageInspectionStep.cs | 52 - .../tuner/Mono.Tuner/MoonlightAssemblyStep.cs | 66 - mcs/tools/tuner/Mono.Tuner/PreserveCrypto.cs | 122 -- mcs/tools/tuner/Mono.Tuner/PreserveHttps.cs | 83 -- .../Mono.Tuner/PreserveSoapHttpClients.cs | 90 -- mcs/tools/tuner/Mono.Tuner/PrintStatus.cs | 86 -- mcs/tools/tuner/Mono.Tuner/PrintTypeMap.cs | 71 - mcs/tools/tuner/Mono.Tuner/Profile.cs | 78 -- .../tuner/Mono.Tuner/RemoveAttributesBase.cs | 103 -- mcs/tools/tuner/Mono.Tuner/RemoveResources.cs | 57 - mcs/tools/tuner/Mono.Tuner/RemoveSecurity.cs | 50 - .../tuner/Mono.Tuner/RemoveSerialization.cs | 149 --- .../tuner/Mono.Tuner/TunerAnnotations.cs | 55 - .../MonoMac.Tuner/ApplyPreserveAttribute.cs | 21 - mcs/tools/tuner/MonoMac.Tuner/Extensions.cs | 27 - .../tuner/MonoMac.Tuner/MarkNSObjects.cs | 53 - .../tuner/MonoMac.Tuner/MethodMapInjection.cs | 382 ------ mcs/tools/tuner/MonoMac.Tuner/MonoMac.xml | 38 - .../tuner/MonoMac.Tuner/MonoMacProfile.cs | 117 -- .../tuner/MonoMac.Tuner/RemoveSelectors.cs | 189 --- 152 files changed, 31 insertions(+), 12478 deletions(-) create mode 160000 external/linker delete mode 100644 mcs/tools/linker/AUTHORS delete mode 100644 mcs/tools/linker/MIT.X11 delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/BaseStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/BlacklistStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/CleanStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/IStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/LoadReferencesStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/OutputStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/RegenerateGuidStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/ResolveStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs delete mode 100644 mcs/tools/linker/Mono.Linker.csproj delete mode 100644 mcs/tools/linker/Mono.Linker/Annotations.cs delete mode 100644 mcs/tools/linker/Mono.Linker/AssemblyAction.cs delete mode 100644 mcs/tools/linker/Mono.Linker/AssemblyInfo.cs delete mode 100644 mcs/tools/linker/Mono.Linker/AssemblyResolver.cs delete mode 100644 mcs/tools/linker/Mono.Linker/Driver.cs delete mode 100644 mcs/tools/linker/Mono.Linker/I18nAssemblies.cs delete mode 100644 mcs/tools/linker/Mono.Linker/IXApiVisitor.cs delete mode 100644 mcs/tools/linker/Mono.Linker/LinkContext.cs delete mode 100644 mcs/tools/linker/Mono.Linker/MethodAction.cs delete mode 100644 mcs/tools/linker/Mono.Linker/Pipeline.cs delete mode 100644 mcs/tools/linker/Mono.Linker/TypePreserve.cs delete mode 100644 mcs/tools/linker/Mono.Linker/XApiReader.cs delete mode 100644 mcs/tools/linker/README delete mode 100755 mcs/tools/linker/Tests/Libs/nunit-console-runner.dll delete mode 100755 mcs/tools/linker/Tests/Libs/nunit-console.exe delete mode 100755 mcs/tools/linker/Tests/Libs/nunit-console.exe.config delete mode 100755 mcs/tools/linker/Tests/Libs/nunit.core.dll delete mode 100755 mcs/tools/linker/Tests/Libs/nunit.framework.dll delete mode 100755 mcs/tools/linker/Tests/Libs/nunit.util.dll delete mode 100644 mcs/tools/linker/Tests/Makefile delete mode 100644 mcs/tools/linker/Tests/Mono.Linker.Tests.csproj delete mode 100644 mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractLinkingTestFixture.cs delete mode 100644 mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractTestFixture.cs delete mode 100644 mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyInfo.cs delete mode 100644 mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyLinkingTestFixture.cs delete mode 100644 mcs/tools/linker/Tests/Mono.Linker.Tests/IntegrationTestFixture.cs delete mode 100644 mcs/tools/linker/Tests/Mono.Linker.Tests/XmlLinkingTestFixture.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.cs delete mode 100755 mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.exe delete mode 100644 mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.cs delete mode 100755 mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.exe delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Generics/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Generics/desc.xml delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Interface/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Interface/desc.xml delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Baz.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Foo.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/NotLinkedAttribute.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Program.exe delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/NestedNested/desc.xml delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.cs delete mode 100755 mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/desc.xml delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.cs delete mode 100755 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.cs delete mode 100755 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/desc.xml delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/desc.xml delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Simple/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/Simple/Program.exe delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/desc.xml delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.dll delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Makefile delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.cs delete mode 100644 mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Program.exe delete mode 100755 mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.cs delete mode 100755 mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.dll delete mode 100755 mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Makefile delete mode 100755 mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/desc.xml delete mode 100644 mcs/tools/linker/Tests/TestCases/config.make delete mode 100755 mcs/tools/linker/configure delete mode 100644 mcs/tools/linker/monolinker.in delete mode 100644 mcs/tools/linker/profiler/Makefile delete mode 100644 mcs/tools/linker/profiler/link.c delete mode 100644 mcs/tools/linker/standalone.make delete mode 100644 mcs/tools/tuner/Makefile delete mode 100644 mcs/tools/tuner/Mono.Tuner-net_4_x.csproj delete mode 100644 mcs/tools/tuner/Mono.Tuner.csproj delete mode 100644 mcs/tools/tuner/Mono.Tuner.dll.sources delete mode 100644 mcs/tools/tuner/Mono.Tuner/AdjustVisibility.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/CecilRocks.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/CheckVisibility.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/CustomizeActions.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/Dispatcher.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/Extensions.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/FilterAttributes.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/FixModuleFlags.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/InjectSecurityAttributes.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/MarkNSObjectsBase.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/MoonlightA11yApiMarker.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/MoonlightA11yAssemblyStep.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/MoonlightA11yDescriptorGenerator.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/MoonlightA11yProcessor.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/MoonlightA11yUsageInspectionStep.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/MoonlightAssemblyStep.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/PreserveCrypto.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/PreserveHttps.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/PreserveSoapHttpClients.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/PrintStatus.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/PrintTypeMap.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/Profile.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/RemoveAttributesBase.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/RemoveResources.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/RemoveSecurity.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/RemoveSerialization.cs delete mode 100644 mcs/tools/tuner/Mono.Tuner/TunerAnnotations.cs delete mode 100644 mcs/tools/tuner/MonoMac.Tuner/ApplyPreserveAttribute.cs delete mode 100644 mcs/tools/tuner/MonoMac.Tuner/Extensions.cs delete mode 100644 mcs/tools/tuner/MonoMac.Tuner/MarkNSObjects.cs delete mode 100644 mcs/tools/tuner/MonoMac.Tuner/MethodMapInjection.cs delete mode 100644 mcs/tools/tuner/MonoMac.Tuner/MonoMac.xml delete mode 100644 mcs/tools/tuner/MonoMac.Tuner/MonoMacProfile.cs delete mode 100644 mcs/tools/tuner/MonoMac.Tuner/RemoveSelectors.cs diff --git a/.gitmodules b/.gitmodules index 337fbe06c0b..7545a7bacd2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "external/bockbuild"] path = external/bockbuild url = git://github.com/mono/bockbuild.git +[submodule "external/linker"] + path = external/linker + url = git@github.com:mono/linker.git diff --git a/external/linker b/external/linker new file mode 160000 index 00000000000..e4d9784ac37 --- /dev/null +++ b/external/linker @@ -0,0 +1 @@ +Subproject commit e4d9784ac37b9ebf4757175c92bc7a3ec9fd867a diff --git a/mcs/tools/Makefile b/mcs/tools/Makefile index af120d403ed..60600a30a32 100644 --- a/mcs/tools/Makefile +++ b/mcs/tools/Makefile @@ -3,7 +3,6 @@ thisdir = tools net_4_5_dirs := \ al \ linker \ - tuner \ culevel \ genxs \ mkbundle \ diff --git a/mcs/tools/linker/AUTHORS b/mcs/tools/linker/AUTHORS deleted file mode 100644 index 4af5896a185..00000000000 --- a/mcs/tools/linker/AUTHORS +++ /dev/null @@ -1 +0,0 @@ -Jb Evain diff --git a/mcs/tools/linker/MIT.X11 b/mcs/tools/linker/MIT.X11 deleted file mode 100644 index d2d78eedb4d..00000000000 --- a/mcs/tools/linker/MIT.X11 +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2007 Novell, Inc and the individuals listed on the -ChangeLog entries. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/mcs/tools/linker/Mono.Linker.Steps/BaseStep.cs b/mcs/tools/linker/Mono.Linker.Steps/BaseStep.cs deleted file mode 100644 index 13cf4686cc6..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/BaseStep.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// BaseStep.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public abstract class BaseStep : IStep { - - private LinkContext _context; - - public LinkContext Context { - get { return _context; } - } - - public AnnotationStore Annotations { - get { return _context.Annotations; } - } - - public void Process (LinkContext context) - { - _context = context; - - if (!ConditionToProcess ()) - return; - - Process (); - - foreach (AssemblyDefinition assembly in context.GetAssemblies ()) - ProcessAssembly (assembly); - - EndProcess (); - } - - protected virtual bool ConditionToProcess () - { - return true; - } - - protected virtual void Process () - { - } - - protected virtual void EndProcess () - { - } - - protected virtual void ProcessAssembly (AssemblyDefinition assembly) - { - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/BlacklistStep.cs b/mcs/tools/linker/Mono.Linker.Steps/BlacklistStep.cs deleted file mode 100644 index 6c6344bc3c2..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/BlacklistStep.cs +++ /dev/null @@ -1,132 +0,0 @@ -// -// Blacklist.cs -// -// Author: -// Jb Evain (jb@nurv.fr) -// -// (C) 2007 Novell Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Linq; -using System.IO; -using System.Reflection; -using System.Xml; -using System.Xml.XPath; - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class BlacklistStep : BaseStep { - - protected override bool ConditionToProcess() - { - return Context.CoreAction == AssemblyAction.Link; - } - - protected override void Process () - { - foreach (string name in Assembly.GetExecutingAssembly ().GetManifestResourceNames ()) { - if (!name.EndsWith (".xml", StringComparison.OrdinalIgnoreCase) || !IsReferenced (GetAssemblyName (name))) - continue; - - try { - if (Context.LogInternalExceptions) - Console.WriteLine ("Processing resource linker descriptor: {0}", name); - Context.Pipeline.AddStepAfter (typeof (TypeMapStep), GetResolveStep (name)); - } catch (XmlException ex) { - /* This could happen if some broken XML file is included. */ - if (Context.LogInternalExceptions) - Console.WriteLine ("Error processing {0}: {1}", name, ex); - } - } - - foreach (var asm in Context.GetAssemblies ()) { - foreach (var rsc in asm.Modules - .SelectMany (mod => mod.Resources) - .Where (res => res.ResourceType == ResourceType.Embedded) - .Where (res => res.Name.EndsWith (".xml", StringComparison.OrdinalIgnoreCase)) - .Where (res => IsReferenced (GetAssemblyName (res.Name))) - .Cast ()) { - try { - if (Context.LogInternalExceptions) - Console.WriteLine ("Processing embedded resource linker descriptor: {0}", rsc.Name); - - Context.Pipeline.AddStepAfter (typeof (TypeMapStep), GetExternalResolveStep (rsc, asm)); - } catch (XmlException ex) { - /* This could happen if some broken XML file is embedded. */ - if (Context.LogInternalExceptions) - Console.WriteLine ("Error processing {0}: {1}", rsc.Name, ex); - } - } - } - } - - static string GetAssemblyName (string descriptor) - { - int pos = descriptor.LastIndexOf ('.'); - if (pos == -1) - return descriptor; - - return descriptor.Substring (0, pos); - } - - bool IsReferenced (string name) - { - foreach (AssemblyDefinition assembly in Context.GetAssemblies ()) - if (assembly.Name.Name == name) - return true; - - return false; - } - - static ResolveFromXmlStep GetExternalResolveStep (EmbeddedResource resource, AssemblyDefinition assembly) - { - return new ResolveFromXmlStep (GetExternalDescriptor (resource), "resource " + resource.Name + " in " + assembly.FullName); - } - - static ResolveFromXmlStep GetResolveStep (string descriptor) - { - return new ResolveFromXmlStep (GetDescriptor (descriptor), "descriptor " + descriptor + " from " + Assembly.GetExecutingAssembly ().FullName); - } - - static XPathDocument GetExternalDescriptor (EmbeddedResource resource) - { - using (var sr = new StreamReader (resource.GetResourceStream ())) { - return new XPathDocument (new StringReader (sr.ReadToEnd ())); - } - } - - static XPathDocument GetDescriptor (string descriptor) - { - using (StreamReader sr = new StreamReader (GetResource (descriptor))) { - return new XPathDocument (new StringReader (sr.ReadToEnd ())); - } - } - - static Stream GetResource (string descriptor) - { - return Assembly.GetExecutingAssembly ().GetManifestResourceStream (descriptor); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/CleanStep.cs b/mcs/tools/linker/Mono.Linker.Steps/CleanStep.cs deleted file mode 100644 index ccc34cb1ded..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/CleanStep.cs +++ /dev/null @@ -1,108 +0,0 @@ -// -// CleanStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class CleanStep : BaseStep { - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) == AssemblyAction.Link) - CleanAssembly (assembly); - } - - static void CleanAssembly (AssemblyDefinition asm) - { - foreach (TypeDefinition type in asm.MainModule.Types) - CleanType (type); - } - - static void CleanType (TypeDefinition type) - { - if (type.HasProperties) - CleanProperties (type); - if (type.HasEvents) - CleanEvents (type); - - if (type.HasNestedTypes) - foreach (var nested in type.NestedTypes) - CleanType (nested); - } - - static MethodDefinition CheckMethod (TypeDefinition type, MethodDefinition method) - { - if (method == null) - return null; - - return type.Methods.Contains (method) ? method : null; - } - - static void CleanEvents (TypeDefinition type) - { - var events = type.Events; - - for (int i = 0; i < events.Count; i++) { - var evt = events [i]; - evt.AddMethod = CheckMethod (type, evt.AddMethod); - evt.InvokeMethod = CheckMethod (type, evt.InvokeMethod); - evt.RemoveMethod = CheckMethod (type, evt.RemoveMethod); - - if (!IsEventUsed (evt)) - events.RemoveAt (i--); - } - } - - static bool IsEventUsed (EventDefinition evt) - { - return evt.AddMethod != null || evt.InvokeMethod != null || evt.RemoveMethod != null; - } - - static void CleanProperties (TypeDefinition type) - { - var properties = type.Properties; - - for (int i = 0; i < properties.Count; i++) { - var prop = properties [i]; - prop.GetMethod = CheckMethod (type, prop.GetMethod); - prop.SetMethod = CheckMethod (type, prop.SetMethod); - - if (!IsPropertyUsed (prop)) - properties.RemoveAt (i--); - } - } - - static bool IsPropertyUsed (PropertyDefinition prop) - { - return prop.GetMethod != null || prop.SetMethod != null; - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/IStep.cs b/mcs/tools/linker/Mono.Linker.Steps/IStep.cs deleted file mode 100644 index c01ef1e6b3f..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/IStep.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// IStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace Mono.Linker.Steps { - - public interface IStep { - void Process (LinkContext context); - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs b/mcs/tools/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs deleted file mode 100644 index 45ac9240a1f..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs +++ /dev/null @@ -1,102 +0,0 @@ -// -// LoadI18nAssemblies.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class LoadI18nAssemblies : BaseStep { - - static readonly byte [] _pktoken = new byte [] {0x07, 0x38, 0xeb, 0x9f, 0x13, 0x2e, 0xd7, 0x56}; - - I18nAssemblies _assemblies; - - public LoadI18nAssemblies (I18nAssemblies assemblies) - { - _assemblies = assemblies; - } - - protected override bool ConditionToProcess () - { - return _assemblies != I18nAssemblies.None && - Type.GetType ("System.MonoType") != null; - } - - protected override void Process() - { - LoadAssembly (GetAssemblyName (I18nAssemblies.Base)); - - LoadI18nAssembly (I18nAssemblies.CJK); - LoadI18nAssembly (I18nAssemblies.MidEast); - LoadI18nAssembly (I18nAssemblies.Other); - LoadI18nAssembly (I18nAssemblies.Rare); - LoadI18nAssembly (I18nAssemblies.West); - } - - bool ShouldCopyAssembly (I18nAssemblies current) - { - return (current & _assemblies) != 0; - } - - void LoadI18nAssembly (I18nAssemblies asm) - { - if (!ShouldCopyAssembly (asm)) - return; - - AssemblyNameReference name = GetAssemblyName (asm); - LoadAssembly (name); - } - - void LoadAssembly (AssemblyNameReference name) - { - AssemblyDefinition assembly = Context.Resolve (name); - ResolveFromAssemblyStep.ProcessLibrary (Context, assembly); - } - - AssemblyNameReference GetAssemblyName (I18nAssemblies assembly) - { - AssemblyNameReference name = new AssemblyNameReference ("I18N", GetCorlibVersion ()); - if (assembly != I18nAssemblies.Base) - name.Name += "." + assembly; - - name.PublicKeyToken = _pktoken; - return name; - } - - Version GetCorlibVersion () - { - foreach (AssemblyDefinition assembly in Context.GetAssemblies ()) - if (assembly.Name.Name == "mscorlib") - return assembly.Name.Version; - - return new Version (); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/LoadReferencesStep.cs b/mcs/tools/linker/Mono.Linker.Steps/LoadReferencesStep.cs deleted file mode 100644 index a55fd1d7113..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/LoadReferencesStep.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// LoadReferencesStep.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class LoadReferencesStep : BaseStep { - - IDictionary _references = new Hashtable (); - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - ProcessReferences (assembly); - } - - void ProcessReferences (AssemblyDefinition assembly) - { - if (_references.Contains (assembly.Name)) - return; - - _references.Add (assembly.Name, assembly); - - foreach (AssemblyNameReference reference in assembly.MainModule.AssemblyReferences) - ProcessReferences (Context.Resolve (reference)); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs b/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs deleted file mode 100644 index 9bf293d7f13..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/MarkStep.cs +++ /dev/null @@ -1,1150 +0,0 @@ -// -// MarkStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Linq; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Linker.Steps { - - public class MarkStep : IStep { - - protected LinkContext _context; - protected Queue _methods; - protected ArrayList _virtual_methods; - - public AnnotationStore Annotations { - get { return _context.Annotations; } - } - - public MarkStep () - { - _methods = new Queue (); - _virtual_methods = new ArrayList (); - } - - public virtual void Process (LinkContext context) - { - _context = context; - - Initialize (); - Process (); - } - - void Initialize () - { - foreach (AssemblyDefinition assembly in _context.GetAssemblies ()) - InitializeAssembly (assembly); - } - - protected virtual void InitializeAssembly (AssemblyDefinition assembly) - { - MarkAssembly (assembly); - - foreach (TypeDefinition type in assembly.MainModule.Types) - InitializeType (type); - } - - void InitializeType (TypeDefinition type) - { - if (type.HasNestedTypes) { - foreach (var nested in type.NestedTypes) - InitializeType (nested); - } - - if (!Annotations.IsMarked (type)) - return; - - MarkType (type); - - if (type.HasFields) - InitializeFields (type); - if (type.HasMethods) - InitializeMethods (type.Methods); - } - - void InitializeFields (TypeDefinition type) - { - foreach (FieldDefinition field in type.Fields) - if (Annotations.IsMarked (field)) - MarkField (field); - } - - void InitializeMethods (ICollection methods) - { - foreach (MethodDefinition method in methods) - if (Annotations.IsMarked (method)) - EnqueueMethod (method); - } - - void Process () - { - if (QueueIsEmpty ()) - throw new InvalidOperationException ("No entry methods"); - - while (!QueueIsEmpty ()) { - ProcessQueue (); - ProcessVirtualMethods (); - } - } - - void ProcessQueue () - { - while (!QueueIsEmpty ()) { - MethodDefinition method = (MethodDefinition) _methods.Dequeue (); - Annotations.Push (method); - ProcessMethod (method); - Annotations.Pop (); - } - } - - bool QueueIsEmpty () - { - return _methods.Count == 0; - } - - protected virtual void EnqueueMethod (MethodDefinition method) - { - _methods.Enqueue (method); - } - - void ProcessVirtualMethods () - { - foreach (MethodDefinition method in _virtual_methods) { - Annotations.Push (method); - ProcessVirtualMethod (method); - Annotations.Pop (); - } - } - - void ProcessVirtualMethod (MethodDefinition method) - { - IList overrides = Annotations.GetOverrides (method); - if (overrides == null) - return; - - foreach (MethodDefinition @override in overrides) - ProcessOverride (@override); - } - - void ProcessOverride (MethodDefinition method) - { - if (!Annotations.IsMarked (method.DeclaringType)) - return; - - if (Annotations.IsProcessed (method)) - return; - - if (Annotations.IsMarked (method)) - return; - - MarkMethod (method); - ProcessVirtualMethod (method); - } - - void MarkMarshalSpec (IMarshalInfoProvider spec) - { - if (!spec.HasMarshalInfo) - return; - - var marshaler = spec.MarshalInfo as CustomMarshalInfo; - if (marshaler == null) - return; - - MarkType (marshaler.ManagedType); - } - - void MarkCustomAttributes (ICustomAttributeProvider provider) - { - if (!provider.HasCustomAttributes) - return; - - foreach (CustomAttribute ca in provider.CustomAttributes) - MarkCustomAttribute (ca); - } - - protected virtual void MarkCustomAttribute (CustomAttribute ca) - { - Annotations.Push (ca); - MarkMethod (ca.Constructor); - - MarkCustomAttributeArguments (ca); - - TypeReference constructor_type = ca.Constructor.DeclaringType; - TypeDefinition type = constructor_type.Resolve (); - if (type == null) { - Annotations.Pop (); - throw new ResolutionException (constructor_type); - } - - MarkCustomAttributeProperties (ca, type); - MarkCustomAttributeFields (ca, type); - Annotations.Pop (); - } - - protected void MarkSecurityDeclarations (ISecurityDeclarationProvider provider) - { - // most security declarations are removed (if linked) but user code might still have some - // and if the attribtues references types then they need to be marked too - if ((provider == null) || !provider.HasSecurityDeclarations) - return; - - foreach (var sd in provider.SecurityDeclarations) - MarkSecurityDeclaration (sd); - } - - protected virtual void MarkSecurityDeclaration (SecurityDeclaration sd) - { - if (!sd.HasSecurityAttributes) - return; - - foreach (var sa in sd.SecurityAttributes) - MarkSecurityAttribute (sa); - } - - protected virtual void MarkSecurityAttribute (SecurityAttribute sa) - { - TypeReference security_type = sa.AttributeType; - TypeDefinition type = security_type.Resolve (); - if (type == null) - throw new ResolutionException (security_type); - - MarkType (security_type); - MarkSecurityAttributeProperties (sa, type); - MarkSecurityAttributeFields (sa, type); - } - - protected void MarkSecurityAttributeProperties (SecurityAttribute sa, TypeDefinition attribute) - { - if (!sa.HasProperties) - return; - - foreach (var named_argument in sa.Properties) - MarkCustomAttributeProperty (named_argument, attribute); - } - - protected void MarkSecurityAttributeFields (SecurityAttribute sa, TypeDefinition attribute) - { - if (!sa.HasFields) - return; - - foreach (var named_argument in sa.Fields) - MarkCustomAttributeField (named_argument, attribute); - } - - protected void MarkCustomAttributeProperties (CustomAttribute ca, TypeDefinition attribute) - { - if (!ca.HasProperties) - return; - - foreach (var named_argument in ca.Properties) - MarkCustomAttributeProperty (named_argument, attribute); - } - - protected void MarkCustomAttributeProperty (CustomAttributeNamedArgument namedArgument, TypeDefinition attribute) - { - PropertyDefinition property = GetProperty (attribute, namedArgument.Name); - Annotations.Push (property); - if (property != null) - MarkMethod (property.SetMethod); - - MarkIfType (namedArgument.Argument); - Annotations.Pop (); - } - - PropertyDefinition GetProperty (TypeDefinition type, string propertyname) - { - while (type != null) { - PropertyDefinition property = type.Properties.FirstOrDefault (p => p.Name == propertyname); - if (property != null) - return property; - - type = type.BaseType != null ? ResolveTypeDefinition (type.BaseType) : null; - } - - return null; - } - - protected void MarkCustomAttributeFields (CustomAttribute ca, TypeDefinition attribute) - { - if (!ca.HasFields) - return; - - foreach (var named_argument in ca.Fields) - MarkCustomAttributeField (named_argument, attribute); - } - - protected void MarkCustomAttributeField (CustomAttributeNamedArgument namedArgument, TypeDefinition attribute) - { - FieldDefinition field = GetField (attribute, namedArgument.Name); - if (field != null) - MarkField (field); - - MarkIfType (namedArgument.Argument); - } - - FieldDefinition GetField (TypeDefinition type, string fieldname) - { - while (type != null) { - FieldDefinition field = type.Fields.FirstOrDefault (f => f.Name == fieldname); - if (field != null) - return field; - - type = type.BaseType != null ? ResolveTypeDefinition (type.BaseType) : null; - } - - return null; - } - - void MarkCustomAttributeArguments (CustomAttribute ca) - { - if (!ca.HasConstructorArguments) - return; - - foreach (var argument in ca.ConstructorArguments) - MarkIfType (argument); - } - - void MarkIfType (CustomAttributeArgument argument) - { - var at = argument.Type; - if (at.IsArray) { - var et = at.GetElementType (); - if (et.Namespace != "System" || et.Name != "Type") - return; - - MarkType (et); - if (argument.Value == null) - return; - - foreach (var cac in (CustomAttributeArgument[]) argument.Value) - MarkWithResolvedScope ((TypeReference) cac.Value); - } else if (at.Namespace == "System" && at.Name == "Type") { - MarkType (argument.Type); - MarkWithResolvedScope ((TypeReference) argument.Value); - } - } - - // custom attributes encoding means it's possible to have a scope that will point into a PCL facade - // even if we (just before saving) will resolve all type references (bug #26752) - void MarkWithResolvedScope (TypeReference type) - { - if (type == null) - return; - - // a GenericInstanceType can could contains generic arguments with scope that - // needs to be updated out of the PCL facade (bug #28823) - var git = (type as GenericInstanceType); - if ((git != null) && git.HasGenericArguments) { - foreach (var ga in git.GenericArguments) - MarkWithResolvedScope (ga); - } - // we cannot set the Scope of a TypeSpecification but it's element type can be set - // e.g. System.String[] -> System.String - var ts = (type as TypeSpecification); - if (ts != null) { - MarkWithResolvedScope (ts.GetElementType ()); - return; - } - - var td = type.Resolve (); - if (td != null) - type.Scope = td.Scope; - MarkType (type); - } - - protected bool CheckProcessed (IMetadataTokenProvider provider) - { - if (Annotations.IsProcessed (provider)) - return true; - - Annotations.Processed (provider); - return false; - } - - protected void MarkAssembly (AssemblyDefinition assembly) - { - if (CheckProcessed (assembly)) - return; - - ProcessModule (assembly); - - MarkCustomAttributes (assembly); - MarkSecurityDeclarations (assembly); - - foreach (ModuleDefinition module in assembly.Modules) - MarkCustomAttributes (module); - } - - void ProcessModule (AssemblyDefinition assembly) - { - // Pre-mark if there is any methods as they need to be executed - // at assembly load time - foreach (TypeDefinition type in assembly.MainModule.Types) - { - if (type.Name == "" && type.HasMethods) - { - MarkType (type); - break; - } - } - } - - protected void MarkField (FieldReference reference) - { -// if (IgnoreScope (reference.DeclaringType.Scope)) -// return; - - if (reference.DeclaringType is GenericInstanceType) - MarkType (reference.DeclaringType); - - FieldDefinition field = ResolveFieldDefinition (reference); - - if (field == null) - throw new ResolutionException (reference); - - if (CheckProcessed (field)) - return; - - MarkType (field.DeclaringType); - MarkType (field.FieldType); - MarkCustomAttributes (field); - MarkMarshalSpec (field); - - Annotations.Mark (field); - } - - protected virtual bool IgnoreScope (IMetadataScope scope) - { - AssemblyDefinition assembly = ResolveAssembly (scope); - return Annotations.GetAction (assembly) != AssemblyAction.Link; - } - - FieldDefinition ResolveFieldDefinition (FieldReference field) - { - FieldDefinition fd = field as FieldDefinition; - if (fd == null) - fd = field.Resolve (); - - return fd; - } - - void MarkScope (IMetadataScope scope) - { - var provider = scope as IMetadataTokenProvider; - if (provider == null) - return; - - Annotations.Mark (provider); - } - - protected virtual void MarkSerializable (TypeDefinition type) - { - MarkDefaultConstructor (type); - MarkMethodsIf (type.Methods, IsSpecialSerializationConstructorPredicate); - } - - protected virtual TypeDefinition MarkType (TypeReference reference) - { - if (reference == null) - return null; - - reference = GetOriginalType (reference); - - if (reference is GenericParameter) - return null; - -// if (IgnoreScope (reference.Scope)) -// return; - - TypeDefinition type = ResolveTypeDefinition (reference); - - if (type == null) - throw new ResolutionException (reference); - - if (CheckProcessed (type)) - return null; - - Annotations.Push (type); - - MarkScope (type.Scope); - MarkType (type.BaseType); - MarkType (type.DeclaringType); - MarkCustomAttributes (type); - MarkSecurityDeclarations (type); - - if (IsMulticastDelegate (type)) { - MarkMethodCollection (type.Methods); - } - - if (IsSerializable (type)) - MarkSerializable (type); - - MarkTypeSpecialCustomAttributes (type); - - MarkGenericParameterProvider (type); - - // keep fields for value-types and for classes with LayoutKind.Sequential or Explicit - if (type.IsValueType || !type.IsAutoLayout) - MarkFields (type, type.IsEnum); - - if (type.HasInterfaces) { - foreach (var iface in type.Interfaces) - MarkType (iface.InterfaceType); - } - - if (type.HasMethods) { - MarkMethodsIf (type.Methods, IsVirtualAndHasPreservedParent); - MarkMethodsIf (type.Methods, IsStaticConstructorPredicate); - MarkMethodsIf (type.Methods, HasSerializationAttribute); - } - - DoAdditionalTypeProcessing (type); - - Annotations.Pop (); - - Annotations.Mark (type); - - ApplyPreserveInfo (type); - - return type; - } - - // Allow subclassers to mark additional things when marking a method - protected virtual void DoAdditionalTypeProcessing (TypeDefinition method) - { - } - - void MarkTypeSpecialCustomAttributes (TypeDefinition type) - { - if (!type.HasCustomAttributes) - return; - - foreach (CustomAttribute attribute in type.CustomAttributes) { - switch (attribute.Constructor.DeclaringType.FullName) { - case "System.Xml.Serialization.XmlSchemaProviderAttribute": - MarkXmlSchemaProvider (type, attribute); - break; - } - } - } - - void MarkMethodSpecialCustomAttributes (MethodDefinition method) - { - if (!method.HasCustomAttributes) - return; - - foreach (CustomAttribute attribute in method.CustomAttributes) { - switch (attribute.Constructor.DeclaringType.FullName) { - case "System.Web.Services.Protocols.SoapHeaderAttribute": - MarkSoapHeader (method, attribute); - break; - } - } - } - - void MarkXmlSchemaProvider (TypeDefinition type, CustomAttribute attribute) - { - string method_name; - if (!TryGetStringArgument (attribute, out method_name)) - return; - - MarkNamedMethod (type, method_name); - } - - static bool TryGetStringArgument (CustomAttribute attribute, out string argument) - { - argument = null; - - if (attribute.ConstructorArguments.Count < 1) - return false; - - argument = attribute.ConstructorArguments [0].Value as string; - - return argument != null; - } - - protected int MarkNamedMethod (TypeDefinition type, string method_name) - { - if (!type.HasMethods) - return 0; - - int count = 0; - foreach (MethodDefinition method in type.Methods) { - if (method.Name != method_name) - continue; - - MarkMethod (method); - count++; - } - - return count; - } - - void MarkSoapHeader (MethodDefinition method, CustomAttribute attribute) - { - string member_name; - if (!TryGetStringArgument (attribute, out member_name)) - return; - - MarkNamedField (method.DeclaringType, member_name); - MarkNamedProperty (method.DeclaringType, member_name); - } - - void MarkNamedField (TypeDefinition type, string field_name) - { - if (!type.HasFields) - return; - - foreach (FieldDefinition field in type.Fields) { - if (field.Name != field_name) - continue; - - MarkField (field); - } - } - - void MarkNamedProperty (TypeDefinition type, string property_name) - { - if (!type.HasProperties) - return; - - foreach (PropertyDefinition property in type.Properties) { - if (property.Name != property_name) - continue; - - Annotations.Push (property); - MarkMethod (property.GetMethod); - MarkMethod (property.SetMethod); - Annotations.Pop (); - } - } - - void MarkGenericParameterProvider (IGenericParameterProvider provider) - { - if (!provider.HasGenericParameters) - return; - - foreach (GenericParameter parameter in provider.GenericParameters) - MarkGenericParameter (parameter); - } - - void MarkGenericParameter (GenericParameter parameter) - { - MarkCustomAttributes (parameter); - foreach (TypeReference constraint in parameter.Constraints) - MarkType (constraint); - } - - bool IsVirtualAndHasPreservedParent (MethodDefinition method) - { - if (!method.IsVirtual) - return false; - - var base_list = Annotations.GetBaseMethods (method); - if (base_list == null) - return false; - - foreach (MethodDefinition @base in base_list) { - if (IgnoreScope (@base.DeclaringType.Scope)) - return true; - - if (IsVirtualAndHasPreservedParent (@base)) - return true; - } - - return false; - } - - static MethodPredicate IsSpecialSerializationConstructorPredicate = new MethodPredicate (IsSpecialSerializationConstructor); - - static bool IsSpecialSerializationConstructor (MethodDefinition method) - { - if (!IsConstructor (method)) - return false; - - var parameters = method.Parameters; - if (parameters.Count != 2) - return false; - - return parameters [0].ParameterType.Name == "SerializationInfo" && - parameters [1].ParameterType.Name == "StreamingContext"; - } - - delegate bool MethodPredicate (MethodDefinition method); - - void MarkMethodsIf (ICollection methods, MethodPredicate predicate) - { - foreach (MethodDefinition method in methods) - if (predicate (method)) { - Annotations.Push (predicate); - MarkMethod (method); - Annotations.Pop (); - } - } - - static MethodPredicate IsDefaultConstructorPredicate = new MethodPredicate (IsDefaultConstructor); - - static bool IsDefaultConstructor (MethodDefinition method) - { - return IsConstructor (method) && !method.HasParameters; - } - - static bool IsConstructor (MethodDefinition method) - { - return method.IsConstructor && !method.IsStatic; - } - - protected void MarkDefaultConstructor (TypeDefinition type) - { - if ((type == null) || !type.HasMethods) - return; - - MarkMethodsIf (type.Methods, IsDefaultConstructorPredicate); - } - - static MethodPredicate IsStaticConstructorPredicate = new MethodPredicate (IsStaticConstructor); - - static bool IsStaticConstructor (MethodDefinition method) - { - return method.IsConstructor && method.IsStatic; - } - - static bool HasSerializationAttribute (MethodDefinition method) - { - if (!method.HasCustomAttributes) - return false; - foreach (var ca in method.CustomAttributes) { - var cat = ca.AttributeType; - if (cat.Namespace != "System.Runtime.Serialization") - continue; - switch (cat.Name) { - case "OnDeserializedAttribute": - case "OnDeserializingAttribute": - case "OnSerializedAttribute": - case "OnSerializingAttribute": - return true; - } - } - return false; - } - - static bool IsSerializable (TypeDefinition td) - { - return (td.Attributes & TypeAttributes.Serializable) != 0; - } - - static bool IsMulticastDelegate (TypeDefinition td) - { - return td.BaseType != null && td.BaseType.FullName == "System.MulticastDelegate"; - } - - protected TypeDefinition ResolveTypeDefinition (TypeReference type) - { - TypeDefinition td = type as TypeDefinition; - if (td == null) - td = type.Resolve (); - - return td; - } - - protected TypeReference GetOriginalType (TypeReference type) - { - while (type is TypeSpecification) { - GenericInstanceType git = type as GenericInstanceType; - if (git != null) - MarkGenericArguments (git); - - var mod = type as IModifierType; - if (mod != null) - MarkModifierType (mod); - - type = ((TypeSpecification) type).ElementType; - } - - return type; - } - - void MarkModifierType (IModifierType mod) - { - MarkType (mod.ModifierType); - } - - void MarkGenericArguments (IGenericInstance instance) - { - foreach (TypeReference argument in instance.GenericArguments) - MarkType (argument); - - MarkGenericArgumentConstructors (instance); - } - - void MarkGenericArgumentConstructors (IGenericInstance instance) - { - var arguments = instance.GenericArguments; - - var generic_element = GetGenericProviderFromInstance (instance); - if (generic_element == null) - return; - - var parameters = generic_element.GenericParameters; - - if (arguments.Count != parameters.Count) - return; - - for (int i = 0; i < arguments.Count; i++) { - var argument = arguments [i]; - var parameter = parameters [i]; - - if (!parameter.HasDefaultConstructorConstraint) - continue; - - var argument_definition = ResolveTypeDefinition (argument); - if (argument_definition == null) - continue; - - MarkMethodsIf (argument_definition.Methods, ctor => !ctor.IsStatic && !ctor.HasParameters); - } - } - - IGenericParameterProvider GetGenericProviderFromInstance (IGenericInstance instance) - { - var method = instance as GenericInstanceMethod; - if (method != null) - return ResolveMethodDefinition (method.ElementMethod); - - var type = instance as GenericInstanceType; - if (type != null) - return ResolveTypeDefinition (type.ElementType); - - return null; - } - - void ApplyPreserveInfo (TypeDefinition type) - { - ApplyPreserveMethods (type); - - if (!Annotations.IsPreserved (type)) - return; - - switch (Annotations.GetPreserve (type)) { - case TypePreserve.All: - MarkFields (type, true); - MarkMethods (type); - break; - case TypePreserve.Fields: - MarkFields (type, true); - break; - case TypePreserve.Methods: - MarkMethods (type); - break; - } - } - - void ApplyPreserveMethods (TypeDefinition type) - { - var list = Annotations.GetPreservedMethods (type); - if (list == null) - return; - - MarkMethodCollection (list); - } - - void ApplyPreserveMethods (MethodDefinition method) - { - var list = Annotations.GetPreservedMethods (method); - if (list == null) - return; - - MarkMethodCollection (list); - } - - protected void MarkFields (TypeDefinition type, bool includeStatic) - { - if (!type.HasFields) - return; - - foreach (FieldDefinition field in type.Fields) { - if (!includeStatic && field.IsStatic) - continue; - MarkField (field); - } - } - - protected virtual void MarkMethods (TypeDefinition type) - { - if (type.HasMethods) - MarkMethodCollection (type.Methods); - } - - void MarkMethodCollection (IEnumerable methods) - { - foreach (MethodDefinition method in methods) - MarkMethod (method); - } - - protected virtual MethodDefinition MarkMethod (MethodReference reference) - { - reference = GetOriginalMethod (reference); - - if (reference.DeclaringType is ArrayType) - return null; - - Annotations.Push (reference); - if (reference.DeclaringType is GenericInstanceType) - MarkType (reference.DeclaringType); - -// if (IgnoreScope (reference.DeclaringType.Scope)) -// return; - - MethodDefinition method = ResolveMethodDefinition (reference); - - if (method == null) { - Annotations.Pop (); - throw new ResolutionException (reference); - } - - if (Annotations.GetAction (method) == MethodAction.Nothing) - Annotations.SetAction (method, MethodAction.Parse); - - EnqueueMethod (method); - - Annotations.Pop (); - Annotations.AddDependency (method); - - return method; - } - - AssemblyDefinition ResolveAssembly (IMetadataScope scope) - { - AssemblyDefinition assembly = _context.Resolve (scope); - MarkAssembly (assembly); - return assembly; - } - - protected MethodReference GetOriginalMethod (MethodReference method) - { - while (method is MethodSpecification) { - GenericInstanceMethod gim = method as GenericInstanceMethod; - if (gim != null) - MarkGenericArguments (gim); - - method = ((MethodSpecification) method).ElementMethod; - } - - return method; - } - - MethodDefinition ResolveMethodDefinition (MethodReference method) - { - MethodDefinition md = method as MethodDefinition; - if (md == null) - md = method.Resolve (); - - return md; - } - - protected virtual void ProcessMethod (MethodDefinition method) - { - if (CheckProcessed (method)) - return; - - Annotations.Push (method); - MarkType (method.DeclaringType); - MarkCustomAttributes (method); - MarkSecurityDeclarations (method); - - MarkGenericParameterProvider (method); - - if (IsPropertyMethod (method)) - MarkProperty (GetProperty (method)); - else if (IsEventMethod (method)) - MarkEvent (GetEvent (method)); - - if (method.HasParameters) { - foreach (ParameterDefinition pd in method.Parameters) { - MarkType (pd.ParameterType); - MarkCustomAttributes (pd); - MarkMarshalSpec (pd); - } - } - - if (method.HasOverrides) { - foreach (MethodReference ov in method.Overrides) - MarkMethod (ov); - } - - MarkMethodSpecialCustomAttributes (method); - - if (method.IsVirtual) - _virtual_methods.Add (method); - - MarkBaseMethods (method); - - MarkType (method.ReturnType); - MarkCustomAttributes (method.MethodReturnType); - MarkMarshalSpec (method.MethodReturnType); - - if (ShouldParseMethodBody (method)) - MarkMethodBody (method.Body); - - DoAdditionalMethodProcessing (method); - - Annotations.Mark (method); - - ApplyPreserveMethods (method); - Annotations.Pop (); - } - - // Allow subclassers to mark additional things when marking a method - protected virtual void DoAdditionalMethodProcessing (MethodDefinition method) - { - } - - void MarkBaseMethods (MethodDefinition method) - { - IList base_methods = Annotations.GetBaseMethods (method); - if (base_methods == null) - return; - - foreach (MethodDefinition base_method in base_methods) { - if (base_method.DeclaringType.IsInterface && !method.DeclaringType.IsInterface) - continue; - - MarkMethod (base_method); - MarkBaseMethods (base_method); - } - } - - bool ShouldParseMethodBody (MethodDefinition method) - { - if (!method.HasBody) - return false; - - AssemblyDefinition assembly = ResolveAssembly (method.DeclaringType.Scope); - return (Annotations.GetAction (method) == MethodAction.ForceParse || - (Annotations.GetAction (assembly) == AssemblyAction.Link && Annotations.GetAction (method) == MethodAction.Parse)); - } - - static internal bool IsPropertyMethod (MethodDefinition md) - { - return (md.SemanticsAttributes & MethodSemanticsAttributes.Getter) != 0 || - (md.SemanticsAttributes & MethodSemanticsAttributes.Setter) != 0; - } - - static bool IsEventMethod (MethodDefinition md) - { - return (md.SemanticsAttributes & MethodSemanticsAttributes.AddOn) != 0 || - (md.SemanticsAttributes & MethodSemanticsAttributes.Fire) != 0 || - (md.SemanticsAttributes & MethodSemanticsAttributes.RemoveOn) != 0; - } - - static internal PropertyDefinition GetProperty (MethodDefinition md) - { - TypeDefinition declaringType = (TypeDefinition) md.DeclaringType; - foreach (PropertyDefinition prop in declaringType.Properties) - if (prop.GetMethod == md || prop.SetMethod == md) - return prop; - - return null; - } - - static EventDefinition GetEvent (MethodDefinition md) - { - TypeDefinition declaringType = (TypeDefinition) md.DeclaringType; - foreach (EventDefinition evt in declaringType.Events) - if (evt.AddMethod == md || evt.InvokeMethod == md || evt.RemoveMethod == md) - return evt; - - return null; - } - - protected void MarkProperty (PropertyDefinition prop) - { - MarkCustomAttributes (prop); - } - - protected void MarkEvent (EventDefinition evt) - { - MarkCustomAttributes (evt); - MarkMethodIfNotNull (evt.AddMethod); - MarkMethodIfNotNull (evt.InvokeMethod); - MarkMethodIfNotNull (evt.RemoveMethod); - } - - void MarkMethodIfNotNull (MethodReference method) - { - if (method == null) - return; - - MarkMethod (method); - } - - protected virtual void MarkMethodBody (MethodBody body) - { - foreach (VariableDefinition var in body.Variables) - MarkType (var.VariableType); - - foreach (ExceptionHandler eh in body.ExceptionHandlers) - if (eh.HandlerType == ExceptionHandlerType.Catch) - MarkType (eh.CatchType); - - foreach (Instruction instruction in body.Instructions) - MarkInstruction (instruction); - } - - protected virtual void MarkInstruction (Instruction instruction) - { - switch (instruction.OpCode.OperandType) { - case OperandType.InlineField: - MarkField ((FieldReference) instruction.Operand); - break; - case OperandType.InlineMethod: - MarkMethod ((MethodReference) instruction.Operand); - break; - case OperandType.InlineTok: - object token = instruction.Operand; - if (token is TypeReference) - MarkType ((TypeReference) token); - else if (token is MethodReference) - MarkMethod ((MethodReference) token); - else - MarkField ((FieldReference) token); - break; - case OperandType.InlineType: - MarkType ((TypeReference) instruction.Operand); - break; - default: - break; - } - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/OutputStep.cs b/mcs/tools/linker/Mono.Linker.Steps/OutputStep.cs deleted file mode 100644 index 0ae94deef20..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/OutputStep.cs +++ /dev/null @@ -1,159 +0,0 @@ -// -// OutputStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.IO; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Linker.Steps { - - public class OutputStep : BaseStep { - - protected override void Process () - { - CheckOutputDirectory (); - Annotations.SaveDependencies (); - } - - void CheckOutputDirectory () - { - if (Directory.Exists (Context.OutputDirectory)) - return; - - Directory.CreateDirectory (Context.OutputDirectory); - } - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - OutputAssembly (assembly); - } - - void OutputAssembly (AssemblyDefinition assembly) - { - string directory = Context.OutputDirectory; - - CopyConfigFileIfNeeded (assembly, directory); - - switch (Annotations.GetAction (assembly)) { - case AssemblyAction.Save: - case AssemblyAction.Link: - Context.Annotations.AddDependency (assembly); - assembly.Write (GetAssemblyFileName (assembly, directory), SaveSymbols (assembly)); - break; - case AssemblyAction.Copy: - Context.Annotations.AddDependency (assembly); - CloseSymbols (assembly); - CopyAssembly (GetOriginalAssemblyFileInfo (assembly), directory, Context.LinkSymbols); - break; - case AssemblyAction.Delete: - CloseSymbols (assembly); - var target = GetAssemblyFileName (assembly, directory); - if (File.Exists (target)) { - File.Delete (target); - File.Delete (target + ".mdb"); - File.Delete (GetConfigFile (target)); - } - break; - default: - CloseSymbols (assembly); - break; - } - } - - void CloseSymbols (AssemblyDefinition assembly) - { - Annotations.CloseSymbolReader (assembly); - } - - WriterParameters SaveSymbols (AssemblyDefinition assembly) - { - var parameters = new WriterParameters (); - if (!Context.LinkSymbols) - return parameters; - - if (!assembly.MainModule.HasSymbols) - return parameters; - - if (Context.SymbolWriterProvider != null) - parameters.SymbolWriterProvider = Context.SymbolWriterProvider; - else - parameters.WriteSymbols = true; - return parameters; - } - - static void CopyConfigFileIfNeeded (AssemblyDefinition assembly, string directory) - { - string config = GetConfigFile (GetOriginalAssemblyFileInfo (assembly).FullName); - if (!File.Exists (config)) - return; - - string target = Path.GetFullPath (GetConfigFile (GetAssemblyFileName (assembly, directory))); - - if (config == target) - return; - - File.Copy (config, GetConfigFile (GetAssemblyFileName (assembly, directory)), true); - } - - static string GetConfigFile (string assembly) - { - return assembly + ".config"; - } - - static FileInfo GetOriginalAssemblyFileInfo (AssemblyDefinition assembly) - { - return new FileInfo (assembly.MainModule.FileName); - } - - static void CopyAssembly (FileInfo fi, string directory, bool symbols) - { - string target = Path.GetFullPath (Path.Combine (directory, fi.Name)); - string source = fi.FullName; - if (source == target) - return; - - File.Copy (source, target, true); - - if (!symbols) - return; - - source += ".mdb"; - if (!File.Exists (source)) - return; - File.Copy (source, target + ".mdb", true); - } - - static string GetAssemblyFileName (AssemblyDefinition assembly, string directory) - { - string file = assembly.Name.Name + (assembly.MainModule.Kind == ModuleKind.Dll ? ".dll" : ".exe"); - return Path.Combine (directory, file); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/RegenerateGuidStep.cs b/mcs/tools/linker/Mono.Linker.Steps/RegenerateGuidStep.cs deleted file mode 100644 index 6b2558e8352..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/RegenerateGuidStep.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// CleanStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2008 Novell, Inc. (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class RegenerateGuidStep : BaseStep { - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) == AssemblyAction.Link) - RegenerateGuid (assembly); - } - - static void RegenerateGuid (AssemblyDefinition asm) - { - asm.MainModule.Mvid = Guid.NewGuid (); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs deleted file mode 100644 index 6219bc92ffc..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs +++ /dev/null @@ -1,137 +0,0 @@ -// -// ResolveFromAssemblyStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class ResolveFromAssemblyStep : ResolveStep { - - AssemblyDefinition _assembly; - string _file; - - public ResolveFromAssemblyStep (string assembly) - { - _file = assembly; - } - - public ResolveFromAssemblyStep (AssemblyDefinition assembly) - { - _assembly = assembly; - } - - protected override void Process () - { - if (_assembly != null) - Context.Resolver.CacheAssembly (_assembly); - - AssemblyDefinition assembly = _assembly ?? Context.Resolve (_file); - - switch (assembly.MainModule.Kind) { - case ModuleKind.Dll: - ProcessLibrary (Context, assembly); - break; - default: - ProcessExecutable (assembly); - break; - } - } - - static void SetAction (LinkContext context, AssemblyDefinition assembly, AssemblyAction action) - { - TryReadSymbols (context, assembly); - - context.Annotations.SetAction (assembly, action); - } - - static void TryReadSymbols (LinkContext context, AssemblyDefinition assembly) - { - context.SafeReadSymbols (assembly); - } - - public static void ProcessLibrary (LinkContext context, AssemblyDefinition assembly) - { - SetAction (context, assembly, AssemblyAction.Copy); - - context.Annotations.Push (assembly); - - foreach (TypeDefinition type in assembly.MainModule.Types) - MarkType (context, type); - - context.Annotations.Pop (); - } - - static void MarkType (LinkContext context, TypeDefinition type) - { - context.Annotations.Mark (type); - - context.Annotations.Push (type); - - if (type.HasFields) - MarkFields (context, type.Fields); - if (type.HasMethods) - MarkMethods (context, type.Methods); - if (type.HasNestedTypes) - foreach (var nested in type.NestedTypes) - MarkType (context, nested); - - context.Annotations.Pop (); - } - - void ProcessExecutable (AssemblyDefinition assembly) - { - SetAction (Context, assembly, AssemblyAction.Link); - - Annotations.Push (assembly); - - Annotations.Mark (assembly.EntryPoint.DeclaringType); - MarkMethod (Context, assembly.EntryPoint, MethodAction.Parse); - - Annotations.Pop (); - } - - static void MarkFields (LinkContext context, ICollection fields) - { - foreach (FieldDefinition field in fields) - context.Annotations.Mark (field); - } - - static void MarkMethods (LinkContext context, ICollection methods) - { - foreach (MethodDefinition method in methods) - MarkMethod (context, method, MethodAction.ForceParse); - } - - static void MarkMethod (LinkContext context, MethodDefinition method, MethodAction action) - { - context.Annotations.Mark (method); - context.Annotations.SetAction (method, action); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs deleted file mode 100644 index c4ce86de688..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs +++ /dev/null @@ -1,139 +0,0 @@ -// -// ResolveFromXApiStep.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Xml.XPath; - -using Mono.Linker; - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class ResolveFromXApiStep : ResolveStep, IXApiVisitor { - - static readonly string _name = "name"; - static readonly string _ns = string.Empty; - - XPathDocument _document; - - public ResolveFromXApiStep (XPathDocument document) - { - _document = document; - } - - protected override void Process () - { - XApiReader reader = new XApiReader (_document, this); - reader.Process (Context); - } - - public void OnAssembly (XPathNavigator nav, AssemblyDefinition assembly) - { - } - - public void OnAttribute (XPathNavigator nav) - { - string name = GetName (nav); - - TypeDefinition type = Context.GetType (name); - if (type != null) - MarkType (type); - } - - public void OnClass (XPathNavigator nav, TypeDefinition type) - { - MarkType (type); - } - - public void OnInterface (XPathNavigator nav, TypeDefinition type) - { - MarkType (type); - } - - public void OnField (XPathNavigator nav, FieldDefinition field) - { - MarkField (field); - } - - public void OnMethod (XPathNavigator nav, MethodDefinition method) - { - MarkMethod (method); - } - - public void OnConstructor (XPathNavigator nav, MethodDefinition method) - { - MarkMethod (method); - } - - public void OnProperty (XPathNavigator nav, PropertyDefinition property) - { - } - - public void OnEvent (XPathNavigator nav, EventDefinition evt) - { - if (evt.AddMethod != null) - MarkMethod (evt.AddMethod); - if (evt.InvokeMethod != null) - MarkMethod (evt.InvokeMethod); - if (evt.RemoveMethod != null) - MarkMethod (evt.RemoveMethod); - } - - static string GetName (XPathNavigator nav) - { - return GetAttribute (nav, _name); - } - - static string GetAttribute (XPathNavigator nav, string attribute) - { - return nav.GetAttribute (attribute, _ns); - } - - void MarkType (TypeDefinition type) - { - InternalMark (type); - } - - void MarkField (FieldDefinition field) - { - InternalMark (field); - } - - void InternalMark (IMetadataTokenProvider provider) - { - Annotations.Mark (provider); - Annotations.SetPublic (provider); - } - - void MarkMethod (MethodDefinition method) - { - InternalMark (method); - Annotations.SetAction (method, MethodAction.Parse); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs deleted file mode 100644 index aa4f6afc760..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs +++ /dev/null @@ -1,403 +0,0 @@ -// -// ResolveFromXmlStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// (C) 2007 Novell, Inc. -// Copyright 2013 Xamarin Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using SR = System.Reflection; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml.XPath; - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class XmlResolutionException : Exception { - public XmlResolutionException (string message, Exception innerException) - : base (message, innerException) - { - } - } - - public class ResolveFromXmlStep : ResolveStep { - - static readonly string _signature = "signature"; - static readonly string _fullname = "fullname"; - static readonly string _required = "required"; - static readonly string _preserve = "preserve"; - static readonly string _ns = string.Empty; - - XPathDocument _document; - string _xmlDocumentLocation; - - public ResolveFromXmlStep (XPathDocument document, string xmlDocumentLocation = "") - { - _document = document; - _xmlDocumentLocation = xmlDocumentLocation; - } - - protected override void Process () - { - XPathNavigator nav = _document.CreateNavigator (); - nav.MoveToFirstChild (); - - // This step can be created with XML files that aren't necessarily - // linker descriptor files. So bail if we don't have a element. - if (nav.LocalName != "linker") - return; - - try { - ProcessAssemblies (Context, nav.SelectChildren ("assembly", _ns)); - } catch (Exception ex) { - throw new XmlResolutionException (string.Format ("Failed to process XML description: {0}", _xmlDocumentLocation), ex); - } - } - - void ProcessAssemblies (LinkContext context, XPathNodeIterator iterator) - { - while (iterator.MoveNext ()) { - AssemblyDefinition assembly = GetAssembly (context, GetFullName (iterator.Current)); - ProcessTypes (assembly, iterator.Current.SelectChildren ("type", _ns)); - ProcessNamespaces (assembly, iterator.Current.SelectChildren ("namespace", _ns)); - } - } - - void ProcessNamespaces (AssemblyDefinition assembly, XPathNodeIterator iterator) - { - while (iterator.MoveNext ()) { - string fullname = GetFullName (iterator.Current); - foreach (TypeDefinition type in assembly.MainModule.Types) { - if (type.Namespace != fullname) - continue; - - MarkAndPreserveAll (type); - } - } - } - - void MarkAndPreserveAll (TypeDefinition type) - { - Annotations.Mark (type); - Annotations.SetPreserve (type, TypePreserve.All); - - if (!type.HasNestedTypes) - return; - - foreach (TypeDefinition nested in type.NestedTypes) - MarkAndPreserveAll (nested); - } - - void ProcessTypes (AssemblyDefinition assembly, XPathNodeIterator iterator) - { - while (iterator.MoveNext ()) { - XPathNavigator nav = iterator.Current; - string fullname = GetFullName (nav); - - if (IsTypePattern (fullname)) { - ProcessTypePattern (fullname, assembly, nav); - continue; - } - - TypeDefinition type = assembly.MainModule.GetType (fullname); - if (type == null) - continue; - - ProcessType (type, nav); - } - } - - static bool IsTypePattern (string fullname) - { - return fullname.IndexOf ("*") != -1; - } - - static Regex CreateRegexFromPattern (string pattern) - { - return new Regex (pattern.Replace(".", @"\.").Replace("*", "(.*)")); - } - - void MatchType (TypeDefinition type, Regex regex, XPathNavigator nav) - { - if (regex.Match (type.FullName).Success) - ProcessType (type, nav); - - if (!type.HasNestedTypes) - return; - - foreach (var nt in type.NestedTypes) - MatchType (nt, regex, nav); - } - - void ProcessTypePattern (string fullname, AssemblyDefinition assembly, XPathNavigator nav) - { - Regex regex = CreateRegexFromPattern (fullname); - - foreach (TypeDefinition type in assembly.MainModule.Types) { - MatchType (type, regex, nav); - } - } - - void ProcessType (TypeDefinition type, XPathNavigator nav) - { - TypePreserve preserve = GetTypePreserve (nav); - - if (!IsRequired (nav)) { - Annotations.SetPreserve (type, preserve); - return; - } - - Annotations.Mark (type); - - if (type.IsNested) { - var parent = type; - while (parent.IsNested) { - parent = parent.DeclaringType; - Annotations.Mark (parent); - } - } - - switch (preserve) { - case TypePreserve.Nothing: - if (!nav.HasChildren) - Annotations.SetPreserve (type, TypePreserve.All); - break; - default: - Annotations.SetPreserve (type, preserve); - break; - } - - if (nav.HasChildren) { - MarkSelectedFields (nav, type); - MarkSelectedMethods (nav, type); - } - } - - void MarkSelectedFields (XPathNavigator nav, TypeDefinition type) - { - XPathNodeIterator fields = nav.SelectChildren ("field", _ns); - if (fields.Count == 0) - return; - - ProcessFields (type, fields); - } - - void MarkSelectedMethods (XPathNavigator nav, TypeDefinition type) - { - XPathNodeIterator methods = nav.SelectChildren ("method", _ns); - if (methods.Count == 0) - return; - - ProcessMethods (type, methods); - } - - static TypePreserve GetTypePreserve (XPathNavigator nav) - { - string attribute = GetAttribute (nav, _preserve); - if (attribute == null || attribute.Length == 0) - return TypePreserve.Nothing; - - try { - return (TypePreserve) Enum.Parse (typeof (TypePreserve), attribute, true); - } catch { - return TypePreserve.Nothing; - } - } - - void ProcessFields (TypeDefinition type, XPathNodeIterator iterator) - { - while (iterator.MoveNext ()) { - string value = GetSignature (iterator.Current); - if (!String.IsNullOrEmpty (value)) - ProcessFieldSignature (type, value); - - value = GetAttribute (iterator.Current, "name"); - if (!String.IsNullOrEmpty (value)) - ProcessFieldName (type, value); - } - } - - void ProcessFieldSignature (TypeDefinition type, string signature) - { - FieldDefinition field = GetField (type, signature); - MarkField (type, field, signature); - } - - void MarkField (TypeDefinition type, FieldDefinition field, string signature) - { - if (field != null) - Annotations.Mark (field); - else - AddUnresolveMarker (string.Format ("T: {0}; F: {1}", type, signature)); - } - - void ProcessFieldName (TypeDefinition type, string name) - { - if (!type.HasFields) - return; - - foreach (FieldDefinition field in type.Fields) - if (field.Name == name) - MarkField (type, field, name); - } - - static FieldDefinition GetField (TypeDefinition type, string signature) - { - if (!type.HasFields) - return null; - - foreach (FieldDefinition field in type.Fields) - if (signature == GetFieldSignature (field)) - return field; - - return null; - } - - static string GetFieldSignature (FieldDefinition field) - { - return field.FieldType.FullName + " " + field.Name; - } - - void ProcessMethods (TypeDefinition type, XPathNodeIterator iterator) - { - while (iterator.MoveNext()) { - string value = GetSignature (iterator.Current); - if (!String.IsNullOrEmpty (value)) - ProcessMethodSignature (type, value); - - value = GetAttribute (iterator.Current, "name"); - if (!String.IsNullOrEmpty (value)) - ProcessMethodName (type, value); - } - } - - void ProcessMethodSignature (TypeDefinition type, string signature) - { - MethodDefinition meth = GetMethod (type, signature); - MarkMethod (type, meth, signature); - } - - void MarkMethod (TypeDefinition type, MethodDefinition method, string signature) - { - if (method != null) { - Annotations.Mark (method); - Annotations.SetAction (method, MethodAction.Parse); - } else - AddUnresolveMarker (string.Format ("T: {0}; M: {1}", type, signature)); - } - - void ProcessMethodName (TypeDefinition type, string name) - { - if (!type.HasMethods) - return; - - foreach (MethodDefinition method in type.Methods) - if (name == method.Name) - MarkMethod (type, method, name); - } - - static MethodDefinition GetMethod (TypeDefinition type, string signature) - { - if (type.HasMethods) - foreach (MethodDefinition meth in type.Methods) - if (signature == GetMethodSignature (meth)) - return meth; - - return null; - } - - static string GetMethodSignature (MethodDefinition meth) - { - StringBuilder sb = new StringBuilder (); - sb.Append (meth.ReturnType.FullName); - sb.Append (" "); - sb.Append (meth.Name); - sb.Append ("("); - if (meth.HasParameters) { - for (int i = 0; i < meth.Parameters.Count; i++) { - if (i > 0) - sb.Append (","); - - sb.Append (meth.Parameters [i].ParameterType.FullName); - } - } - sb.Append (")"); - return sb.ToString (); - } - - static AssemblyDefinition GetAssembly (LinkContext context, string assemblyName) - { - AssemblyNameReference reference = AssemblyNameReference.Parse (assemblyName); - AssemblyDefinition assembly; - - assembly = context.Resolve (reference); - - ProcessReferences (assembly, context); - return assembly; - } - - static void ProcessReferences (AssemblyDefinition assembly, LinkContext context) - { - foreach (AssemblyNameReference name in assembly.MainModule.AssemblyReferences) - context.Resolve (name); - } - - static bool IsRequired (XPathNavigator nav) - { - string attribute = GetAttribute (nav, _required); - if (attribute == null || attribute.Length == 0) - return true; - - return TryParseBool (attribute); - } - - static bool TryParseBool (string s) - { - try { - return bool.Parse (s); - } catch { - return false; - } - } - - static string GetSignature (XPathNavigator nav) - { - return GetAttribute (nav, _signature); - } - - static string GetFullName (XPathNavigator nav) - { - return GetAttribute (nav, _fullname); - } - - static string GetAttribute (XPathNavigator nav, string attribute) - { - return nav.GetAttribute (attribute, _ns); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/ResolveStep.cs b/mcs/tools/linker/Mono.Linker.Steps/ResolveStep.cs deleted file mode 100644 index b17bf5ca16c..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/ResolveStep.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// ResolveStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace Mono.Linker.Steps { - - using System.Collections; - - public abstract class ResolveStep : BaseStep { - - ArrayList _unResolved; - - internal ResolveStep () - { - _unResolved = new ArrayList (); - } - - public bool AllMarkerResolved - { - get { return _unResolved.Count == 0; } - } - - public string [] GetUnresolvedMarkers () - { - return _unResolved.ToArray (typeof (string)) as string []; - } - - protected void AddUnresolveMarker (string signature) - { - _unResolved.Add (signature); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs b/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs deleted file mode 100644 index 73c89cc7991..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs +++ /dev/null @@ -1,228 +0,0 @@ -// -// SweepStep.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Collections.Generic; -using Mono.Cecil; -using Mono.Collections.Generic; - -namespace Mono.Linker.Steps { - - public class SweepStep : BaseStep { - - AssemblyDefinition [] assemblies; - HashSet resolvedTypeReferences; - - protected override void Process () - { - assemblies = Context.GetAssemblies (); - foreach (var assembly in assemblies) { - SweepAssembly (assembly); - if (Annotations.GetAction (assembly) == AssemblyAction.Copy) { - // Copy assemblies can still contain Type references with - // type forwarders from Delete assemblies - // thus try to resolve all the type references and see - // if some changed the scope. if yes change the action to Save - if (ResolveAllTypeReferences (assembly)) - Annotations.SetAction (assembly, AssemblyAction.Save); - } - } - } - - void SweepAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - if (!IsMarkedAssembly (assembly)) { - RemoveAssembly (assembly); - return; - } - - var types = new List (); - - foreach (TypeDefinition type in assembly.MainModule.Types) { - if (Annotations.IsMarked (type)) { - SweepType (type); - types.Add (type); - continue; - } - - if (type.Name == "") - types.Add (type); - } - - assembly.MainModule.Types.Clear (); - foreach (TypeDefinition type in types) - assembly.MainModule.Types.Add (type); - } - - bool IsMarkedAssembly (AssemblyDefinition assembly) - { - return Annotations.IsMarked (assembly.MainModule); - } - - void RemoveAssembly (AssemblyDefinition assembly) - { - Annotations.SetAction (assembly, AssemblyAction.Delete); - - SweepReferences (assembly); - } - - void SweepReferences (AssemblyDefinition target) - { - foreach (var assembly in assemblies) - SweepReferences (assembly, target); - } - - void SweepReferences (AssemblyDefinition assembly, AssemblyDefinition target) - { - if (assembly == target) - return; - - var references = assembly.MainModule.AssemblyReferences; - for (int i = 0; i < references.Count; i++) { - var reference = references [i]; - var r = Context.Resolver.Resolve (reference); - if (!AreSameReference (r.Name, target.Name)) - continue; - - references.RemoveAt (i); - // Removing the reference does not mean it will be saved back to disk! - // That depends on the AssemblyAction set for the `assembly` - switch (Annotations.GetAction (assembly)) { - case AssemblyAction.Copy: - // Copy means even if "unlinked" we still want that assembly to be saved back - // to disk (OutputStep) without the (removed) reference - Annotations.SetAction (assembly, AssemblyAction.Save); - ResolveAllTypeReferences (assembly); - break; - - case AssemblyAction.Save: - case AssemblyAction.Link: - ResolveAllTypeReferences (assembly); - break; - } - return; - } - } - - bool ResolveAllTypeReferences (AssemblyDefinition assembly) - { - if (resolvedTypeReferences == null) - resolvedTypeReferences = new HashSet (); - if (resolvedTypeReferences.Contains (assembly)) - return false; - resolvedTypeReferences.Add (assembly); - - var hash = new Dictionary (); - bool changes = false; - - foreach (TypeReference tr in assembly.MainModule.GetTypeReferences ()) { - if (hash.ContainsKey (tr)) - continue; - var td = tr.Resolve (); - IMetadataScope scope = tr.Scope; - // at this stage reference might include things that can't be resolved - // and if it is (resolved) it needs to be kept only if marked (#16213) - if ((td != null) && Annotations.IsMarked (td)) { - scope = assembly.MainModule.ImportReference (td).Scope; - if (tr.Scope != scope) - changes = true; - hash.Add (tr, scope); - } - } - if (assembly.MainModule.HasExportedTypes) { - foreach (var et in assembly.MainModule.ExportedTypes) { - var td = et.Resolve (); - IMetadataScope scope = et.Scope; - if ((td != null) && Annotations.IsMarked (td)) { - scope = assembly.MainModule.ImportReference (td).Scope; - hash.Add (td, scope); - } - } - } - - // Resolve everything first before updating scopes. - // If we set the scope to null, then calling Resolve() on any of its - // nested types would crash. - - foreach (var e in hash) { - e.Key.Scope = e.Value; - } - - return changes; - } - - void SweepType (TypeDefinition type) - { - if (type.HasFields) - SweepCollection (type.Fields); - - if (type.HasMethods) - SweepCollection (type.Methods); - - if (type.HasNestedTypes) - SweepNestedTypes (type); - } - - void SweepNestedTypes (TypeDefinition type) - { - for (int i = 0; i < type.NestedTypes.Count; i++) { - var nested = type.NestedTypes [i]; - if (Annotations.IsMarked (nested)) { - SweepType (nested); - } else { - type.NestedTypes.RemoveAt (i--); - } - } - } - - void SweepCollection (IList list) - { - for (int i = 0; i < list.Count; i++) - if (!Annotations.IsMarked ((IMetadataTokenProvider) list [i])) - list.RemoveAt (i--); - } - - static bool AreSameReference (AssemblyNameReference a, AssemblyNameReference b) - { - if (a == b) - return true; - - if (a.Name != b.Name) - return false; - - if (a.Version > b.Version) - return false; - - return true; - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs b/mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs deleted file mode 100644 index 3fe12ae667c..00000000000 --- a/mcs/tools/linker/Mono.Linker.Steps/TypeMapStep.cs +++ /dev/null @@ -1,307 +0,0 @@ -// -// TypeMapStep.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; - -using Mono.Cecil; - -namespace Mono.Linker.Steps { - - public class TypeMapStep : BaseStep { - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - foreach (TypeDefinition type in assembly.MainModule.Types) - MapType (type); - } - - protected virtual void MapType (TypeDefinition type) - { - MapVirtualMethods (type); - MapInterfaceMethodsInTypeHierarchy (type); - - if (!type.HasNestedTypes) - return; - - foreach (var nested in type.NestedTypes) - MapType (nested); - } - - void MapInterfaceMethodsInTypeHierarchy (TypeDefinition type) - { - if (!type.HasInterfaces) - return; - - foreach (var @interface in type.Interfaces) { - var iface = @interface.InterfaceType.Resolve (); - if (iface == null || !iface.HasMethods) - continue; - - foreach (MethodDefinition method in iface.Methods) { - if (TryMatchMethod (type, method) != null) - continue; - - var @base = GetBaseMethodInTypeHierarchy (type, method); - if (@base == null) - continue; - - Annotations.AddPreservedMethod (type, @base); - } - } - } - - void MapVirtualMethods (TypeDefinition type) - { - if (!type.HasMethods) - return; - - foreach (MethodDefinition method in type.Methods) { - if (!method.IsVirtual) - continue; - - MapVirtualMethod (method); - - if (method.HasOverrides) - MapOverrides (method); - } - } - - void MapVirtualMethod (MethodDefinition method) - { - MapVirtualBaseMethod (method); - MapVirtualInterfaceMethod (method); - } - - void MapVirtualBaseMethod (MethodDefinition method) - { - MethodDefinition @base = GetBaseMethodInTypeHierarchy (method); - if (@base == null) - return; - - AnnotateMethods (@base, method); - } - - void MapVirtualInterfaceMethod (MethodDefinition method) - { - foreach (MethodDefinition @base in GetBaseMethodsInInterfaceHierarchy (method)) - AnnotateMethods (@base, method); - } - - void MapOverrides (MethodDefinition method) - { - foreach (MethodReference override_ref in method.Overrides) { - MethodDefinition @override = override_ref.Resolve (); - if (@override == null) - continue; - - AnnotateMethods (@override, method); - } - } - - void AnnotateMethods (MethodDefinition @base, MethodDefinition @override) - { - Annotations.AddBaseMethod (@override, @base); - Annotations.AddOverride (@base, @override); - } - - static MethodDefinition GetBaseMethodInTypeHierarchy (MethodDefinition method) - { - return GetBaseMethodInTypeHierarchy (method.DeclaringType, method); - } - - static MethodDefinition GetBaseMethodInTypeHierarchy (TypeDefinition type, MethodDefinition method) - { - TypeDefinition @base = GetBaseType (type); - while (@base != null) { - MethodDefinition base_method = TryMatchMethod (@base, method); - if (base_method != null) - return base_method; - - @base = GetBaseType (@base); - } - - return null; - } - - static IEnumerable GetBaseMethodsInInterfaceHierarchy (MethodDefinition method) - { - return GetBaseMethodsInInterfaceHierarchy (method.DeclaringType, method); - } - - static IEnumerable GetBaseMethodsInInterfaceHierarchy (TypeDefinition type, MethodDefinition method) - { - if (!type.HasInterfaces) - yield break; - - foreach (var interface_ref in type.Interfaces) { - TypeDefinition @interface = interface_ref.InterfaceType.Resolve (); - if (@interface == null) - continue; - - MethodDefinition base_method = TryMatchMethod (@interface, method); - if (base_method != null) - yield return base_method; - - foreach (MethodDefinition @base in GetBaseMethodsInInterfaceHierarchy (@interface, method)) - yield return @base; - } - } - - static MethodDefinition TryMatchMethod (TypeDefinition type, MethodDefinition method) - { - if (!type.HasMethods) - return null; - - Dictionary gp = null; - foreach (MethodDefinition candidate in type.Methods) { - if (MethodMatch (candidate, method, ref gp)) - return candidate; - if (gp != null) - gp.Clear (); - } - - return null; - } - - static bool MethodMatch (MethodDefinition candidate, MethodDefinition method, ref Dictionary genericParameters) - { - if (!candidate.IsVirtual) - return false; - - if (candidate.HasParameters != method.HasParameters) - return false; - - if (candidate.Name != method.Name) - return false; - - if (candidate.HasGenericParameters != method.HasGenericParameters) - return false; - - // we need to track what the generic parameter represent - as we cannot allow it to - // differ between the return type or any parameter - if (!TypeMatch (candidate.ReturnType, method.ReturnType, ref genericParameters)) - return false; - - if (!candidate.HasParameters) - return true; - - var cp = candidate.Parameters; - var mp = method.Parameters; - if (cp.Count != mp.Count) - return false; - - for (int i = 0; i < cp.Count; i++) { - if (!TypeMatch (cp [i].ParameterType, mp [i].ParameterType, ref genericParameters)) - return false; - } - - return true; - } - - static bool TypeMatch (IModifierType a, IModifierType b, ref Dictionary gp) - { - if (!TypeMatch (a.ModifierType, b.ModifierType, ref gp)) - return false; - - return TypeMatch (a.ElementType, b.ElementType, ref gp); - } - - static bool TypeMatch (TypeSpecification a, TypeSpecification b, ref Dictionary gp) - { - var gita = a as GenericInstanceType; - if (gita != null) - return TypeMatch (gita, (GenericInstanceType) b, ref gp); - - var mta = a as IModifierType; - if (mta != null) - return TypeMatch (mta, (IModifierType) b, ref gp); - - return TypeMatch (a.ElementType, b.ElementType, ref gp); - } - - static bool TypeMatch (GenericInstanceType a, GenericInstanceType b, ref Dictionary gp) - { - if (!TypeMatch (a.ElementType, b.ElementType, ref gp)) - return false; - - if (a.HasGenericArguments != b.HasGenericArguments) - return false; - - if (!a.HasGenericArguments) - return true; - - var gaa = a.GenericArguments; - var gab = b.GenericArguments; - if (gaa.Count != gab.Count) - return false; - - for (int i = 0; i < gaa.Count; i++) { - if (!TypeMatch (gaa [i], gab [i], ref gp)) - return false; - } - - return true; - } - - static bool TypeMatch (TypeReference a, TypeReference b, ref Dictionary gp) - { - var gpa = a as GenericParameter; - if (gpa != null) { - if (gp == null) - gp = new Dictionary (); - string match; - if (!gp.TryGetValue (gpa.FullName, out match)) { - // first use, we assume it will always be used this way - gp.Add (gpa.FullName, b.ToString ()); - return true; - } - // re-use, it should match the previous usage - return match == b.ToString (); - } - - if (a is TypeSpecification || b is TypeSpecification) { - if (a.GetType () != b.GetType ()) - return false; - - return TypeMatch ((TypeSpecification) a, (TypeSpecification) b, ref gp); - } - - return a.FullName == b.FullName; - } - - static TypeDefinition GetBaseType (TypeDefinition type) - { - if (type == null || type.BaseType == null) - return null; - - return type.BaseType.Resolve (); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker.csproj b/mcs/tools/linker/Mono.Linker.csproj deleted file mode 100644 index 98f0737d8ac..00000000000 --- a/mcs/tools/linker/Mono.Linker.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46} - Exe - Properties - Mono.Linker - monolinker - - - True - full - False - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - True - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mscorlib.xml - - - System.web.xml - - - System.xml - - - Mono.Posix.xml - - - System.Drawing.xml - - - System.Core.xml - - - - - - - - - {D68133BD-1E63-496E-9EDE-4FBDBF77B486} - Mono.Cecil - - - \ No newline at end of file diff --git a/mcs/tools/linker/Mono.Linker/Annotations.cs b/mcs/tools/linker/Mono.Linker/Annotations.cs deleted file mode 100644 index 72c59bad8b9..00000000000 --- a/mcs/tools/linker/Mono.Linker/Annotations.cs +++ /dev/null @@ -1,329 +0,0 @@ -// -// Annotations.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.IO.Compression; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Linker { - - public class AnnotationStore { - - readonly Dictionary assembly_actions = new Dictionary (); - readonly Dictionary method_actions = new Dictionary (); - readonly HashSet marked = new HashSet (); - readonly HashSet processed = new HashSet (); - readonly Dictionary preserved_types = new Dictionary (); - readonly Dictionary> preserved_methods = new Dictionary> (); - readonly HashSet public_api = new HashSet (); - readonly Dictionary> override_methods = new Dictionary> (); - readonly Dictionary> base_methods = new Dictionary> (); - readonly Dictionary symbol_readers = new Dictionary (); - - readonly Dictionary> custom_annotations = new Dictionary> (); - - Stack dependency_stack; - System.Xml.XmlWriter writer; - GZipStream zipStream; - - public void PrepareDependenciesDump () - { - PrepareDependenciesDump ("linker-dependencies.xml.gz"); - } - - public void PrepareDependenciesDump (string filename) - { - dependency_stack = new Stack (); - System.Xml.XmlWriterSettings settings = new System.Xml.XmlWriterSettings(); - settings.Indent = true; - settings.IndentChars = "\t"; - var depsFile = File.OpenWrite (filename); - zipStream = new GZipStream (depsFile, CompressionMode.Compress); - - writer = System.Xml.XmlWriter.Create (zipStream, settings); - writer.WriteStartDocument (); - writer.WriteStartElement ("dependencies"); - writer.WriteStartAttribute ("version"); - writer.WriteString ("1.0"); - writer.WriteEndAttribute (); - } - - public AssemblyAction GetAction (AssemblyDefinition assembly) - { - AssemblyAction action; - if (assembly_actions.TryGetValue (assembly, out action)) - return action; - - throw new NotSupportedException (); - } - - public MethodAction GetAction (MethodDefinition method) - { - MethodAction action; - if (method_actions.TryGetValue (method, out action)) - return action; - - return MethodAction.Nothing; - } - - public void SetAction (AssemblyDefinition assembly, AssemblyAction action) - { - assembly_actions [assembly] = action; - } - - public bool HasAction (AssemblyDefinition assembly) - { - return assembly_actions.ContainsKey (assembly); - } - - public void SetAction (MethodDefinition method, MethodAction action) - { - method_actions [method] = action; - } - - public void Mark (IMetadataTokenProvider provider) - { - marked.Add (provider); - AddDependency (provider); - } - - public bool IsMarked (IMetadataTokenProvider provider) - { - return marked.Contains (provider); - } - - public void Processed (IMetadataTokenProvider provider) - { - processed.Add (provider); - } - - public bool IsProcessed (IMetadataTokenProvider provider) - { - return processed.Contains (provider); - } - - public bool IsPreserved (TypeDefinition type) - { - return preserved_types.ContainsKey (type); - } - - public void SetPreserve (TypeDefinition type, TypePreserve preserve) - { - preserved_types [type] = preserve; - } - - public TypePreserve GetPreserve (TypeDefinition type) - { - TypePreserve preserve; - if (preserved_types.TryGetValue (type, out preserve)) - return preserve; - - throw new NotSupportedException (); - } - - public void SetPublic (IMetadataTokenProvider provider) - { - public_api.Add (provider); - } - - public bool IsPublic (IMetadataTokenProvider provider) - { - return public_api.Contains (provider); - } - - public void AddOverride (MethodDefinition @base, MethodDefinition @override) - { - var methods = GetOverrides (@base); - if (methods == null) { - methods = new List (); - override_methods [@base] = methods; - } - - methods.Add (@override); - } - - public List GetOverrides (MethodDefinition method) - { - List overrides; - if (override_methods.TryGetValue (method, out overrides)) - return overrides; - - return null; - } - - public void AddBaseMethod (MethodDefinition method, MethodDefinition @base) - { - var methods = GetBaseMethods (method); - if (methods == null) { - methods = new List (); - base_methods [method] = methods; - } - - methods.Add (@base); - } - - public List GetBaseMethods (MethodDefinition method) - { - List bases; - if (base_methods.TryGetValue (method, out bases)) - return bases; - - return null; - } - - public List GetPreservedMethods (TypeDefinition type) - { - return GetPreservedMethods (type as IMemberDefinition); - } - - public void AddPreservedMethod (TypeDefinition type, MethodDefinition method) - { - AddPreservedMethod (type as IMemberDefinition, method); - } - - public List GetPreservedMethods (MethodDefinition method) - { - return GetPreservedMethods (method as IMemberDefinition); - } - - public void AddPreservedMethod (MethodDefinition key, MethodDefinition method) - { - AddPreservedMethod (key as IMemberDefinition, method); - } - - List GetPreservedMethods (IMemberDefinition definition) - { - List preserved; - if (preserved_methods.TryGetValue (definition, out preserved)) - return preserved; - - return null; - } - - void AddPreservedMethod (IMemberDefinition definition, MethodDefinition method) - { - var methods = GetPreservedMethods (definition); - if (methods == null) { - methods = new List (); - preserved_methods [definition] = methods; - } - - methods.Add (method); - } - - public void AddSymbolReader (AssemblyDefinition assembly, ISymbolReader symbolReader) - { - symbol_readers [assembly] = symbolReader; - } - - public void CloseSymbolReader (AssemblyDefinition assembly) - { - ISymbolReader symbolReader; - if (!symbol_readers.TryGetValue (assembly, out symbolReader)) - return; - - symbol_readers.Remove (assembly); - symbolReader.Dispose (); - } - - public Dictionary GetCustomAnnotations (object key) - { - Dictionary slots; - if (custom_annotations.TryGetValue (key, out slots)) - return slots; - - slots = new Dictionary (); - custom_annotations.Add (key, slots); - return slots; - } - - public void AddDependency (object o) - { - if (writer == null) - return; - - KeyValuePair pair = new KeyValuePair (dependency_stack.Count > 0 ? dependency_stack.Peek () : null, o); - writer.WriteStartElement ("edge"); - writer.WriteAttributeString ("b", TokenString (pair.Key)); - writer.WriteAttributeString ("e", TokenString (pair.Value)); - writer.WriteEndElement (); - } - - public void Push (object o) - { - if (writer == null) - return; - - if (dependency_stack.Count > 0) - AddDependency (o); - dependency_stack.Push (o); - } - - public void Pop () - { - if (writer == null) - return; - - dependency_stack.Pop (); - } - - string TokenString (object o) - { - if (o == null) - return "N:null"; - - if (o is IMetadataTokenProvider) - return (o as IMetadataTokenProvider).MetadataToken.TokenType + ":" + o; - - return "Other:" + o; - } - - public void SaveDependencies () - { - if (writer == null) - return; - - writer.WriteEndElement (); - writer.WriteEndDocument (); - writer.Flush (); - writer.Close (); - zipStream.Close (); - - writer.Dispose (); - zipStream.Dispose (); - writer = null; - zipStream = null; - dependency_stack = null; - } - } -} diff --git a/mcs/tools/linker/Mono.Linker/AssemblyAction.cs b/mcs/tools/linker/Mono.Linker/AssemblyAction.cs deleted file mode 100644 index 14282b376be..00000000000 --- a/mcs/tools/linker/Mono.Linker/AssemblyAction.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// AssemblyAction.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace Mono.Linker { - - public enum AssemblyAction { - // Ignore the assembly - Skip, - // Copy the existing files, assembly and symbols, into the output destination. E.g. .dll and .mdb - // The linker still analyze the assemblies (to know what they require) but does not modify them - Copy, - // Link the assembly - Link, - // Remove the assembly from the output - Delete, - // Save the assembly/symbols in memory without linking it. - // E.g. useful to remove unneeded assembly references (as done in SweepStep), - // resolving [TypeForwardedTo] attributes (like PCL) to their final location - Save - } -} diff --git a/mcs/tools/linker/Mono.Linker/AssemblyInfo.cs b/mcs/tools/linker/Mono.Linker/AssemblyInfo.cs deleted file mode 100644 index 348e29b29b7..00000000000 --- a/mcs/tools/linker/Mono.Linker/AssemblyInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// AssemblyInfo.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle ("Mono.Linker")] -[assembly: AssemblyDescription ("Mono CIL Linker")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("(C) 2006, Jb Evain")] -[assembly: AssemblyCulture ("")] - -[assembly: CLSCompliant (false)] -[assembly: ComVisible (false)] - -[assembly: AssemblyVersion ("0.2.0.0")] diff --git a/mcs/tools/linker/Mono.Linker/AssemblyResolver.cs b/mcs/tools/linker/Mono.Linker/AssemblyResolver.cs deleted file mode 100644 index cb0646c6871..00000000000 --- a/mcs/tools/linker/Mono.Linker/AssemblyResolver.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// AssemblyResolver.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; -using Mono.Cecil; - -namespace Mono.Linker { - - public class AssemblyResolver : BaseAssemblyResolver { - - IDictionary _assemblies; - - public IDictionary AssemblyCache { - get { return _assemblies; } - } - - public AssemblyResolver () - : this (new Hashtable ()) - { - } - - public AssemblyResolver (IDictionary assembly_cache) - { - _assemblies = assembly_cache; - } - - public override AssemblyDefinition Resolve (AssemblyNameReference name, ReaderParameters parameters) - { - AssemblyDefinition asm = (AssemblyDefinition) _assemblies [name.Name]; - if (asm == null) { - asm = base.Resolve (name, parameters); - _assemblies [name.Name] = asm; - } - - return asm; - } - - public void CacheAssembly (AssemblyDefinition assembly) - { - _assemblies [assembly.Name.Name] = assembly; - base.AddSearchDirectory (Path.GetDirectoryName (assembly.MainModule.FileName)); - } - } -} diff --git a/mcs/tools/linker/Mono.Linker/Driver.cs b/mcs/tools/linker/Mono.Linker/Driver.cs deleted file mode 100644 index 7d1963cc3db..00000000000 --- a/mcs/tools/linker/Mono.Linker/Driver.cs +++ /dev/null @@ -1,322 +0,0 @@ -// -// Driver.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; -using SR = System.Reflection; -using System.Xml.XPath; - -using Mono.Linker.Steps; - -namespace Mono.Linker { - - public class Driver { - - static readonly string _linker = "Mono CIL Linker"; - - public static int Main (string [] args) - { - if (args.Length == 0) - Usage ("No parameters specified"); - - try { - - Driver driver = new Driver (args); - driver.Run (); - - } catch (Exception e) { - Console.WriteLine ("Fatal error in {0}", _linker); - Console.WriteLine (e); - return 1; - } - - return 0; - } - - Queue _queue; - - public Driver (string [] args) - { - _queue = new Queue (args); - } - - bool HaveMoreTokens () - { - return _queue.Count > 0; - } - - void Run () - { - Pipeline p = GetStandardPipeline (); - LinkContext context = GetDefaultContext (p); - I18nAssemblies assemblies = I18nAssemblies.All; - ArrayList custom_steps = new ArrayList (); - - bool resolver = false; - while (HaveMoreTokens ()) { - string token = GetParam (); - if (token.Length < 2) - Usage ("Option is too short"); - - if (! (token [0] == '-' || token [1] == '/')) - Usage ("Expecting an option, got instead: " + token); - - if (token [0] == '-' && token [1] == '-') { - - if (token.Length < 3) - Usage ("Option is too short"); - - switch (token [2]) { - case 'v': - Version (); - break; - case 'a': - About (); - break; - default: - Usage (null); - break; - } - } - - switch (token [1]) { - case 'd': { - DirectoryInfo info = new DirectoryInfo (GetParam ()); - context.Resolver.AddSearchDirectory (info.FullName); - break; - } - case 'o': - context.OutputDirectory = GetParam (); - break; - case 'c': - context.CoreAction = ParseAssemblyAction (GetParam ()); - break; - case 'p': - AssemblyAction action = ParseAssemblyAction (GetParam ()); - context.Actions [GetParam ()] = action; - break; - case 's': - custom_steps.Add (GetParam ()); - break; - case 'x': - foreach (string file in GetFiles (GetParam ())) - p.PrependStep (new ResolveFromXmlStep (new XPathDocument (file))); - resolver = true; - break; - case 'a': - foreach (string file in GetFiles (GetParam ())) - p.PrependStep (new ResolveFromAssemblyStep (file)); - resolver = true; - break; - case 'i': - foreach (string file in GetFiles (GetParam ())) - p.PrependStep (new ResolveFromXApiStep (new XPathDocument (file))); - resolver = true; - break; - case 'l': - assemblies = ParseI18n (GetParam ()); - break; - case 'm': - context.SetParameter (GetParam (), GetParam ()); - break; - case 'b': - context.LinkSymbols = bool.Parse (GetParam ()); - break; - case 'g': - if (!bool.Parse (GetParam ())) - p.RemoveStep (typeof (RegenerateGuidStep)); - break; - default: - Usage ("Unknown option: `" + token [1] + "'"); - break; - } - } - - if (!resolver) - Usage ("No resolver was created (use -x, -a or -i)"); - - foreach (string custom_step in custom_steps) - AddCustomStep (p, custom_step); - - p.AddStepAfter (typeof (LoadReferencesStep), new LoadI18nAssemblies (assemblies)); - - p.Process (context); - } - - static void AddCustomStep (Pipeline pipeline, string arg) - { - int pos = arg.IndexOf (":"); - if (pos == -1) { - pipeline.AppendStep (ResolveStep (arg)); - return; - } - - string [] parts = arg.Split (':'); - if (parts.Length != 2) - Usage ("Step is specified as TYPE:STEP"); - - if (parts [0].IndexOf (",") > -1) - pipeline.AddStepBefore (FindStep (pipeline, parts [1]), ResolveStep (parts [0])); - else if (parts [1].IndexOf (",") > -1) - pipeline.AddStepAfter (FindStep (pipeline, parts [0]), ResolveStep (parts [1])); - else - Usage ("No comma separator in TYPE or STEP"); - } - - static Type FindStep (Pipeline pipeline, string name) - { - foreach (IStep step in pipeline.GetSteps ()) { - Type t = step.GetType (); - if (t.Name == name) - return t; - } - - return null; - } - - static IStep ResolveStep (string type) - { - Type step = Type.GetType (type, false); - if (step == null) - Usage (String.Format ("Step type '{0}' not found.", type)); - if (!typeof (IStep).IsAssignableFrom (step)) - Usage (String.Format ("Step type '{0}' does not implement IStep interface.", type)); - return (IStep) Activator.CreateInstance (step); - } - - static string [] GetFiles (string param) - { - if (param.Length < 1 || param [0] != '@') - return new string [] {param}; - - string file = param.Substring (1); - return ReadLines (file); - } - - static string [] ReadLines (string file) - { - ArrayList lines = new ArrayList (); - using (StreamReader reader = new StreamReader (file)) { - string line; - while ((line = reader.ReadLine ()) != null) - lines.Add (line); - } - return (string []) lines.ToArray (typeof (string)); - } - - static I18nAssemblies ParseI18n (string str) - { - I18nAssemblies assemblies = I18nAssemblies.None; - string [] parts = str.Split (','); - foreach (string part in parts) - assemblies |= (I18nAssemblies) Enum.Parse (typeof (I18nAssemblies), part.Trim (), true); - - return assemblies; - } - - static AssemblyAction ParseAssemblyAction (string s) - { - return (AssemblyAction) Enum.Parse (typeof (AssemblyAction), s, true); - } - - string GetParam () - { - if (_queue.Count == 0) - Usage ("Expecting a parameter"); - - return (string) _queue.Dequeue (); - } - - static LinkContext GetDefaultContext (Pipeline pipeline) - { - LinkContext context = new LinkContext (pipeline); - context.CoreAction = AssemblyAction.Skip; - context.OutputDirectory = "output"; - return context; - } - - static void Usage (string msg) - { - Console.WriteLine (_linker); - if (msg != null) - Console.WriteLine ("Error: " + msg); - Console.WriteLine ("monolinker [options] -x|-a|-i file"); - - Console.WriteLine (" --about About the {0}", _linker); - Console.WriteLine (" --version Print the version number of the {0}", _linker); - Console.WriteLine (" -out Specify the output directory, default to `output'"); - Console.WriteLine (" -c Action on the core assemblies, skip, copy or link, default to skip"); - Console.WriteLine (" -p Action per assembly"); - Console.WriteLine (" -s Add a new step to the pipeline."); - Console.WriteLine (" -d Add a directory where the linker will look for assemblies"); - Console.WriteLine (" -b Generate debug symbols for each linked module (true or false)"); - Console.WriteLine (" -g Generate a new unique guid for each linked module (true or false)"); - Console.WriteLine (" -l List of i18n assemblies to copy to the output directory"); - Console.WriteLine (" separated with a comma: none,all,cjk,mideast,other,rare,west"); - Console.WriteLine (" default is all"); - Console.WriteLine (" -x Link from an XML descriptor"); - Console.WriteLine (" -a Link from a list of assemblies"); - Console.WriteLine (" -i Link from an mono-api-info descriptor"); - Console.WriteLine (""); - - Environment.Exit (1); - } - - static void Version () - { - Console.WriteLine ("{0} Version {1}", - _linker, - System.Reflection.Assembly.GetExecutingAssembly ().GetName ().Version); - - Environment.Exit(1); - } - - static void About () - { - Console.WriteLine ("For more information, visit the project Web site"); - Console.WriteLine (" http://www.mono-project.com/"); - - Environment.Exit(1); - } - - static Pipeline GetStandardPipeline () - { - Pipeline p = new Pipeline (); - p.AppendStep (new LoadReferencesStep ()); - p.AppendStep (new BlacklistStep ()); - p.AppendStep (new TypeMapStep ()); - p.AppendStep (new MarkStep ()); - p.AppendStep (new SweepStep ()); - p.AppendStep (new CleanStep ()); - p.AppendStep (new RegenerateGuidStep ()); - p.AppendStep (new OutputStep ()); - return p; - } - } -} diff --git a/mcs/tools/linker/Mono.Linker/I18nAssemblies.cs b/mcs/tools/linker/Mono.Linker/I18nAssemblies.cs deleted file mode 100644 index a14c58fe2ae..00000000000 --- a/mcs/tools/linker/Mono.Linker/I18nAssemblies.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// I18nAssemblies.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace Mono.Linker { - - [Flags] - public enum I18nAssemblies { - - None = 0, - - CJK = 1, - MidEast = 2, - Other = 4, - Rare = 8, - West = 16, - - All = CJK | MidEast | Other | Rare | West, - Base - } -} diff --git a/mcs/tools/linker/Mono.Linker/IXApiVisitor.cs b/mcs/tools/linker/Mono.Linker/IXApiVisitor.cs deleted file mode 100644 index 204d699ee14..00000000000 --- a/mcs/tools/linker/Mono.Linker/IXApiVisitor.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// XApiVisitor.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Xml.XPath; - -using Mono.Cecil; - -namespace Mono.Linker { - - public interface IXApiVisitor { - - void OnAssembly (XPathNavigator nav, AssemblyDefinition assembly); - void OnAttribute (XPathNavigator nav); - void OnClass (XPathNavigator nav, TypeDefinition type); - void OnInterface (XPathNavigator nav, TypeDefinition type); - void OnField (XPathNavigator nav, FieldDefinition field); - void OnMethod (XPathNavigator nav, MethodDefinition method); - void OnConstructor (XPathNavigator nav, MethodDefinition method); - void OnProperty (XPathNavigator nav, PropertyDefinition property); - void OnEvent (XPathNavigator nav, EventDefinition evt); - } -} diff --git a/mcs/tools/linker/Mono.Linker/LinkContext.cs b/mcs/tools/linker/Mono.Linker/LinkContext.cs deleted file mode 100644 index 7d7908f2ec3..00000000000 --- a/mcs/tools/linker/Mono.Linker/LinkContext.cs +++ /dev/null @@ -1,260 +0,0 @@ -// -// LinkContext.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Linker { - - public class LinkContext { - - Pipeline _pipeline; - AssemblyAction _coreAction; - Hashtable _actions; - string _outputDirectory; - Hashtable _parameters; - bool _linkSymbols; - - AssemblyResolver _resolver; - - ReaderParameters _readerParameters; - ISymbolReaderProvider _symbolReaderProvider; - ISymbolWriterProvider _symbolWriterProvider; - - AnnotationStore _annotations; - - public Pipeline Pipeline { - get { return _pipeline; } - } - - public AnnotationStore Annotations { - get { return _annotations; } - } - - public string OutputDirectory { - get { return _outputDirectory; } - set { _outputDirectory = value; } - } - - public AssemblyAction CoreAction { - get { return _coreAction; } - set { _coreAction = value; } - } - - public bool LinkSymbols { - get { return _linkSymbols; } - set { _linkSymbols = value; } - } - - public IDictionary Actions { - get { return _actions; } - } - - public AssemblyResolver Resolver { - get { return _resolver; } - } - - public ISymbolReaderProvider SymbolReaderProvider { - get { return _symbolReaderProvider; } - set { _symbolReaderProvider = value; } - } - - public ISymbolWriterProvider SymbolWriterProvider { - get { return _symbolWriterProvider; } - set { _symbolWriterProvider = value; } - } - - public bool LogInternalExceptions { get; set; } = false; - - public LinkContext (Pipeline pipeline) - : this (pipeline, new AssemblyResolver ()) - { - } - - public LinkContext (Pipeline pipeline, AssemblyResolver resolver) - { - _pipeline = pipeline; - _resolver = resolver; - _actions = new Hashtable (); - _parameters = new Hashtable (); - _annotations = new AnnotationStore (); - _readerParameters = new ReaderParameters { - AssemblyResolver = _resolver, - }; - } - - public TypeDefinition GetType (string fullName) - { - int pos = fullName.IndexOf (","); - fullName = fullName.Replace ("+", "/"); - if (pos == -1) { - foreach (AssemblyDefinition asm in GetAssemblies ()) { - var type = asm.MainModule.GetType (fullName); - if (type != null) - return type; - } - - return null; - } - - string asmname = fullName.Substring (pos + 1); - fullName = fullName.Substring (0, pos); - AssemblyDefinition assembly = Resolve (AssemblyNameReference.Parse (asmname)); - return assembly.MainModule.GetType (fullName); - } - - public AssemblyDefinition Resolve (string name) - { - if (File.Exists (name)) { - AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly (name, _readerParameters); - _resolver.CacheAssembly (assembly); - return assembly; - } - - return Resolve (new AssemblyNameReference (name, new Version ())); - } - - public AssemblyDefinition Resolve (IMetadataScope scope) - { - AssemblyNameReference reference = GetReference (scope); - try { - AssemblyDefinition assembly = _resolver.Resolve (reference, _readerParameters); - - if (SeenFirstTime (assembly)) { - SafeReadSymbols (assembly); - SetAction (assembly); - } - - return assembly; - } - catch { - throw new AssemblyResolutionException (reference); - } - } - - bool SeenFirstTime (AssemblyDefinition assembly) - { - return !_annotations.HasAction (assembly); - } - - public void SafeReadSymbols (AssemblyDefinition assembly) - { - if (!_linkSymbols) - return; - - if (assembly.MainModule.HasSymbols) - return; - - try { - if (_symbolReaderProvider != null) { - var symbolReader = _symbolReaderProvider.GetSymbolReader ( - assembly.MainModule, - assembly.MainModule.FileName); - - _annotations.AddSymbolReader (assembly, symbolReader); - assembly.MainModule.ReadSymbols (symbolReader); - } else - assembly.MainModule.ReadSymbols (); - } catch {} - } - - static AssemblyNameReference GetReference (IMetadataScope scope) - { - AssemblyNameReference reference; - if (scope is ModuleDefinition) { - AssemblyDefinition asm = ((ModuleDefinition) scope).Assembly; - reference = asm.Name; - } else - reference = (AssemblyNameReference) scope; - - return reference; - } - - void SetAction (AssemblyDefinition assembly) - { - AssemblyAction action = AssemblyAction.Link; - - AssemblyNameDefinition name = assembly.Name; - - if (_actions.Contains (name.Name)) - action = (AssemblyAction) _actions [name.Name]; - else if (IsCore (name)) - action = _coreAction; - - _annotations.SetAction (assembly, action); - } - - static bool IsCore (AssemblyNameReference name) - { - switch (name.Name) { - case "mscorlib": - case "Accessibility": - case "Mono.Security": - // WPF - case "PresentationFramework": - case "PresentationCore": - case "WindowsBase": - case "UIAutomationProvider": - case "UIAutomationTypes": - case "PresentationUI": - case "ReachFramework": - return true; - default: - return name.Name.StartsWith ("System") - || name.Name.StartsWith ("Microsoft"); - } - } - - public AssemblyDefinition [] GetAssemblies () - { - IDictionary cache = _resolver.AssemblyCache; - AssemblyDefinition [] asms = new AssemblyDefinition [cache.Count]; - cache.Values.CopyTo (asms, 0); - return asms; - } - - public void SetParameter (string key, string value) - { - _parameters [key] = value; - } - - public bool HasParameter (string key) - { - return _parameters.Contains (key); - } - - public string GetParameter (string key) - { - return (string) _parameters [key]; - } - } -} diff --git a/mcs/tools/linker/Mono.Linker/MethodAction.cs b/mcs/tools/linker/Mono.Linker/MethodAction.cs deleted file mode 100644 index f51587e4384..00000000000 --- a/mcs/tools/linker/Mono.Linker/MethodAction.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// MethodAction.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace Mono.Linker { - - public enum MethodAction { - Nothing, - Parse, - ForceParse - } -} diff --git a/mcs/tools/linker/Mono.Linker/Pipeline.cs b/mcs/tools/linker/Mono.Linker/Pipeline.cs deleted file mode 100644 index 7ae07d24f1e..00000000000 --- a/mcs/tools/linker/Mono.Linker/Pipeline.cs +++ /dev/null @@ -1,138 +0,0 @@ -// -// Pipeline.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Diagnostics; - -using Mono.Linker.Steps; - -namespace Mono.Linker { - - public class Pipeline { - - ArrayList _steps; - - public Pipeline () - { - _steps = new ArrayList(); - } - - public void PrependStep (IStep step) - { - _steps.Insert (0, step); - } - - public void AppendStep (IStep step) - { - _steps.Add (step); - } - - public void AddStepBefore (Type target, IStep step) - { - for (int i = 0; i < _steps.Count; i++) { - if (target.IsInstanceOfType (_steps [i])) { - _steps.Insert (i, step); - return; - } - } - string msg = String.Format ("Step {0} could not be inserted before (not found) {1}", step, target); - throw new InvalidOperationException (msg); - } - - public void ReplaceStep (Type target, IStep step) - { - AddStepBefore (target, step); - RemoveStep (target); - } - - public void AddStepAfter (Type target, IStep step) - { - for (int i = 0; i < _steps.Count; i++) { - if (target.IsInstanceOfType (_steps [i])) { - if (i == _steps.Count - 1) - _steps.Add (step); - else - _steps.Insert (i + 1, step); - return; - } - } - string msg = String.Format ("Step {0} could not be inserted after (not found) {1}", step, target); - throw new InvalidOperationException (msg); - } - - public void AddStepAfter (IStep target, IStep step) - { - for (int i = 0; i < _steps.Count; i++) { - if (_steps [i] == target) { - if (i == _steps.Count - 1) - _steps.Add (step); - else - _steps.Insert (i + 1, step); - return; - } - } - } - - public void RemoveStep (Type target) - { - for (int i = 0; i < _steps.Count; i++) { - if (_steps [i].GetType () != target) - continue; - - _steps.RemoveAt (i); - break; - } - } - - public void Process (LinkContext context) - { - while (_steps.Count > 0) { - IStep step = (IStep) _steps [0]; - context.Annotations.Push (step); - step.Process (context); - context.Annotations.Pop (); - _steps.Remove (step); - } - } - - public IStep [] GetSteps () - { - return (IStep []) _steps.ToArray (typeof (IStep)); - } - - public bool ContainsStep (Type type) - { - foreach (IStep step in _steps) - if (step.GetType () == type) - return true; - - return false; - } - } -} diff --git a/mcs/tools/linker/Mono.Linker/TypePreserve.cs b/mcs/tools/linker/Mono.Linker/TypePreserve.cs deleted file mode 100644 index 08e7b96e8d3..00000000000 --- a/mcs/tools/linker/Mono.Linker/TypePreserve.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// TypePreserve.cs -// -// Author: -// Jb Evain (jb@nurv.fr) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace Mono.Linker { - - public enum TypePreserve { - Nothing, - All, - Fields, - Methods, - } -} diff --git a/mcs/tools/linker/Mono.Linker/XApiReader.cs b/mcs/tools/linker/Mono.Linker/XApiReader.cs deleted file mode 100644 index bb16e219c40..00000000000 --- a/mcs/tools/linker/Mono.Linker/XApiReader.cs +++ /dev/null @@ -1,383 +0,0 @@ -// -// XApiReader.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Linq; -using System.Text; -using System.Xml.XPath; - -using Mono.Cecil; - -namespace Mono.Linker { - - public class XApiReader { - - static readonly string _name = "name"; - static readonly string _ns = string.Empty; - - LinkContext _context; - XPathDocument _document; - IXApiVisitor _visitor; - - AssemblyDefinition _assembly; - string _namespace; - Stack _types = new Stack (); - StringBuilder _signature; - - public XApiReader (XPathDocument document, IXApiVisitor visitor) - { - _document = document; - _visitor = visitor; - } - - public void Process (LinkContext context) - { - _context = context; - ProcessAssemblies (_document.CreateNavigator ()); - } - - void OnAssembly (XPathNavigator nav) - { - _assembly = GetAssembly (nav); - - _visitor.OnAssembly (nav, _assembly); - - ProcessAttributes (nav); - ProcessNamespaces (nav); - } - - AssemblyDefinition GetAssembly (XPathNavigator nav) - { - AssemblyNameReference name = new AssemblyNameReference ( - GetName (nav), - new Version (GetAttribute (nav, "version"))); - - AssemblyDefinition assembly = _context.Resolve (name); - ProcessReferences (assembly); - return assembly; - } - - void ProcessReferences (AssemblyDefinition assembly) - { - foreach (AssemblyNameReference name in assembly.MainModule.AssemblyReferences) - _context.Resolve (name); - } - - void OnAttribute (XPathNavigator nav) - { - _visitor.OnAttribute (nav); - } - - void PushType (TypeDefinition type) - { - _types.Push (type); - } - - TypeDefinition PeekType () - { - return (TypeDefinition) _types.Peek (); - } - - TypeDefinition PopType () - { - return (TypeDefinition) _types.Pop (); - } - - void OnNamespace (XPathNavigator nav) - { - _namespace = GetName (nav); - - ProcessClasses (nav); - } - - void OnClass (XPathNavigator nav) - { - string name = GetClassName (nav); - - TypeDefinition type = _assembly.MainModule.GetType (name); - if (type == null) - return; - - _visitor.OnClass (nav, type); - - PushType (type); - - ProcessAttributes (nav); - ProcessInterfaces (nav); - ProcessFields (nav); - ProcessMethods (nav); - ProcessConstructors (nav); - ProcessProperties (nav); - ProcessEvents (nav); - ProcessClasses (nav); - - PopType (); - } - - string GetClassName (XPathNavigator nav) - { - if (IsNestedClass ()) - return PeekType ().FullName + "/" + GetName (nav); - - return _namespace + "." + GetName (nav); - } - - bool IsNestedClass () - { - return _types.Count > 0; - } - - void OnField (XPathNavigator nav) - { - TypeDefinition declaring = PeekType (); - - FieldDefinition field = declaring.Fields.FirstOrDefault (f => f.Name == GetName (nav)); - if (field != null) - _visitor.OnField (nav, field); - - ProcessAttributes (nav); - } - - void OnInterface (XPathNavigator nav) - { - string name = GetName (nav); - - TypeDefinition type = _context.GetType (GetTypeName (name)); - if (type != null) - _visitor.OnInterface (nav, type); - } - - void OnMethod (XPathNavigator nav) - { - InitMethodSignature (nav); - - ProcessParameters (nav); - - string signature = GetMethodSignature (); - - MethodDefinition method = GetMethod (signature); - if (method != null) - _visitor.OnMethod (nav, method); - - ProcessAttributes (nav); - } - - MethodDefinition GetMethod (string signature) - { - return GetMethod (PeekType ().Methods, signature); - } - - static MethodDefinition GetMethod (ICollection methods, string signature) - { - foreach (MethodDefinition method in methods) - if (signature == GetSignature (method)) - return method; - - return null; - } - - static string GetSignature (MethodDefinition method) - { - return method.ToString ().Replace ("<", "[").Replace (">", "]"); - } - - string GetMethodSignature () - { - _signature.Append (")"); - return _signature.ToString (); - } - - void InitMethodSignature (XPathNavigator nav) - { - _signature = new StringBuilder (); - - string returntype = GetAttribute (nav, "returntype"); - if (returntype == null || returntype.Length == 0) - returntype = "System.Void"; - - _signature.Append (NormalizeTypeName (returntype)); - _signature.Append (" "); - _signature.Append (PeekType ().FullName); - _signature.Append ("::"); - - string name = GetName (nav); - _signature.Append (GetMethodName (name)); - - _signature.Append ("("); - } - - static string GetMethodName (string name) - { - return GetStringBefore (name, "("); - } - - static string NormalizeTypeName (string name) - { - return name.Replace ("+", "/").Replace ("<", "[").Replace (">", "]"); - } - - static string GetTypeName (string name) - { - return GetStringBefore (NormalizeTypeName (name), "["); - } - - static string GetStringBefore (string str, string marker) - { - int pos = str.IndexOf (marker); - if (pos == -1) - return str; - - return str.Substring (0, pos); - } - - void OnParameter (XPathNavigator nav) - { - string type = GetAttribute (nav, "type"); - int pos = int.Parse (GetAttribute (nav, "position")); - - if (pos > 0) - _signature.Append (","); - _signature.Append (NormalizeTypeName (type)); - } - - void OnConstructor (XPathNavigator nav) - { - InitMethodSignature (nav); - - ProcessParameters (nav); - - string signature = GetMethodSignature (); - - MethodDefinition ctor = GetMethod (signature); - if (ctor != null) - _visitor.OnConstructor (nav, ctor); - - ProcessAttributes (nav); - } - - void OnProperty (XPathNavigator nav) - { - string name = GetName (nav); - TypeDefinition type = PeekType (); - - var property = type.Properties.FirstOrDefault (p => p.Name == name); - if (property != null) - _visitor.OnProperty (nav, property); - - ProcessAttributes (nav); - ProcessMethods (nav); - } - - void OnEvent (XPathNavigator nav) - { - string name = GetName (nav); - TypeDefinition type = PeekType (); - - EventDefinition evt = type.Events.FirstOrDefault (e => e.Name == name); - if (evt != null) - _visitor.OnEvent (nav, evt); - - ProcessAttributes (nav); - } - - void ProcessAssemblies (XPathNavigator nav) - { - ProcessChildren (nav, "assemblies//assembly", new OnChildren (OnAssembly)); - } - - void ProcessAttributes (XPathNavigator nav) - { - ProcessChildren (nav, "attributes//attribute", new OnChildren (OnAttribute)); - } - - void ProcessNamespaces (XPathNavigator nav) - { - ProcessChildren (nav, "namespaces//namespace", new OnChildren (OnNamespace)); - } - - void ProcessClasses (XPathNavigator nav) - { - ProcessChildren (nav, "classes//class", new OnChildren (OnClass)); - } - - void ProcessInterfaces (XPathNavigator nav) - { - ProcessChildren (nav, "intefaces//interface", new OnChildren (OnInterface)); - } - - void ProcessFields (XPathNavigator nav) - { - ProcessChildren (nav, "fields//field", new OnChildren (OnField)); - } - - void ProcessMethods (XPathNavigator nav) - { - ProcessChildren (nav, "methods//method", new OnChildren (OnMethod)); - } - - void ProcessConstructors (XPathNavigator nav) - { - ProcessChildren (nav, "constructors//constructor", new OnChildren (OnConstructor)); - } - - void ProcessParameters (XPathNavigator nav) - { - ProcessChildren (nav, "parameters//parameter", new OnChildren (OnParameter)); - } - - void ProcessProperties (XPathNavigator nav) - { - ProcessChildren (nav, "properties//property", new OnChildren (OnProperty)); - } - - void ProcessEvents (XPathNavigator nav) - { - ProcessChildren (nav, "events//event", new OnChildren (OnEvent)); - } - - static void ProcessChildren (XPathNavigator nav, string children, OnChildren action) - { - XPathNodeIterator iterator = nav.Select (children); - while (iterator.MoveNext ()) - action (iterator.Current); - } - - delegate void OnChildren (XPathNavigator nav); - - static string GetName (XPathNavigator nav) - { - return GetAttribute (nav, _name); - } - - static string GetAttribute (XPathNavigator nav, string attribute) - { - return nav.GetAttribute (attribute, _ns); - } - } -} diff --git a/mcs/tools/linker/README b/mcs/tools/linker/README deleted file mode 100644 index 95b8a92d38d..00000000000 --- a/mcs/tools/linker/README +++ /dev/null @@ -1,304 +0,0 @@ -monolinker -==== - -monolinker is the Mono CIL Linker. - -The linker is a tool one can use to only ship the minimal possible set of -functions that a set of programs might require to run as opposed to the full -libraries. - -* How does the linker work? - -The linker analyses the intermediate code (CIL) produced by every compiler -targeting the Mono platform like mcs, gmcs, vbnc, booc or others. It will walk -through all the code that it is given to it, and basically, perform a mark and -sweep operations on all the code that it is referenced, to only keep what is -necessary for the source program to run. - -* Usage - -1) Linking from a source assembly - -The command: - -monolinker -a Program.exe - -will use the assembly Program.exe as a source. That means that the linker will -walk through all the methods of Program.exe to generate only what is necessary -for this assembly to run. - -2) Linking from an xml descriptor - -The command: - -monolinker -x desc.xml - -will use the XML descriptor as a source. That means that the linker will -use this file to decide what to link in a set of assemblies. The format of the -descriptors is described further on in this document. - -3) Linking from an api info file - -The command: - -monolinker -i assembly.info - -will use a file produced by mono-api-info as a source. The linker will use -this file to link only what is necessary to match the public API defined in -the info file. - -4) Actions on the assemblies - -You can specify what the linker should do exactly per assembly. - -The linker can do 3 things: - - - skip them, and do nothing with them, - - copy them to the output directory, - - link them, to reduce their size. - -You can specify an action per assembly like this: - -monolinker -p link Foo - -or - -monolinker -p skip System.Windows.Forms - -Or you can specify what to do for the core assemblies. - -Core assemblies are the assemblies that belongs to the base class library, -like mscorlib.dll, System.dll or System.Windows.Forms.dll. - -You can specify what action to do on the core assemblies with the option: - --c skip|copy|link - -5) The output directory - -By default, the linker will create an `output' directory in the current -directory where it will emit the linked files, to avoid erasing source -assemblies. You can specify the output directory with the option: - --o output_directory - -If you specify the directory `.', please ensure that you won't write over -important assemblies of yours. - -* Syntax of a xml descriptor - -Here is an example that shows all the possibilities of this format: - ---- - - - - - - - - - - - ---- - -In this example, the linker will link the types Foo, Bar, Baz and Gazonk. - -The fullname attribute specifies the fullname of the type in the format -specified by ECMA-335. This is in Mono and certain cases not the same -as the one reported by Type.FullName (nested classes e.g.). - -The preserve attribute ensures that all the fields of the type Baz will be -always be linked, not matter if they are used or not, but that neither the -fields or the methods of Bar will be linked if they are not used. Not -specifying a preserve attribute implies that we are preserving everything in -the specified type. - -The required attribute specifies that if the type is not marked, during the -mark operation, it will not be linked. - -The type Gazonk will be linked, as well as its constructor taking a string as a -parameter, and it's _blah field. - -You can have multiple assembly nodes. - -6) The i18n Assemblies - -Mono have a few assemblies which contains everything region specific: - - I18N.CJK.dll - I18N.MidEast.dll - I18N.Other.dll - I18N.Rare.dll - I18N.West.dll - -By default, they will all be copied to the output directory. But you can -specify which one you want using the command: - -monolinker -l choice - -Where choice can either be: none, all, cjk, mideast, other, rare or west. You can -combine the values with a comma. - -Example: - -monolinker -a assembly -l mideast,cjk - -7) Specifying directories where the linker should look for assemblies - -By default, the linker will first look for assemblies in the directories `.' -and `bin'. You can specify - -Example: - -monolinker -d ../../libs -a program.exe - -8) Adding custom steps to the linker. - -You can write custom steps for the linker and tell the linker to use them. -Let's take a simple example: - -using System; - -using Mono.Linker; -using Mono.Linker.Steps; - -namespace Foo { - - public class FooStep : IStep { - - public void Process (LinkContext context) - { - foreach (IStep step in context.Pipeline.GetSteps ()) { - Console.WriteLine (step.GetType ().Name); - } - } - } -} - - -That is compiled against the linker to a Foo.dll assembly. - -You can ask the linker to add it at the end of the pipeline: - -monolinker -s Foo.FooStep,Foo -a program.exe - -Or you can ask the linker to add it after a specific step: - -monolinker -s MarkStep:Foo.FooStep,Foo -a program.exe - -Or before a specific step: - -monolinker -s Foo.FooStep,Foo:MarkStep - -* Inside the linker - -The linker is a quite small piece of code, and it pretty simple to address. -Its only dependency is Mono.Cecil, that is used to read, modify and write back -the assemblies. - -Everything is located in the namespace Mono.Linker, or in sub namespaces. -Being a command line utility, its entry point function is in the class Driver. - -This class is in charge of analyzing the command line, and to instantiate two -important objects, a LinkContext, and a Pipeline. - -The LinkContext contains all the informations that will be used during the -linking process, such as the assemblies involved, the output directory and -probably other useful stuff. - -The Pipeline is simply a queue of actions (steps), to be applied to the current -context. The whole process of linking is split into those differents steps -that are all located in the Mono.Linker.Steps namespace. - -Here are the current steps that are implemented, in the order they are used: - -1) ResolveFromAssembly or ResolveFromXml - -Those steps are used to initialize the context, and pre-mark the root code -that will be used as a source for the linker. - -Resolving from an assembly or resolving from a xml descriptor is a decision -taken in the command line parsing. - -2) LoadReferences - -This step will load all the references of all the assemblies involved in the -current context. - -3) Blacklist - -This step is used if and only if you have specified that the core should be -linked. It will load a bunch of resources from the assemblies, that are -actually a few XML descriptors, that will ensure that some types and methods -that are used from inside the runtime are properly linked and not removed. - -It is doing so by inserting a ResolveFromXml step per blacklist in the -pipeline. - -4) Mark - -This is the most complex step. The linker will get from the context the list -of types, fields and methods that have been pre-marked in the resolve steps, -and walk through all of them. For every method, it will analyse the CIL stream, -to find references to other fields, types, or methods. - -When it encounters such a reference, it will resolve the original definition of -this reference, and add this to the queue of items to be processed. For -instance, if have in a source assembly a call to Console.WriteLine, the linker -will resolve the appropriate method WriteLine in the Console type from the -mscorlib assembly, and add it to the queue. When this WriteLine method will be -dequeued, and processed, the linker will go through everything that is used in -it, and add it to the queue, if they have not been processed already. - -To know if something have been marked to be linked, or processed, the linker -is using a functionality of Cecil called annotations. Almost everything in -Cecil can be annotated. Concretely, it means that almost everything own an -Hashtable in which you can add what you want, using the keys and the values you -want. - -So the linker will annotate assemblies, types, methods and fields to know -what should be linked or not, and what have been processed, and how it should -process them. - -This is really useful as we don't have to recreate a full hierarchy of classes -to encapsulate the different Cecil types to add the few informations we want. - -5) Sweep - -This simple step will walk through all the elements of an assembly, and based -on their annotations, remove them or keep them. - -6) Clean - -This step will clean parts of the assemblies, like properties. If a proprety -used to have a getter and a setter, and that after the mark & sweep steps, -only the getter is linked, it will update the property to reflect that. - -There is a few things to keep clean like properties has we've seen, events, -nested classes, and probably a few others. - -7) Output - -For each assembly in the context, this step will act on the action associated -to the assembly. If the assembly is marked as skip, it won't do anything, -if it's marked as copy, it will copy the assembly to the output directory, -and if it's link, it will save the modified assembly to the output directory. - -* Reporting a bug - -If you face a bug in the linker, please report it to: - -http://bugzilla.ximian.com - -Product: Mono tools, Component: linker. - -* Mailing lists - -You can ask questions about the linker of the cecil Google Group: - -http://groups.google.com/group/mono-cecil - --- -Jb Evain diff --git a/mcs/tools/linker/Tests/Libs/nunit-console-runner.dll b/mcs/tools/linker/Tests/Libs/nunit-console-runner.dll deleted file mode 100755 index f112e23221d11097dd553517ff666c30c14ffc31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeHueRLevk#F_K^vtxRF*Cxlg)L~|4@QRWZ|)~%{rx9-P``>yyf8AN2_^Tr!QkKoPET7iEUOrkn* z&Z7x>DE__1N3_k~YaAHO1-eRDlPfq~Tl<|cZ^+Hm)Yywd z(c8L-HfsjG_OXp!<=%cuiN-3;BDxTin4%_j;O*dZH9oAJgO{%KMoIMNHyy_Z^uMgt z*e;lLhWwj;hbZ&nd1!!W7ZAnO^D{|Q{bt(f;Leol!W{#?p`u-;=pHTtKl1_r z)QPRoyYg|MRmKneK@df^t5JYkXf-|+&ssPnJ!{ei&+So1T zJiEC;Pe+B0a#ByDojq>_S1==4tfNk6mF0%@RjN_l>sqrGvWYF{&E#7-Ur(nXu+FOm zES>}9(r2PH)re&;o7rZ?0(}A|m@Q|hw>Ossyso3oR5Q`3vD|KgXIx9IF7J?Co1xm9 z_z}#)&+pUWho^;~->1Wm2`&8mJ{^8LG>!r zbkj`qQ)SeTYcu#d%c!2NpK83LO!WV%ToS3vXaVBrS@elWNa_Llv}|jF=UrA*~;`L&VeT!09* zs-hM<(yEO-x4Sy#HL%ibHaMPJUlX56xUkmr?}wzM>7C7tm>9x%wl%>yqh)T|0mc7^ za%X9bnZ5LxWJKo5DriO5Qu4i&TrATa<=ZKV^a;aJzL(}>v@{*%O@= zOi!L^>mKA;t(Tly3bE;PS>r_jRsLLq#-jn0u&ZPKJqW!b&@0_4bspl}_Ra^W zvQEL{O2ImBIVjb!x?@GA)mWzxjkBtlhN1WiC=mDB&>&jxt-ve2k^v7N^nklnSw-+S z!CaTd`f0aB{T~Bqj`;tGS8c@q6<%rV9_(Z!eG#`>J)l2ur zW=qtn^DYLid#JKnmg(M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|p@`e+dn}J^s?1ovj zJCjzox9--kzZ(^~G6W-bmyACv(NtZg-J0ju?kxP@IH*%#)cM z1rA{*r&R1hN#mCpI~=qNu`ZU?r~le>qQ)-RV&0O-1z=qov7gp~qx)_DL^pwKhhLWZ z`3~KR)K*0Oj_k=bT|k1HnkJKwtRM`k)HJpN1y+QlCzLc5h~5g6>(fzVU8h-c^>B1h z0hsPkwRk-rTLhbgylVo#Q!prV?AwXP1E_z@z!CZ|_E>7Tix_&I!=cj<`{5)uHO#a< zr!ifcn>O@LG48j;QCm%%#c5hlvN2Ykf&sK})#aJ+gbE}s%7PZ#-fD;MPQ zd_lb|`n2m;I14evIQMu8-J;w#CZtH(bYT>A%`IJ8E3yn(lLm?`-Xl0g{w7`{zoPk< z_>A%$+UaGS)qb&eTvHz=a28$6VBn%D%U7|eGj3?@gA*m9mwgQUf@8dek6}RbLGl4S zOWucZ9n-C46M3A3#r}?y_v3l;CoqRmWOkTl5B)$*&|K+{%?6&-LW(=K?&T2f#f!pU zT<~j6SG@$U={eD8)%QZ*RhHUPXoOWiaGeTD+hL>{SgO3Csu5;fI}C|$h5pt|?7!Uf zJQZNUc05?s$PbbjYgt`(8RYmLrovD)D(-esh1I~>6x&q9Q>`>3^(<*D*UpzK;Zj~(#p?C~1q<0O!i0#+R0nfEi_Un^WX z|MlX}_tx|3CuDEDb7^&8^6rN`&FoXTv7}xyjtMXlolSD(~$Y`7D+xUBD7=^BU(x zyh2&%+sv?m3weA)toHS#((m^rR*WS?Jr5;ev( z7#Hvr)z7!?#k|I~l;n_;5L~U^h$bBd?FZwFdw-F+eAMV)C8GVkpVWQZ>$AUm?Y>D5 mffsbl6j6t|h6)jG6a7JP41M&;jQ{uEo_O@3{*Um#@4%m8W - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/tools/linker/Tests/Libs/nunit.core.dll b/mcs/tools/linker/Tests/Libs/nunit.core.dll deleted file mode 100755 index df7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V z+++9bIOUnq$KUBH_~b@ZZM_pw_?=1>cOyEAc2laRGs+(F2fc*rI7-oo)rE9|@A~pR ziMA|mZxR`t^QKen*g$b8Pexqg@%nm*+&PfK&&?QHo3EUWN#4QUydcyNWMN>>^ z=E1-R&xtCb6AlnDsS?jfXe^G)wt= zDxFQtZBDGZG}oAzolS2_XA-lU6KCb}xN|P#HZ~^a;?^^pNhg-)a8uV@UD40{Bx8R0 zh78UN6La&aOb67^e-bPBXrz!>kw#bFm~O}Z7(d+=TFOrk@x!W$Vv=mmNf_^9;i|J$6U+zaR8^fQ}XlEQtsJe5qR<=G``y*G{$vr5$m(O?7yBQO|& z!3YdSU@!uM5g3fXU<3vuFc^UWBf!5SNcc@Qxt9xQm>Ycjh|RVD6G^#SqlHMVxrJyJ z-zR#XS?*M%&cdUP3qj}MnbJyHgx@1u3cLt(KGOVo$o-FZ*$%(c$^S}}f0ZBX0EbPo zB=~6sP_W8Jyz_DV$Oom1aDd6rxcDHEq$qc+kvFDfH3e5tJz4;*kKi4Yyoq+Bn#0cM81D9)k7XI?kF6vB%UH+SfKlXJY z-ekrv9->V1NPv%)vjLCz>6q^iA2l0KFBRV|hK+V;<0%_{dFjirvl!)dhy|`;H|oY- zcHkHsce@giQeFbj-{#^c%o6a4V>lU)K}>22c%Se}Jbd#-|CEl9@etwLyQ8ed@l|1w_&`!{DNOF?9 z8Sg(=d;sq!m3Y4#_P7<2S%o+eb9Do#G#!+EchWqJNg1Y))~0J5`O29 z`(CMT-yYbv|4oxT{`2Kdd91M+k$As+QsF@|7=ghE3`Sru0)r74jKE+71|u*Sfx!rT zv=O+T@Eus9r>A_hW(TbeMqn@kgAo{vz+eOhBQO|&!3YdSU@!uM5g3fXU<3vu@V_Sl F{}06(PwxN# diff --git a/mcs/tools/linker/Tests/Libs/nunit.util.dll b/mcs/tools/linker/Tests/Libs/nunit.util.dll deleted file mode 100755 index e9e479ebc692bcf98d021d646b03f0369e2cc390..0000000000000000000000000000000000000000 GIT binary patch liter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Mono.Linker.Tests.dll.sources - $(MCS) /target:library /out:Mono.Linker.Tests.dll /r:nunitlite.dll /r:Mono.Cecil.dll /r:monolinker.exe @Mono.Linker.Tests.dll.sources - -clean: - rm -rf Mono.Cecil.dll monolinker.exe Mono.Linker.Tests.dll.sources Mono.Linker.Tests.dll - -run-test: all - nunit-console Mono.Linker.Tests.dll diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests.csproj b/mcs/tools/linker/Tests/Mono.Linker.Tests.csproj deleted file mode 100644 index a83021f1e64..00000000000 --- a/mcs/tools/linker/Tests/Mono.Linker.Tests.csproj +++ /dev/null @@ -1,69 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {400A1561-B6B6-482D-9E4C-3DDAEDE5BD07} - Library - Properties - Mono.Linker.Tests - Mono.Linker.Tests - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - False - Libs\nunit.framework.dll - - - - - - - {D8F63DFF-5230-43E4-9AB2-DA6E721A1FAE} - Mono.Cecil - - - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46} - Mono.Linker - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractLinkingTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractLinkingTestFixture.cs deleted file mode 100644 index 58dc1a551a0..00000000000 --- a/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractLinkingTestFixture.cs +++ /dev/null @@ -1,163 +0,0 @@ -// -// AbstractLinkingTestFixture.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.IO; -using Mono.Cecil; -using Mono.Linker.Steps; -using NUnit.Framework; - -namespace Mono.Linker.Tests { - - public abstract class AbstractLinkingTestFixture : AbstractTestFixture { - - [SetUp] - public override void SetUp () - { - base.SetUp (); - - TestCasesRoot = "Linker"; - } - - [TearDown] - public override void TearDown () - { - base.TearDown (); - - string output = GetOutputPath (); - if (Directory.Exists (output)) - Directory.Delete (output, true); - } - - protected override Pipeline GetPipeline () - { - Pipeline p = new Pipeline (); - p.AppendStep (new LoadReferencesStep ()); - p.AppendStep (new BlacklistStep ()); - p.AppendStep (new TypeMapStep ()); - p.AppendStep (new MarkStep ()); - p.AppendStep (new SweepStep ()); - p.AppendStep (new CleanStep ()); - p.AppendStep (new OutputStep ()); - return p; - } - - protected override void RunTest (string testCase) - { - base.RunTest (testCase); - - Prepare (); - } - - void Prepare () - { - Context = GetContext (); - string output = GetOutputPath (); - if (Directory.Exists (output)) - Directory.Delete (output, true); - Directory.CreateDirectory (output); - } - - protected override void Run () - { - base.Run (); - Compare (); - } - - void Compare () - { - foreach (AssemblyDefinition assembly in Context.GetAssemblies ()) { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - continue; - - string fileName = GetAssemblyFileName (assembly); - - CompareAssemblies ( - AssemblyFactory.GetAssembly ( - Path.Combine (GetTestCasePath (), fileName)), - AssemblyFactory.GetAssembly ( - Path.Combine (GetOutputPath (), fileName))); - } - } - - static void CompareAssemblies (AssemblyDefinition original, AssemblyDefinition linked) - { - foreach (TypeDefinition originalType in original.MainModule.Types) { - TypeDefinition linkedType = linked.MainModule.Types [originalType.FullName]; - if (NotLinked (originalType)) { - Assert.IsNull (linkedType, string.Format ("Type `{0}' should not have been linked", originalType)); - continue; - } - - Assert.IsNotNull (linkedType, string.Format ("Type `{0}' should have been linked", originalType)); - CompareTypes (originalType, linkedType); - } - } - - static void CompareTypes (TypeDefinition type, TypeDefinition linkedType) - { - foreach (FieldDefinition originalField in type.Fields) { - FieldDefinition linkedField = linkedType.Fields.GetField (originalField.Name);// TODO: also get with the type! - if (NotLinked (originalField)) { - Assert.IsNull (linkedField, string.Format ("Field `{0}' should not have been linked", originalField)); - continue; - } - - Assert.IsNotNull (linkedField, string.Format ("Field `{0}' should have been linked", originalField)); - } - - foreach (MethodDefinition originalCtor in type.Constructors) { - MethodDefinition linkedCtor = linkedType.Constructors.GetConstructor (originalCtor.IsStatic, originalCtor.Parameters); - if (NotLinked (originalCtor)) { - Assert.IsNull (linkedCtor, string.Format ("Constructor `{0}' should not have been linked", originalCtor)); - continue; - } - - Assert.IsNotNull (linkedCtor, string.Format ("Constructor `{0}' should have been linked", originalCtor)); - } - - foreach (MethodDefinition originalMethod in type.Methods) { - MethodDefinition linkedMethod = linkedType.Methods.GetMethod (originalMethod.Name, originalMethod.Parameters); - if (NotLinked (originalMethod)) { - Assert.IsNull (linkedMethod, string.Format ("Method `{0}' should not have been linked", originalMethod)); - continue; - } - - Assert.IsNotNull (linkedMethod, string.Format ("Method `{0}' should have been linked", originalMethod)); - } - } - - static bool NotLinked(ICustomAttributeProvider provider) - { - foreach (CustomAttribute ca in provider.CustomAttributes) - if (ca.Constructor.DeclaringType.Name == "NotLinkedAttribute") - return true; - - return false; - } - } -} diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractTestFixture.cs deleted file mode 100644 index f4ac2d5a3f0..00000000000 --- a/mcs/tools/linker/Tests/Mono.Linker.Tests/AbstractTestFixture.cs +++ /dev/null @@ -1,134 +0,0 @@ -// -// AbstractTestFixture.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace Mono.Linker.Tests { - - using System; - using System.IO; - - using Mono.Cecil; - - using NUnit.Framework; - - public abstract class AbstractTestFixture { - - string _testCasesRoot; - string _testCase; - LinkContext _context; - Pipeline _pipeline; - - protected LinkContext Context { - get { return _context; } - set { _context = value; } - } - - protected Pipeline Pipeline { - get { return _pipeline; } - set { _pipeline = value; } - } - - public string TestCasesRoot { - get { return _testCasesRoot; } - set { _testCasesRoot = value; } - } - - public string TestCase { - get { return _testCase; } - set { _testCase = value; } - } - - [SetUp] - public virtual void SetUp () - { - _pipeline = GetPipeline (); - } - - [TearDown] - public virtual void TearDown () - { - } - - protected virtual Pipeline GetPipeline () - { - return new Pipeline (); - } - - protected virtual LinkContext GetContext () - { - LinkContext context = new LinkContext (_pipeline); - context.OutputDirectory = GetOutputPath (); - context.CoreAction = AssemblyAction.Copy; - return context; - } - - protected string GetOutputPath () - { - return Path.Combine ( - Path.GetTempPath (), - _testCase); - } - - protected string GetTestCasePath () - { - return Path.Combine ( - Path.Combine ( -#if DEBUG - Path.Combine (Environment.CurrentDirectory, - Path.Combine ("..", "..")), -#else - Environment.CurrentDirectory, -#endif - "TestCases"), - Path.Combine ( - _testCasesRoot, - _testCase)); - } - - protected virtual void RunTest (string testCase) - { - _testCase = testCase; - _context = GetContext (); - } - - protected virtual void Run () - { - string cd = Environment.CurrentDirectory; - Environment.CurrentDirectory = GetTestCasePath (); - try { - _pipeline.Process (_context); - } finally { - Environment.CurrentDirectory = cd; - } - } - - protected static string GetAssemblyFileName (AssemblyDefinition asm) - { - return asm.Name.Name + (asm.Kind == AssemblyKind.Dll ? ".dll" : ".exe"); - } - } -} diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyInfo.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyInfo.cs deleted file mode 100644 index 0c169fdd659..00000000000 --- a/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyInfo.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// AssemblyInfo.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle ("Mono.Linker.Tests")] -[assembly: AssemblyDescription ("NUnit tests for Mono's CIL Linker")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("(C) 2006, Jb Evain")] -[assembly: AssemblyCulture ("")] - -[assembly: CLSCompliant (false)] -[assembly: ComVisible (false)] - diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyLinkingTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyLinkingTestFixture.cs deleted file mode 100644 index 4810cd1b788..00000000000 --- a/mcs/tools/linker/Tests/Mono.Linker.Tests/AssemblyLinkingTestFixture.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// AssemblyLinkingTestFixture.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.IO; - -using Mono.Linker.Steps; -using NUnit.Framework; - -namespace Mono.Linker.Tests { - - [TestFixture] - public class AssemblyLinkingTestFixture : AbstractLinkingTestFixture { - - [Test] - public void TestSimple () - { - RunTest ("Simple"); - } - - [Test] - public void TestVirtualCall () - { - RunTest ("VirtualCall"); - } - - [Test] - public void TestMultipleReferences () - { - RunTest ("MultipleReferences"); - } - - protected override void RunTest (string testCase) - { - base.RunTest (testCase); - Pipeline.PrependStep ( - new ResolveFromAssemblyStep ( - Path.Combine (GetTestCasePath (), "Program.exe"))); - - Run (); - } - } -} diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/IntegrationTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/IntegrationTestFixture.cs deleted file mode 100644 index f455f6559af..00000000000 --- a/mcs/tools/linker/Tests/Mono.Linker.Tests/IntegrationTestFixture.cs +++ /dev/null @@ -1,123 +0,0 @@ -// -// IntegrationTestFixture.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Diagnostics; -using System.IO; -using Mono.Linker.Steps; -using NUnit.Framework; - -namespace Mono.Linker.Tests { - - [TestFixture] - public class IntegrationTestFixture : AbstractTestFixture { - - [SetUp] - public override void SetUp () - { - base.SetUp (); - - TestCasesRoot = "Integration"; - } - - [Test] - public void TestHelloWorld () - { - RunTest ("HelloWorld"); - } - - [Test] - public void TestCrypto () - { - RunTest ("Crypto"); - } - - protected override LinkContext GetContext() - { - LinkContext context = base.GetContext (); - context.CoreAction = AssemblyAction.Link; - return context; - } - - protected override Pipeline GetPipeline () - { - Pipeline p = new Pipeline (); - p.AppendStep (new LoadReferencesStep ()); - p.AppendStep (new BlacklistStep ()); - p.AppendStep (new TypeMapStep ()); - p.AppendStep (new MarkStep ()); - p.AppendStep (new SweepStep ()); - p.AppendStep (new CleanStep ()); - p.AppendStep (new OutputStep ()); - return p; - } - - protected override void RunTest (string testCase) - { - if (!OnMono ()) - Assert.Ignore ("Integration tests are only runnable on Mono"); - - base.RunTest (testCase); - string test = Path.Combine (GetTestCasePath (), "Test.exe"); - - string original = Execute (GetTestCasePath (), "Test.exe"); - - Pipeline.PrependStep ( - new ResolveFromAssemblyStep ( - test)); - - Run (); - - string linked = Execute (Context.OutputDirectory, "Test.exe"); - - Assert.AreEqual (original, linked); - } - - static bool OnMono () - { - return Type.GetType ("System.MonoType") != null; - } - - static string Execute (string directory, string file) - { - Process p = new Process (); - p.StartInfo.EnvironmentVariables ["MONO_PATH"] = directory; - p.StartInfo.CreateNoWindow = true; - p.StartInfo.WorkingDirectory = directory; - p.StartInfo.FileName = "mono"; - p.StartInfo.Arguments = file; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.UseShellExecute = false; - - p.Start (); - p.WaitForExit (); - - return p.StandardOutput.ReadToEnd (); - } - } -} diff --git a/mcs/tools/linker/Tests/Mono.Linker.Tests/XmlLinkingTestFixture.cs b/mcs/tools/linker/Tests/Mono.Linker.Tests/XmlLinkingTestFixture.cs deleted file mode 100644 index 1e89290ef78..00000000000 --- a/mcs/tools/linker/Tests/Mono.Linker.Tests/XmlLinkingTestFixture.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -// XmlLinkingTestFixture.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// (C) 2006 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.IO; -using System.Xml.XPath; - -using Mono.Linker.Steps; -using NUnit.Framework; - - -namespace Mono.Linker.Tests { - - [TestFixture] - public class XmlLinkingTestFixture : AbstractLinkingTestFixture { - - [Test] - public void TestSimpleXml () - { - RunTest ("SimpleXml"); - } - - [Test] - public void TestInterface () - { - RunTest ("Interface"); - } - - [Test] - public void TestReferenceInVirtualMethod () - { - RunTest ("ReferenceInVirtualMethod"); - } - - [Test] - public void TestGenerics () - { - RunTest ("Generics"); - } - - [Test] - public void TestNestedNested () - { - RunTest ("NestedNested"); - } - - [Test] - public void TestPreserveFieldsRequired () - { - RunTest ("PreserveFieldsRequired"); - } - - [Test] - public void TestReferenceInAttributes () - { - RunTest ("ReferenceInAttributes"); - } - - [Test] - public void TestXmlPattern () - { - RunTest ("XmlPattern"); - } - - protected override void RunTest (string testCase) - { - base.RunTest (testCase); - Pipeline.PrependStep ( - new ResolveFromXmlStep ( - new XPathDocument (Path.Combine (GetTestCasePath (), "desc.xml")))); - - Run (); - } - } -} diff --git a/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.cs b/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.cs deleted file mode 100644 index 8c38f929750..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Security.Cryptography; -using System.Text; - -class Test { - - static void Main () - { - byte [] foo = Encoding.UTF8.GetBytes ("foobared"); - - HashAlgorithm ha = MD5.Create (); - byte [] hash = ha.ComputeHash (foo); - - Console.WriteLine (Encoding.UTF8.GetString (hash)); - } -} diff --git a/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.exe b/mcs/tools/linker/Tests/TestCases/Integration/Crypto/Test.exe deleted file mode 100755 index 2decc49839b86bf465512f41701245c5bd31016c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHI&2Jk;6#s2vJBia+NdrdgQ`|3&$c=qN-GhKY-r2aVd8sIB+KX-pp=dq6onOF7zeyzURF+Z{CjA zZhVe@012-Bec&FcKwjg&Mtd}8p1z;K-Jyq*_pH^2lck+TV7Gm*?w4D3wd}fHXjhc& zcU-&S+6(JNyXDoCGcuB%jzV8w1XitnbY50VakfXuSi@Gz6eWcT*wM<9N_93#pK&3l z>lcbWF6ss3T)?RQKctbUZNP*LtP7t9zK`~acmUhLi38#9Gov;z*yCQKe5FTrLbV%G zzAHu2rVnr=Kh@igANW<8b#3{`kFDv2Jgawn)%577Yu%<*Vx_ryAP*FJM9uD>8MUcD zfV^$k8xa-h8hJU-@vt@T`HQ=1t=w?Y3aXy3lv8Uq5l1rTmU42Fz=vck@+2vd|4TUC zH^bEFv*Wp8JkP`w#%5SZ+9%iccoXUL4CgI9JdpB|q$jj>&||;TGXq3tQ7B$5So#E} z*Y93%E;zH7E?(3JNuo{qE7#QfygY{ePWWQzH{5za7B=%eA-atsX36J;FEqUhX-JvV zimBy|l?Bom7{*#o^kFDgkWvShsIQsZ!0NP4^s<0&BAVhDj3I^7c$Rn(E5t30Z&NSu zwZ`UDqxgzal6x)uY>VNei3u(Jrls4sj~wM8h;|H@kRhJKI8Nav*CcK+(-=O+89awC za1OIb?BNJV4yp2!abu8t5$F+WHY!-JysfGsirpYoEjZQC^Rehwy&78?X`PaMM0FKz zZIqT?#Igzt-B1NsTeuv16jin3H^Qzn?|0jwJWTDKF6Mnz4i&DHgPqr!b&n1^EzEnZ zb|+M#lu+ihhCQ&qSU27l@_jZ^FEyJ@L(K8zzsD1+H%92yh_Xd`#(QlG6f8!S4lkjBCi}bsm-FXow`u*D zmS`DA)9AhmRP@-ihwD`0aOpFhVs>SOY)a#x+Zn~;cY#*)hG z*kN`P>%9JMr4ym9#?{`3(Mr??+8a2pYm2+Lpe9(9A-XoIfNL-)89J^csrq08&n_I2X+TuPR@90WQ9=+i)`ez-m P&F@&B4EAIA-*w;*PPGE5 diff --git a/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.cs b/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.cs deleted file mode 100644 index 4a65b4401fc..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -class Test { - - static void Main () - { - Console.WriteLine ("Hello world!"); - } -} diff --git a/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.exe b/mcs/tools/linker/Tests/TestCases/Integration/HelloWorld/Test.exe deleted file mode 100755 index 2f4f4c9dcaa9ac41c61b0fb54984d5564c70ee69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHI&2Ah;5dOyASg|21LoSXKg|=cMD~d)=FhW9B82L9w>o~BEgRDsL{xq9`*_qYM z7#t4ZQxt9iiFe?b0}>X9Hy}42AP<1x!a3%v>KS|EL=lmqTyS~2>!+)$zOJcmuWa1M zAb<+T-X5?^E)?ke{Aq{F)wh1B;-}$<7q4Hz@Ps>lKGd$CW{ecA+G-&g*-FlvC~eeP}QSNe26x7#`OUCGHc zJ;0&-G;jK8mbSR8*n+~3rRk@D=>6122^|&dCRZia2uB|Uz-*tY;@;b%hW335j1xBs zF4|Sfa-L_?t+^y!*tRQ;Fh)0PC8@Q3JBm<7a_82gjq|)7z@NYy0`*r(X9gyjdgQ#H zlJzDDVdVU5{li&L5xLrZanZl%Prq~Nk^(!19=Y6!vtI+UyC!lyPs6yAiAzq~X|Y|e z<38mvk!Pc%N&X{sb|20zU08pvtWPbPILhuCBQmkU0`Px=N6cZRdj zyE;4kqnM(0jGi9;G_r7aY)rL(RQnD~I7xk&7(MPkhbk&NI7AXda^5@X79^gMe%dH( zVzv31ZRM!n$#UC;-^!B|b4i>fk;RQP%xx`@Y>>>R1@yrizb{4+R{t7tdZ0d2yjSlr_7tYk)H^mwL>{hjXTq-CLW@z>i6LdKGK*oJ z3H6(!SC{XIV7bGSH>g>G!QL-@o{V+a$K|VWSBJYJNW>mv3GxnZGrNm*L2tiQB3CrA zdLKkvqcu}+;DTZ+t2eJJEsfZtM|lbt_jKPm1iQqS$L|1t8Ru{noX-s39FO1I;gxF3 zDat*fxr&tdeCF8Z5OO#V&hEZyo2y;!OYylPad~vZ(ez>!Fz)}}fIR$1^uMdXze*|3 A+5i9m diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.cs deleted file mode 100644 index 75fe1ed367d..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; - -public class Foo { - - void Bar () - { - int i = 42; - string s = "hey"; - - Baz bi = new Baz (i); - bi.Gazonk (); - bi.Bat(i, s); - - Baz bs = new Baz (s); - bs.Gazonk (); - bs.Bat(s, i); - bs.BiroBiro (); - - bs.Blam (); - } -} - -public class Baz { - - T _t; - - public Baz (T t) - { - _t = t; - } - - public void Gazonk () - { - Console.WriteLine (_t); - } - - public void Bat (T t, M m) - { - Console.WriteLine ("{0}{1}", t, m); - } - - public void Blam () - { - } - - public T [] BiroBiro () - { - return new T [0]; - } -} - -class Bang { - - [NotLinked] public Bang () - { - } -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -public class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/Generics/Library.dll deleted file mode 100644 index fe5cab1771525ddbc299d66fe8d536ef3f04d5a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeHK-ES0C6#vcccDuW6mzEY%q?Tz4T8nNLf@wksF53?%*|vn1mJkD--HzLl*_qAk z6etC$hL~uo(L|$0O-T3$d@$Ph@!%i8n{WESA3)-ZPd-?G=gtn>7NS1+Vo!U|z31F> zf9K~b7Ok3I_1v;&RP>VJ zIIgc3P2F2^bj#64rl$3ZyI^M8+ENGW(C0>hf)>TQW7b&c?IF^AEm|B%P$Pi}>GhUl zFVX4jB8}e6?FqwjP^pz%&ona&wv7-e$Xmksq7PVP z{8}AIXx-qs{G!B$DD#3}{DK z$T4LmYRv4^-P*;T(@Gc4i7j2J29)d3$9ZHsh;dx;g5qD|duo1B<45E|mlcvc)c+i_b-5k3(z_ZFo#9{D7tA@1!XoeI3&-K|#tuB12dv64pm!nri%nLxrJ zJj3;NT{=pX7^-!tmv%AStxGT92&J_^QXXRXXp1Bj`HW5i9>M2~OCo6{Pm>E?tMb^T zG+j#5Ro4i97bJonl}iUN?G)>i#~k)4oIb^mkbj5_t5m^#oW&aX3O=D*8DA#G^B6?| zGl;D+m@PC*i97w6q{<=15mQ1Ean-l5Pof{Y@De(4Ld?`Px2+e{0 z@?8(7jhn7>6?wx)-tt^&$lFE*S9}b+PR+GV%z2h?7A(iaDWB)Hxa6BCSVhn9mT_Xj zU0AZslc7RACSxu^jGOaE$el7KU7xG3nhTBPdBcOxQk-9Me5+y(yOpZpTSd#Z{N;vK z5NW1vlo2b-Hoa-nyJnTlS|gkp!z-KqCdGxCQ8pVuGnfFH7hz(VM{fmLp2!vMoSaKU zb!driZ@xOa@7Tk4nsiO;MAM$#ty&_H)glyn5lv}nrAl*@Xwva)Ct_J1`&dfb-5!m1 zA}$L$5uqNM))VRFWr=F(o}P4bERj}d!qUBRS7su6=RBi2={ln~N@mr!TxVv{bFbGl zwU-h?#~wZp8+RnU?Be}D7Js^X>YFo@xAgZ<{vf&?+NprNSn}lao3XmJ8gj;XZl0nS zJNdijVh*^q=}Ea2IY#X)rg4RQ6z4e_=Q}n@d7OMK_^S&)#(w)#{BEaL>I(V3Y=TwV z5ps>F20Y?euz3r|;ovp6YW^Uv4EXMOv~c)7+U$MWxs-(N;H%iLbg3~WpH>$2<){N2w^4xcF(3hF) q`r7;nV{OzR*xdz2Qc?L_RnY{#Xud=LwgP(aKSM+g_745;D)1K`mQtet diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/Generics/Makefile deleted file mode 100644 index 2e5bf5bcfe8..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/Generics/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../../config.make - -all: - MCS /t:library Library.cs diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Generics/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/Generics/desc.xml deleted file mode 100644 index 0dd61b9b385..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/Generics/desc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.cs deleted file mode 100644 index 7aa939469e5..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; - -public class Foo : IFoo { - - public void Gazonk () - { - } -} - -public interface IFoo : IBar { -} - -public interface IBar { - - void Gazonk (); -} - -[NotLinked] public class Baz : IBaz { -} - -[NotLinked] public interface IBaz { -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -public class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/Interface/Library.dll deleted file mode 100644 index 2ae8b9239cca604189425aec9c447fc0d39ef98e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHJO=w(I6#m|1W=x_92?a@2>K!IR7-UFmKm^g}G(S$6B*jT$DTU_E%yT;C&3oa^ zn_@!MQNf>G7cPq^=)#?gfX*+gFqT`ypu#=1?f%HzP8Oh^EUb2`r>l$ltU zBOrPxYq z-xXS8)C8H(Pnm$0h2NA|AI{8Z>kn=HY8l`CAs=#sktv?n4DU&XGRwWkAQ`4L&yk

Df5&a~)2ulAfxpww zyWxaQH|q2!Hakw!?Z+FCBMR2&xBFMNPA}a3BrVW0%Ce>>MlBq^Y(n1uw05g-|Lvvs zZryzStL|rC$JPCdLcTxWM4&gE)Z7f7sK3oioV;t7Y;y<17P^sIAm2h2SIL*~8nrTC z+BMo`@@4bt;)nF_e2^QnPa1i#M+dHBR - - - - diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.cs b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.cs deleted file mode 100644 index c2f0df4fd2b..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -public class Bar { - - string bang = "bang !"; - - public Bar () - { - } - - public void Bang () - { - Console.WriteLine (bang); - } -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.dll b/mcs/tools/linker/Tests/TestCases/Linker/MultipleReferences/Bar.dll deleted file mode 100644 index 159106da888a3ea1cd9e8298a45559cd2b031602..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHJQEL=e6#njJ4JI~A#D}I(+PfGfhzv0es9@V=lh`IEMqEuq6f?U!u489smb;Tu zTiWKKl$O5q!5`4aKC~cGP)dAIeAK@n{s5tWpfvr?y)(%s7AZdTr8&vmd%k;-QnBN!hc%i@@BUuGZv#)u_tpH<@`W2=S9eU(GJab({5Vch zT@SQbjdd97>BX9EC(Xbc8X6qULZ6!f=2aj5eDmJve7EN)mG`NBM@oo^=6!-3mRlwBV`+M&LiU~sqJ)l?>k6$BYmiTmRDfy^wCcv8 zVa@eTsc5HO&SpVpsY^cpEZ3$IGaW?>ei)TjPT><>HBKW_Q zxq{)=oi8~Q3u7Dyk6@zkg}^cL8$5D#{fBC8uBtMIQp-<|dB?oT_a-JR(LLyJe$40K zSHL9SJSTcBHDTQ9ipw`#W5?m(#Tsr?9}&G8C3Vif-ycJ zKRr8h_tDMTzS|E^=5%)F*R6nbjP2RA?GfCGU7p*}K2rK6L?U0~PVotwSCLanuh90|%aMMzKI1$?#~FK^C#!DH(-;{ko_xcI zO{}89C`;sExL3Z5=02m=Z;D=R-W$T@7BlyW0-?d~&V9DW+Ueu=o9A0Cz8yg#b{I>T zw{U~IyI5n)TiHsamQ8HEx1v>v4SkPVUU|OL^zAYSiPqUxC*k*YPY%L6riWZ~VsrWB zaduX~`JCWiLB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-lQklgX`=&q-TTmd#ud-$2f)_ U)Bn8#X8bd8P+r$#dggZEFFKGZ?*IS* diff --git a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Makefile deleted file mode 100644 index 2e5bf5bcfe8..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../../config.make - -all: - MCS /t:library Library.cs diff --git a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/desc.xml deleted file mode 100644 index 0dd61b9b385..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/NestedNested/desc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.cs deleted file mode 100644 index 63a5ee7e23b..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; - -public class Foo { - - public Foo () - { - new NotRequiredButUsedNotPreserved (); - new NotRequiredButUsedAndFieldsPreserved (); - } -} - -public class NotRequiredButUsedNotPreserved { - - [NotLinked] public int foo; - [NotLinked] public int bar; -} - -public class NotRequiredButUsedAndFieldsPreserved { - - public int foo; - public int bar; - - [NotLinked] public int FooBar () - { - return foo + bar; - } -} - -[NotLinked] public class NotRequiredAndNotUsed { -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -public class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Library.dll deleted file mode 100755 index 941d6c39d11bb38279705f20fbb570eab7fade39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal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s/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Makefile deleted file mode 100644 index 2e5bf5bcfe8..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../../config.make - -all: - MCS /t:library Library.cs diff --git a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/desc.xml deleted file mode 100644 index 979d4e05c85..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/PreserveFieldsRequired/desc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.cs b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.cs deleted file mode 100644 index 6ca5a7f138d..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace LibLib { - - public class LibLibAttribute : Attribute { - - public Type LibLibType { - [NotLinked] get { return null; } - set {} - } - } - - public class BilBil { - - [NotLinked] public BilBil () - { - } - } -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.dll b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/LibLib.dll deleted file mode 100755 index 2f1e45788cc07bda48a3d2d73085f0de2aba3d13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHJO>1LS7=CV&)-*FM>C6Z-IE*KxLMLcU$AT_IuW9C^lD30si&UY_$2E<;$t^cG zqm`nS0ny#8T)7xwc7lkA7QsIt4!CeRi&?l7bm2lotj~MSy-8Y%%*u`P-kkTm&v`%2 zb3X1R3v0I!2asSpH~{w9i`ZKKyV|3B;_+`M@YUGe%)V8=n_1p$b=9`-HT`N^)vKM3 z7pR(}{9Z@3I;yl(QEji`|!Q_mgX-#_SiTsBI^Ru`Zwr9sC~d$1uThe13!g%0{gN7oa}=KH_{474uv;}uMOdR z;Jh6W|0X2q(+fB|`Hr%;abCv(H?*q)CoooBakWWZwmTWd8$k zwi5WQPO~c^pRk%-*X&9Kw`tFcU39$~dpSSeL}ah7%$L|l!ZOy?M{iqWGLSZta||PF zQcHTla!mw_Esf>+Ht?Lbfl(g$8S0GIyIOy$^_SElPirl!v^d=yra41|Dnw&MGEW+7 z)Z!b#FG`X=IQy86{N12r8xzETgy?;oCi=@D9T`I+!?ZBZ@V&+QQe{%>i_}@z$l(I^ zw7$uai@2%n7~_DCagKeQPmE6-i9HS;l4&A|{P46H7S5sQ>*%&>cq!m1)p~)0%1$?M z+Q`=f&&N{jO{X59+^X@1=NG(2&vjl1vA)E{HApYET>h}=1?5&}%V`WeO($44(aSsA z4z%hX9=lO>drnwg`}^6;RiF9Y0ne3gwdwTT(R$(vR`Q#7USB;od;g<^!m05QWm%`j z6G@s0S+?NG$)tsY7fn+8+Sa|-X70>?9{=;}&))j}PE_jnUhV|HiQsV@67yCRjv1FQ z`L4Zc1G{p_q3p)w_OGIXb?VD_h1NX3w2Q>^)K|<`7vCj*{o9;hlxg~qzP^h?WwoskdK~XGi!+I9Nh^MW8(z5ErpzA$7Ll^jv%uu!yNP6U6+rD n;X2p@bGi*OX*1WymS$t-(g_dMgYAGa{~2O(u^-C+ZU_DW-*^qy diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.cs deleted file mode 100644 index cb3903f3c35..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using LibLib; - -public class BarAttribute : Attribute { - - public BarAttribute () - { - } - - public BarAttribute (Type type) - { - } - - public Type FieldType; - - public Type PropertyType { - [NotLinked] get { return null; } - set {} - } -} - -[Bar (typeof (Guy_A))] -public class Foo { - - [Bar (FieldType = typeof (Guy_B))] - public Foo a; - - [Bar (PropertyType = typeof (Guy_C))] - public Foo b; - - [LibLib (LibLibType = typeof (BilBil))] - public Foo c; - - [LibLib (LibLibType = typeof (Guy_D))] - public Foo d; -} - -public class Guy_A { - - [NotLinked] public Guy_A () - { - } -} - -public class Guy_B { - - [NotLinked] public Guy_B () - { - } -} - -public class Guy_C { - - [NotLinked] public Guy_C () - { - } -} - -public class Guy_D { - - [NotLinked] public Guy_D () - { - } -} - -[NotLinked] public class Baz { -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/Library.dll deleted file mode 100755 index 7c5b9970049fe24a86f57b01d6fa290bcb6e4d81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeHKL2MgU5Pcgv!Euu)4Jo9ely4kR6(TDw5eTUT*GW?XP8-!}KvhMuwim~Avm33~ zRb5pO4j?$e0SR#{CnQcBDp7%o;8JlZLa6EqP!1e8P=Q2`sNv23-Z)MW^u(d+#DC_$ znfdc)#_Rt#GpF813_zS?eI2+=DU{Xx-`Oh7eUE(6hfCepQkSj#wba~FwWd}AzY^HX zs$_efAF86Gg1V=wo|-&fP|JSV$@KOnhnt~ij{tcqhO6UCQ_*f~=u7Rex_|^Vl9-Tc zjx42QrzkpF=Ex1JMo+Hm0{Zo*C7VzjNJ9!ZE|V;9o$8Yj^bc}PU=bvd|!Ve~0cgC)ISgw`)z;QBV*F_Y`)Gg^8OfmgV zz-k5({D0Ekj(yxZITFd_;0U@#0Ai-6^>-?DoLu3BoYkyG`hIqQW`Ab<$pZ&;QJq+! zJjaOX*MVOthqx+T2!pCusc9E}m-2O{PZkj8tg6> zLxXK-Pa7I;L!)hIybVdWKj4-YzGTgk-%ia_n(rt78Hd^Jr?7}qcpNt8Gbk~;C-5e% z6?{y76<=%Xn&z;?Gp4!HJZ+`%3(|Vt!99R)@GxbZ=U)d$4DnSe+h`w=c)oMLQOozX zoo+-b{j+wfMH~+K^cL%(gF>SgI?KqELO;Oq;%iPRM7~-K?4W^zGk&@5I?qN5eH`TM zptX9+_i?n|SU9YCPV))PCy}$yylF|*am#a!6$hGyGOIY@!ffELI6>IZ z+S*pdS=+5UX!EgAWRJ^|96wFb+Gk@nX9tX5Yt?+RW>=gIbJUxdf|dCE{OS4K<7@B6 zx(0eXm1Pa|#udmCWYqPj(5nb zyY7SA!s~4(rIww$5*F5Y-3*t|Z z`hXUXXYKY#m$lCrZ@#A)dko_|Iph}H$BZn@a;496q|VbMWHt_QZDSWjzhUh+L9b=L z3rH>vR&EnHv;vC5__W8`>SOlHb5(__T}Z?g#*)k{SmN#`)|kFkr4ymf#?#)dXnFb< zxk~!h;F?jLUsU%b*VI^xL|tKoR=*_AJ)3Hg{ACY$i4mKrA&RrL6UHaYH&ct>xye~N zE|o-U1evb1=a^xCUH(P6wt8T`-7+&-*7cmx*_gfPevj_71Iql*&|zNh?sU~Xzq_OZ Fe*^dSdV&A| diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/desc.xml deleted file mode 100644 index 0dd61b9b385..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInAttributes/desc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.cs deleted file mode 100644 index 8b840b4cc89..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.cs +++ /dev/null @@ -1,35 +0,0 @@ - -using System; - -public class Foo { - - public void Do () - { - Bar b = new Baz (); - b.Bang (); - } -} - -public class Bar { - - public virtual void Bang () - { - } -} - -public class Baz : Bar { - - private string _hey; - - public string Hey { - [NotLinked] get { return _hey; } - [NotLinked] set { _hey = value; } - } - - public override void Bang () - { - Console.WriteLine (_hey); - } -} - -[NotLinked] public class NotLinkedAttribute : Attribute {} \ No newline at end of file diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Library.dll deleted file mode 100644 index b56fa604fcd68be81d5a0e1a01f6e73bcda3fba9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3584 zcmeHJPiz!r6#sp@%d#!7f}{jE)TsqitF9{+F@(UXr7tTVHf zVlaC!CcSwwTud7DXbdJMq6vlr@g#|NJrF&am>4}8BmUkuv)wKbG$fwv+s^mB-}~PG znR(NRSKmhxK#JF$JHR#WLIu4(cxmxC``A}meBN_w;F>Dk8kk#1GXUi|uH)ksa8iGC-OVxkz7&fx)Z5 zOBRD$BFdYb&R=%4cu_9Ix>CSa{ny!J7^$E^zb^}409InV_$b=ufX!Wke+dkL6|7Q* z`1mRUa-nr0B)-WEbuCioUGWWIF6Re+l}9?a0vXX?>zI(@Le94wkBU0iISR$sU5Qg~ zl+rF*Vf{jqTLK$!(*QnUE5(Qe`yT&Cx*!M4)=CgK=dU| zrn?P^w`rE@eG2K}Cy+>95;S};77wxV$dpW4yloI~v>h#<9940~;%jkVE}z?ApAL@DRi2B8R7%k%Ej3G4^8ErHc*;-y|5}9;p9EZ7<^!gz#k-x6jpD7WF z^rTY792u0}+h});lKQNlXfruE--^eHdKk5bXdYRdGAO`%n9;G%M`-6cjRK9nQL`E? zcAd2%l(BiM6fVc;P4p36iR>VD34FH3E`cw*kks)LcHtcQF~GH#dCB@De#3M0EPM`| z@B-KEID!?N#1KBx>kYjQ;u*dM(v2nTX0#1_(-pgwM5;w$7ky78{ce-O{x%C7n(*eE zj&&F%yW*SvQf}UHaLn^CYWln`V$usswtL>1KN|9JsWd|i^`Pqcj$J`{DG04PrYdh( z)es$pqK8~H^u&Q%!|Z~!gqju39_Jp!yYP{D?sU@)?Yfm4^Xd)TvHY^-FWOZrKqN3j z+jCD_j(I_IK_^UXC~7>a*p3}8bxz}guxL6>i@w~zb1a1+X*vimve?cNNIrM=nb8?RcdC6cd6XDketA%%IGP zFvH1qn%oIYVUqX+*JI>`uBU$et3BDYAYP8dJ7;~@`zvCZ%Zgr2`1E6QzFYL^;&pg( zj6M1zIn7g((tzhCLh5-$5nWAv%z_ki3aMpNUb~N{me$F$?&vpyiu3?aGb6RCUu5(E zRqdzI6~~}%o-am6cZRw?wL7`wIpsPRzfXE@OEsa^b(y=vewnBf^Ls?wimuG(^viLc zJN$tYQgSL$r=~5&SZ#wEQe6!T^alN^6}11UST2=||8^GzJvh#YuICi(J;rXb?vQt) tyQ)q-Qk&EyJvhp`18UZpzr)Oof3&0NI{nujFrt4GZ^-MqPXD_O{0))aHQxXL diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Makefile deleted file mode 100644 index 2e5bf5bcfe8..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../../config.make - -all: - MCS /t:library Library.cs diff --git a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/desc.xml deleted file mode 100644 index 0dd61b9b385..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/ReferenceInVirtualMethod/desc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.cs deleted file mode 100644 index 538205a7cdf..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; - -public class Library { - - private int _pouet; - [NotLinked] private int _hey; - - public Library () - { - _pouet = 1; - } - - [NotLinked] public Library (int pouet) - { - _pouet = pouet; - } - - public int Hello () - { - Console.WriteLine ("Hello"); - return _pouet; - } - - [NotLinked] public void Hey (int hey) - { - _hey = hey; - Console.WriteLine (_hey); - } -} - - -[NotLinked] public class Toy { -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -public class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/Simple/Library.dll deleted file mode 100644 index 5225e8868088905f3cdd339b4d41bde1a1a194ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3584 zcmeHJOK%%h6#m9`BG+xAL=_@cAxxBj(twN`B7v$1+$2pCaFPn=feKRM$Hg%n&sZ}P z)bs%nl`3F?_y@3J-33x3C|h=2!Lo}kyFg;g0ujD*?~ET>|gP*KE*9+~k zvi%*`uDkZ!O3`k3Rh8}Q%Zx>-uUrBORubP0-k*HFvwCP?C%}@1K)(`v&&APTc2jbtEn2_px)>n>4M_ua{m6GdF;q;rKwu=s49I*2p zn!Ihm)kq3j=2-eUnl@)Wf6j51N_7{FpyK&TWvh;ZIFspH%9$Gh{@}oh5()k{=|WIj$5~+}anrb9Igz|gMJjPq_&B#zW@6an5y`uenV2cQJ!3^( z$&!D3K6^ep_1fg5ZmtJS%InNG`U&uaQqI_DG4$(hEfAM)nVP#4qiaRn>d?bWwg|&oTS|0tl*BF<@J=Lqk-;Es!C5yie4}GuKPIiy`tI^51N#ad$|tg+E*9EYYbEZNnaH z)@w)TF3u878KmQqnC?Q-#SMm9_>%og=0UuKe$7wgjMkhZKZiUfF@}qpS2W+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*)99kq0r4p$^BL+s!AWE{=(2|-w&3~cxKT@w~g1RV5ah| zTa8g#i(v;iY&E_=9Qo;n^rT6ps6e*ag`kFEdt<;lBFy6yet(iOZD%`Mte2GjM$ z1N7n~_u7I3tV)) zio^KqjkVv$?T%`e;i9!BGzbp?Y$e#WT|tXVBmeM@ud|U z<(`OVk*Ldi>LoZ&wVXxp`}B}YO>E{2X`KC)Fg_0dOcvj{!7LS*lcak@GF91&(PpMq njuh)|4b0oE(bnYN5Z`GuCKug5&|xc}%)cxnjs1b%y9)dR^}N)v diff --git a/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.cs deleted file mode 100644 index 4e81b428aad..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; - -public class Foo { - - int _baz; - [NotLinked] int _shebang; - - public Foo () - { - _baz = 42; - } - - public int Baz () - { - return _baz; - } - - [NotLinked] public int Shebang (int bang) - { - return _shebang = bang * 2; - } -} - -public class Bar { - - int _truc; - - public Bar () - { - _truc = 12; - } - - public int Truc () - { - return _truc; - } -} - -[NotLinked] public class Gazonk { -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -public class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/SimpleXml/Library.dll deleted file mode 100644 index c37c059851d1bda16ca3df33d37f2a9cb82fdb98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3584 zcmeHJPfQ$T6#vcc0?Xf6NgL<^h5!koZZ<8ZjcIg&r7g|!CoF%oF)p*a<1%)324`j~ zV6h}NCf>Z6crvl^#GwZh8xs=`9=z0e^rUD!dFkDQ_}zpsO26FEUsC;zV5jdAp!*Sd| zFPgenb9BqmvvYa9>Xyw^XJ^|`6ncIN$Z2uh`RV8ELAE_~4YX@XpqUzZNI%L3oll03 zFr7;*tecXmUsmk!pFd@~MlxNy59aXKXR7$L4h0||> z+6MZX{R>HLF*M-^9oXgIG*SKwx)B@U?luPNAKhk<1V+)F)>J8kXApZwv~AC#d9*tn z$J5NgQmK#k+#GJ-rkrR|)+3QRwi#0*;dm_3EAPHA?Za=lJm7Cd3Q zMXo{&p{<;ap;f@|+C`iTXDG+Yg48$G!j)+h7MXh#7M;v2T$_0o<9zMs6u*yql)q8@ zvC_0?`r%-}%1Pv3l($Yfos>=Gh;+y32I*oY0r-Dve z%OOIQ$D`p+gx_YFuo{tdmT;5-J%J6VhHXUL!DZjn=H z#})E!OtIq^(T`Qd-&6e4h!5f-hA@J}4vx_;#4_6h(s21e1g^}u<(h52gq&6M3~w`4 zwryN>T}&7rt{Gdda|^R>kh7dyW_di|8&RwUCaQkP^=zw%{H7n6Rm>ING)n>M4uztz zg@V6k77eF@R4H&hhTK9v(i8%(R>GpNFhpvh<^)#NOijAgb;~xryy@MxN~VucVFZ@z zESR>jp(MYaD%vP+G!-q|3O4K3s4u8G4%JJ(Q85ouz3xTBtC#^_`M9oTG~T&eO;rkW zyS2}z1{S71Lh_5P*Oq(7_CAO;C+VZ{NhWkHDNIWyG6r3o3ZXUXG*$*CSz-HcPHCssWF2EZ*fNV>);PuCfpD zb^{h^HK_GzHxSUzB?{?5;yxSFSW`eRi~7nFBJC)jH2V&J#!!?Q;5k;L9r|aP-A75q zS#QXr(>Kjepzga&Uyt7PTGG7d>JNBRbkUwvoif}_i^hf{nr!F!+#U^ - - - - - - - - - diff --git a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.cs deleted file mode 100644 index b9c3f02f1ab..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -public class Library { - - public Library () - { - } - - public int Shebang () - { - return Bang (); - } - - protected virtual int Bang () - { - return 1; - } -} - - -public class PowerFulLibrary : Library { - - protected override int Bang () - { - return 0; - } -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -public class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/VirtualCall/Library.dll deleted file mode 100644 index 0f2ff3f93f2bbd0fc0020797009fa42cc4ed0bfb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3072 zcmeHJ-)kII6#izj37fTvi544ajdw|e5M9PZy|7d4 zGA4wY<}W=C_|PvRc>z=Uf7r*S9s_0+upzn){1VR-b0E9GnSpV7Wl90LRCts2J1M&u zxt~O|ZwpC|=>$%!Pxo#y?1c>uYi@QN$I_(5Ci`OOdI1A9*IkYZR-R8vY@nPnwR-f@ zl%jtiwleCqxEE`ky5#eCxqc}KE1tLJw0(4XjUaU0V$<`GAep>{&e;NRlZq7siT!WN zY-WK==ND%)0joZ?m_N4&qZ*2ylvSgyTWwqll2&yOw^FBX?ySz6L$N6}?pBGTMv zz#aB?XwTK6uQ`9uUxhYr)$5A0k6j_$M~wJ88fTfzHV=^6)EXf^05dkTt>An77rhHsl`>q+NL#5 zZ48eTRot4H(UE@`3wxNP{in9>SzT?RkdDl0>mDm4k!OyLjYH6;bz5M24qxCrUSPX~ zXOKM*oU{m2$@0r*jaOL5qPLmXu4AMAq1%X1+wVng2gODdgm^pRo2d6A7u9w>bi#eS zu@*G@p8ICv(A#q}_}C3s`d$*W9z@l)f5UAK=hyb!y5qM{mS*7Ia>AAy^@fh^p3`y% z!wJU`1uJ*=)Ax6tUw-%%ja*jfk1ETWp2%4^ddmcUclEai!OyQ&zkd2#|NQ!c3(55V zrk7p7I}!R8O;IqXfjj9S<)mufh}>)M+2(8~<2N(QRCiFrb+(srmD(zA+I8BiY*);! zi=VQ;|CQh*bES{V!<{*}&IiL4Y8Fu)gv4pXgG)>wA0W^%^Lo}6M;&^59Cr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S5^;gC1bGef%x+>8_{XvINhBIg zpuN|lnJhK#6AZkMHNNx&N4Y0vEfRHM!+8nLy=}D!{(v5Gsfo?hkjB}362`~jpUL7o zH<;zbrIK`yNaj>FVzilQkt4;reg@|4R%vT+Z-g&38k39eAL)HhK$(A8hcxy_`ruCB EU(F)l4*&oF diff --git a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.cs b/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.cs deleted file mode 100755 index 7f14865aad0..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - -namespace Foo { - - [NotLinked] public class BarBar { - } - - public class FooBaz { - - public FooBaz () - { - } - - [NotLinked] public void BarBaz () - { - } - } - - public class TrucBaz { - - public TrucBaz () - { - } - } - - public class BazBaz { - - public BazBaz () - { - } - } -} - -[NotLinked, AttributeUsage (AttributeTargets.All)] -public class NotLinkedAttribute : Attribute { -} diff --git a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.dll b/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Library.dll deleted file mode 100755 index 80e7ef34e813166a7b91d6c5dbbd914c5124ffee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3584 zcmeHJ&rck66#vY!;6g2-(O@}=X*TaI=1?7)R2^~x+zGj~ZD7O9D);9G4)I zBo)_9PS-CK2VB$(^dQ#@4C((4O~lv*KaB&+!smd`lDNbalTF~sF2&yzOn@Dn4?w>qO!7%TwD0 zLo!!_)Rsao-Zy~_9tcB}{{Ti)6O101oQx?mOb+0a$u z^-A{Q)I}+v7as8~7Bv1YaGx|Id?`|{Ukk*xs2RH#gQs#u)U|^xe zzqS}`H9hBb6y1ul)tEVi<7{1u_{=NK$U!}< z2Fi0QDD8!jQ^#`UZKoQc<6u>zK*g!|6DMo6=|^tev1WpL!}T0ha@0+?>V$|DcH{>B zs^i(anhQJ0l0b2zsp5KWwAZmFy>vET3+WH*z8rsb zaXbC<@2$I%0d06A;nJkX(rRsi*kD#0yf)zS``|FAkLw7u{eu2TmT9%A4QaO#(J!DB z!x!n#*^t4SB6_*h*Zw5af%eI=@Az*T6`28EVns&Vzrfu?RCS(4*FGkFvwT-OzU%Z= z^zPJ><^9@Oz^nXd8@iiF`}(ZiJ~bUN!)_b& zknU>OW?j&)e@^FLPV~~b^tI<= diff --git a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Makefile b/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Makefile deleted file mode 100755 index 2e5bf5bcfe8..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../../config.make - -all: - MCS /t:library Library.cs diff --git a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/desc.xml b/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/desc.xml deleted file mode 100755 index c8e1e2383b6..00000000000 --- a/mcs/tools/linker/Tests/TestCases/Linker/XmlPattern/desc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/mcs/tools/linker/Tests/TestCases/config.make b/mcs/tools/linker/Tests/TestCases/config.make deleted file mode 100644 index 8323eb2a8f4..00000000000 --- a/mcs/tools/linker/Tests/TestCases/config.make +++ /dev/null @@ -1,3 +0,0 @@ - -MCS = mcs - diff --git a/mcs/tools/linker/configure b/mcs/tools/linker/configure deleted file mode 100755 index 2598cb698fb..00000000000 --- a/mcs/tools/linker/configure +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -VERSION=0.1 -prefix=/usr/local -while test x$1 != x; do - case $1 in - --prefix=*) - prefix=`echo $1 | sed 's/--prefix=//'` - ;; - --prefix) - echo --prefix needs an argument: --prefix=directory >&2 - ;; - *) - echo Unknown argument $1 >&2 - esac - shift -done - -echo "prefix=$prefix" > config.make -echo "RUNTIME=mono" >> config.make -echo "ASSEMBLY_VERSION=$VERSION.0.0" >> config.make -echo "VERSION=$VERSION" >> config.make - -echo "monolinker has been configure to be installed in $prefix" diff --git a/mcs/tools/linker/monolinker.exe.sources b/mcs/tools/linker/monolinker.exe.sources index 90b8ae0f7de..66410e5fe69 100644 --- a/mcs/tools/linker/monolinker.exe.sources +++ b/mcs/tools/linker/monolinker.exe.sources @@ -1,27 +1,27 @@ -./Mono.Linker/Pipeline.cs -./Mono.Linker/AssemblyInfo.cs -./Mono.Linker/AssemblyResolver.cs -./Mono.Linker/TypePreserve.cs -./Mono.Linker/Annotations.cs -./Mono.Linker/LinkContext.cs -./Mono.Linker/AssemblyAction.cs -./Mono.Linker/Driver.cs -./Mono.Linker/I18nAssemblies.cs -./Mono.Linker/MethodAction.cs -./Mono.Linker/XApiReader.cs -./Mono.Linker/IXApiVisitor.cs -./Mono.Linker.Steps/BaseStep.cs -./Mono.Linker.Steps/LoadReferencesStep.cs -./Mono.Linker.Steps/LoadI18nAssemblies.cs -./Mono.Linker.Steps/ResolveFromXmlStep.cs -./Mono.Linker.Steps/SweepStep.cs -./Mono.Linker.Steps/RegenerateGuidStep.cs -./Mono.Linker.Steps/ResolveFromXApiStep.cs -./Mono.Linker.Steps/ResolveFromAssemblyStep.cs -./Mono.Linker.Steps/ResolveStep.cs -./Mono.Linker.Steps/CleanStep.cs -./Mono.Linker.Steps/MarkStep.cs -./Mono.Linker.Steps/BlacklistStep.cs -./Mono.Linker.Steps/OutputStep.cs -./Mono.Linker.Steps/TypeMapStep.cs -./Mono.Linker.Steps/IStep.cs +../../../external/linker/linker/Mono.Linker/Pipeline.cs +../../../external/linker/linker/Mono.Linker/AssemblyInfo.cs +../../../external/linker/linker/Mono.Linker/AssemblyResolver.cs +../../../external/linker/linker/Mono.Linker/TypePreserve.cs +../../../external/linker/linker/Mono.Linker/Annotations.cs +../../../external/linker/linker/Mono.Linker/LinkContext.cs +../../../external/linker/linker/Mono.Linker/AssemblyAction.cs +../../../external/linker/linker/Mono.Linker/Driver.cs +../../../external/linker/linker/Mono.Linker/I18nAssemblies.cs +../../../external/linker/linker/Mono.Linker/MethodAction.cs +../../../external/linker/linker/Mono.Linker/XApiReader.cs +../../../external/linker/linker/Mono.Linker/IXApiVisitor.cs +../../../external/linker/linker/Mono.Linker.Steps/BaseStep.cs +../../../external/linker/linker/Mono.Linker.Steps/LoadReferencesStep.cs +../../../external/linker/linker/Mono.Linker.Steps/LoadI18nAssemblies.cs +../../../external/linker/linker/Mono.Linker.Steps/ResolveFromXmlStep.cs +../../../external/linker/linker/Mono.Linker.Steps/SweepStep.cs +../../../external/linker/linker/Mono.Linker.Steps/RegenerateGuidStep.cs +../../../external/linker/linker/Mono.Linker.Steps/ResolveFromXApiStep.cs +../../../external/linker/linker/Mono.Linker.Steps/ResolveFromAssemblyStep.cs +../../../external/linker/linker/Mono.Linker.Steps/ResolveStep.cs +../../../external/linker/linker/Mono.Linker.Steps/CleanStep.cs +../../../external/linker/linker/Mono.Linker.Steps/MarkStep.cs +../../../external/linker/linker/Mono.Linker.Steps/BlacklistStep.cs +../../../external/linker/linker/Mono.Linker.Steps/OutputStep.cs +../../../external/linker/linker/Mono.Linker.Steps/TypeMapStep.cs +../../../external/linker/linker/Mono.Linker.Steps/IStep.cs diff --git a/mcs/tools/linker/monolinker.in b/mcs/tools/linker/monolinker.in deleted file mode 100644 index 55e24cbe08d..00000000000 --- a/mcs/tools/linker/monolinker.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -mono $MONO_EXTRA_ARGS @prefix@/lib/mink/mink.exe "$@" diff --git a/mcs/tools/linker/profiler/Makefile b/mcs/tools/linker/profiler/Makefile deleted file mode 100644 index 6a9702bda24..00000000000 --- a/mcs/tools/linker/profiler/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -SRC = link.c -OBJ = libmono-profiler-link.so - -all: - gcc -g -Wall -shared -o $(OBJ) $(SRC) `pkg-config --cflags --libs mono` - -clean: - rm -f $(OBJ) diff --git a/mcs/tools/linker/profiler/link.c b/mcs/tools/linker/profiler/link.c deleted file mode 100644 index f81e251bea6..00000000000 --- a/mcs/tools/linker/profiler/link.c +++ /dev/null @@ -1,362 +0,0 @@ -/* - * link.c: a profiler to help the static linker - * - * Authors: - * Jb Evain (jbevain@novell.com) - * - * (C) 2007 Novell, Inc. http://www.novell.com - * - */ -#include -#include -#include -#include -#include -#include -#include - -struct _MonoProfiler { - const char *output_file; - GHashTable *images; -}; - -typedef struct _LinkedImage { - MonoImage *image; - GHashTable *types; -} LinkedImage; - -typedef struct _LinkedType { - MonoClass *klass; - GHashTable *methods; -} LinkedType; - -typedef struct _LinkedMethod { - MonoMethod *method; -} LinkedMethod; - -static void -link_append_class_name (GString *res, MonoClass *klass, gboolean include_namespace) -{ - if (!klass) { - g_string_append (res, "**unknown**"); - return; - } - - if (mono_class_get_nesting_type (klass)) { - link_append_class_name (res, mono_class_get_nesting_type (klass), include_namespace); - g_string_append_c (res, '/'); - } - - if (include_namespace && *(mono_class_get_namespace (klass))) - g_string_sprintfa (res, "%s.", mono_class_get_namespace (klass)); - - g_string_sprintfa (res, "%s", mono_class_get_name (klass)); -} - -static MonoType * -link_get_element_type (MonoType *type) -{ - return mono_class_get_type (mono_class_get_element_class (mono_class_from_mono_type (type))); -} - -static void -link_type_get_desc (GString *res, MonoType *type, gboolean include_namespace) { - switch (mono_type_get_type (type)) { - case MONO_TYPE_VOID: - g_string_append (res, "System.Void"); break; - case MONO_TYPE_CHAR: - g_string_append (res, "System.Char"); break; - case MONO_TYPE_BOOLEAN: - g_string_append (res, "System.Boolean"); break; - case MONO_TYPE_U1: - g_string_append (res, "System.Byte"); break; - case MONO_TYPE_I1: - g_string_append (res, "System.SByte"); break; - case MONO_TYPE_U2: - g_string_append (res, "System.UInt16"); break; - case MONO_TYPE_I2: - g_string_append (res, "System.Int16"); break; - case MONO_TYPE_U4: - g_string_append (res, "System.UInt32"); break; - case MONO_TYPE_I4: - g_string_append (res, "System.Int32"); break; - case MONO_TYPE_U8: - g_string_append (res, "System.UInt64"); break; - case MONO_TYPE_I8: - g_string_append (res, "System.Int64"); break; - case MONO_TYPE_FNPTR: - g_string_append (res, "*()"); break; - case MONO_TYPE_U: - g_string_append (res, "System.UIntPtr"); break; - case MONO_TYPE_I: - g_string_append (res, "System.IntPtr"); break; - case MONO_TYPE_R4: - g_string_append (res, "System.Single"); break; - case MONO_TYPE_R8: - g_string_append (res, "System.Double"); break; - case MONO_TYPE_STRING: - g_string_append (res, "System.String"); break; - case MONO_TYPE_OBJECT: - g_string_append (res, "System.Object"); break; - case MONO_TYPE_PTR: - link_type_get_desc (res, mono_type_get_ptr_type (type), include_namespace); - g_string_append_c (res, '*'); - break; - case MONO_TYPE_ARRAY: { - MonoClass *eklass = mono_class_get_element_class (mono_class_from_mono_type (type)); - link_type_get_desc (res, mono_class_get_type (eklass), include_namespace); - g_string_sprintfa (res, "[%d]", mono_class_get_rank (eklass)); - break; - } - case MONO_TYPE_SZARRAY: - link_type_get_desc (res, link_get_element_type (type), include_namespace); - g_string_append (res, "[]"); - break; - case MONO_TYPE_CLASS: - case MONO_TYPE_VALUETYPE: - link_append_class_name (res, mono_type_get_class (type), include_namespace); - break; - case MONO_TYPE_GENERICINST: - //link_type_get_desc (res, &type->data.generic_class->container_class->byval_arg, include_namespace); /* ? */ - break; - case MONO_TYPE_VAR: - case MONO_TYPE_MVAR: - //g_string_append (res, type->data.generic_param->name); /* ? */ - break; - default: - break; - } - if (mono_type_is_byref (type)) - g_string_append (res, "&"); -} - -static char * -link_type_full_name (MonoType *type) -{ - GString *str; - char *res; - - str = g_string_new (""); - link_type_get_desc (str, type, TRUE); - - res = g_strdup (str->str); - g_string_free (str, TRUE); - return res; -} - -static char * -link_class_full_name (MonoClass *klass) -{ - return link_type_full_name (mono_class_get_type (klass)); -} - -static char * -link_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace) -{ - int i; - char *result; - GString *res = g_string_new (""); - - for (i = 0; i < sig->param_count; ++i) { - if (i > 0) - g_string_append_c (res, ','); - link_type_get_desc (res, sig->params [i], include_namespace); - } - result = res->str; - g_string_free (res, FALSE); - return result; -} - -static char * -link_method_signature (MonoMethod *method) -{ - MonoMethodSignature *sig; - char *res; - - sig = mono_method_signature (method); - char *tmpsig = link_signature_get_desc (sig, TRUE); - res = g_strdup_printf ("%s %s(%s)", - link_type_full_name (mono_signature_get_return_type (sig)), - mono_method_get_name (method), tmpsig); - g_free (tmpsig); - - return res; -} - -static char * -link_image_fullname (MonoImage *image) -{ - MonoAssemblyName *name; - char *res; - - name = g_new0 (MonoAssemblyName, 1); - mono_assembly_fill_assembly_name (image, name); - res = mono_stringify_assembly_name (name); - g_free (name); - return res; -} - -static LinkedType * -link_get_linked_type (LinkedImage *limage, MonoClass *klass) -{ - LinkedType *ltype; - - ltype = (LinkedType *) g_hash_table_lookup (limage->types, klass); - - if (ltype) - return ltype; - - ltype = g_new0 (LinkedType, 1); - ltype->klass = klass; - ltype->methods = g_hash_table_new (NULL, NULL); - g_hash_table_insert (limage->types, klass, ltype); - return ltype; -} - -static LinkedImage * -link_get_linked_image (MonoProfiler *prof, MonoImage *image) -{ - LinkedImage *limage; - - limage = (LinkedImage *) g_hash_table_lookup (prof->images, image); - - if (limage) - return limage; - - limage = g_new0 (LinkedImage, 1); - limage->image = image; - limage->types = g_hash_table_new (NULL, NULL); - g_hash_table_insert (prof->images, image, limage); - return limage; -} - -static void -link_method_leave (MonoProfiler *prof, MonoMethod *method) -{ - MonoClass *klass; - MonoImage *image; - - LinkedType *ltype; - LinkedImage *limage; - LinkedMethod *lmethod; - - klass = mono_method_get_class (method); - image = mono_class_get_image (klass); - - limage = link_get_linked_image (prof, image); - ltype = link_get_linked_type (limage, klass); - - lmethod = (LinkedMethod *) g_hash_table_lookup (ltype->methods, method); - if (lmethod) - return; - - lmethod = g_new0 (LinkedMethod, 1); - lmethod->method = method; - g_hash_table_insert (ltype->methods, method, lmethod); -} - -static void -link_free_member (gpointer key, gpointer value, gpointer data) -{ - g_free (value); -} - -static void -link_free_type (gpointer key, gpointer value, gpointer data) -{ - LinkedType *type = (LinkedType *) value; - - g_hash_table_foreach (type->methods, link_free_member, NULL); - g_free (type); -} - -static void -link_free_image (gpointer key, gpointer value, gpointer data) -{ - LinkedImage *image = (LinkedImage *) value; - - g_hash_table_foreach (image->types, link_free_type, NULL); - g_free (image); -} - -static void -link_print_method (gpointer key, gpointer value, gpointer data) -{ - LinkedMethod *lmethod = (LinkedMethod *) value; - FILE *output = (FILE *) data; - char *signature; - - signature = link_method_signature (lmethod->method); - fprintf (output, "\t\t\t\n", signature); - g_free (signature); -} - -static void -link_print_type (gpointer key, gpointer value, gpointer data) -{ - LinkedType *ltype = (LinkedType *) value; - FILE *output = (FILE *) data; - char *fullname; - - fullname = link_class_full_name (ltype->klass); - fprintf (output, "\t\t\n", fullname); - g_free (fullname); - - g_hash_table_foreach (ltype->methods, link_print_method, output); - fprintf (output, "\t\t\n"); -} - -static void -link_print_image (gpointer key, gpointer value, gpointer data) -{ - LinkedImage *limage = (LinkedImage *) value; - FILE *output = (FILE *) data; - char *fullname; - - fullname = link_image_fullname (limage->image); - fprintf (output, "\t\n", fullname); - g_free (fullname); - g_hash_table_foreach (limage->types, link_print_type, output); - fprintf (output, "\t\n"); -} - -static void -link_print_tree (MonoProfiler *prof) -{ - FILE *output; - - output = fopen (prof->output_file, "w"); - fprintf (output, "\n"); - g_hash_table_foreach (prof->images, link_print_image, output); - fprintf (output, "\n"); - fclose (output); -} - -static void -link_shutdown (MonoProfiler *prof) -{ - link_print_tree (prof); - g_hash_table_foreach (prof->images, link_free_image, NULL); - g_free (prof); -} - -void -mono_profiler_startup (const char *desc) -{ - MonoProfiler *prof; - - prof = g_new0 (MonoProfiler, 1); - - if (strncmp ("link:", desc, 5) == 0 && desc [5]) - prof->output_file = g_strdup (desc + 5); - else - prof->output_file = "link.xml"; - - prof->images = g_hash_table_new (NULL, NULL); - - mono_profiler_install (prof, link_shutdown); - - mono_profiler_install_enter_leave (NULL, link_method_leave); - - mono_profiler_set_events (MONO_PROFILE_ENTER_LEAVE); -} diff --git a/mcs/tools/linker/standalone.make b/mcs/tools/linker/standalone.make deleted file mode 100644 index f444215ada0..00000000000 --- a/mcs/tools/linker/standalone.make +++ /dev/null @@ -1,44 +0,0 @@ - -MCS = mcs -KEY_FILE = ../../class/mono.snk -MONO.CECIL.DLL = Mono.Cecil.dll -MCS_FLAGS = -debug -keyfile:$(KEY_FILE) -r:$(MONO.CECIL.DLL) -resource:Descriptors/mscorlib.xml -resource:Descriptors/System.xml -resource:Descriptors/System.Web.xml -resource:Descriptors/Mono.Posix.xml -resource:Descriptors/System.Drawing.xml -LINKER = monolinker.exe - -all: config.make monolinker.exe monolinker - -monolinker: monolinker.in Makefile - sed "s,@prefix@,$(prefix)," < monolinker.in > monolinker - chmod +x monolinker - -monolinker.exe: Mono.Cecil.dll - $(MCS) $(MCS_FLAGS) @$(LINKER).sources /out:$(LINKER) - -Mono.Cecil.dll: - if pkg-config --atleast-version=0.5 mono-cecil; then \ - cp `pkg-config --variable=Libraries mono-cecil` .; \ - else \ - echo You must install Mono.Cecil first; \ - exit 1; \ - fi - -clean: - rm -f $(LINKER) $(MONO.CECIL.DLL) monolinker - -install: all - mkdir -p $(prefix)/bin - mkdir -p $(prefix)/lib/monolinker - cp $(LINKER) $(MONO.CECIL.DLL) $(prefix)/lib/monolinker - cp monolinker $(prefix)/bin - cp man/monolinker.1 $(prefix)/share/man/man1 - -config.make: - echo You must run configure first - exit 1 - -include config.make - -run-test: all - cd ./Tests; \ - make clean run-test; \ - cd ..; diff --git a/mcs/tools/tuner/Makefile b/mcs/tools/tuner/Makefile deleted file mode 100644 index c364223deb0..00000000000 --- a/mcs/tools/tuner/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -thisdir = tools/tuner -SUBDIRS = -DEP_DIRS = linker -include ../../build/rules.make - -LOCAL_MCS_FLAGS = -r:$(topdir)/class/lib/$(PROFILE)/monolinker.exe -LIB_REFS = System System.Core System.Xml Mono.Cecil - -LIBRARY = Mono.Tuner.dll - -NO_INSTALL = yes -NO_TEST = yes -NO_SIGN_ASSEMBLY = yes - -include ../../build/library.make diff --git a/mcs/tools/tuner/Mono.Tuner-net_4_x.csproj b/mcs/tools/tuner/Mono.Tuner-net_4_x.csproj deleted file mode 100644 index a681051bdee..00000000000 --- a/mcs/tools/tuner/Mono.Tuner-net_4_x.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8CCE7044-3466-4599-B09E-9F8E0C2F4614} - Library - 1699 - ./../../class/lib/net_4_x - obj-net_4_x - false - True - - True - - Properties - - - Mono.Tuner - v4.5 - 512 - - - - true - full - 1699 - false - TRACE;NET_4_0;NET_4_5;NET_4_6;MONO - prompt - 4 - - - pdbonly - 1699 - true - NET_4_0;NET_4_5;NET_4_6;MONO - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {FA920637-C202-4E75-AC0F-1A8DBD631DF1} - monolinker-net_4_x - - - {2CA6026B-2DC8-4C4C-A12C-1E8234049DB7} - corlib-net_4_x - - - {2762E921-91A8-4C87-91E9-BA628013F753} - System-net_4_x - - - {359142A1-D80F-401E-AA64-7167C9317649} - System.Core-net_4_x - - - {87FD2F0F-5222-4AE6-BD63-2D4975E11E5B} - System.Xml-net_4_x - - - False - ./../../class/lib/net_4_x/Mono.Cecil.dll - False - - - - - - - diff --git a/mcs/tools/tuner/Mono.Tuner.csproj b/mcs/tools/tuner/Mono.Tuner.csproj deleted file mode 100644 index fd5e22d8b12..00000000000 --- a/mcs/tools/tuner/Mono.Tuner.csproj +++ /dev/null @@ -1,71 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {E97429BA-279A-4C1D-AE8A-8BD878C661D1} - Library - Properties - Mono.Tuner - Mono.Tuner - - - True - full - False - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - True - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - {DD28E2B1-057B-4B4D-A04D-B2EBD9E76E46} - Mono.Linker - - - {D68133BD-1E63-496E-9EDE-4FBDBF77B486} - Mono.Cecil - - - \ No newline at end of file diff --git a/mcs/tools/tuner/Mono.Tuner.dll.sources b/mcs/tools/tuner/Mono.Tuner.dll.sources deleted file mode 100644 index cca968b41f9..00000000000 --- a/mcs/tools/tuner/Mono.Tuner.dll.sources +++ /dev/null @@ -1,13 +0,0 @@ -Mono.Tuner/TunerAnnotations.cs -Mono.Tuner/PrintStatus.cs -Mono.Tuner/RemoveSerialization.cs -Mono.Tuner/AdjustVisibility.cs -Mono.Tuner/CheckVisibility.cs -Mono.Tuner/InjectSecurityAttributes.cs -Mono.Tuner/MoonlightA11yApiMarker.cs -Mono.Tuner/MoonlightA11yAssemblyStep.cs -Mono.Tuner/MoonlightA11yDescriptorGenerator.cs -Mono.Tuner/MoonlightA11yProcessor.cs -Mono.Tuner/MoonlightA11yUsageInspectionStep.cs -Mono.Tuner/MoonlightAssemblyStep.cs -Mono.Tuner/FilterAttributes.cs diff --git a/mcs/tools/tuner/Mono.Tuner/AdjustVisibility.cs b/mcs/tools/tuner/Mono.Tuner/AdjustVisibility.cs deleted file mode 100644 index 6b684b60667..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/AdjustVisibility.cs +++ /dev/null @@ -1,164 +0,0 @@ -// -// AdjustVisibilityStep.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class AdjustVisibility : BaseStep { - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - ProcessTypes (assembly.MainModule.Types); - } - - void ProcessTypes (ICollection types) - { - foreach (TypeDefinition type in types) - ProcessType (type); - } - - void ProcessType (TypeDefinition type) - { - if (!IsPublic (type)) - return; - - if (!IsMarkedAsPublic (type)) { - SetInternalVisibility (type); - return; - } - - if (type.IsEnum) - return; - - ProcessFields (type.Fields); - ProcessMethods (type.Methods); - } - - static bool IsPublic (TypeDefinition type) - { - return type.DeclaringType == null ? type.IsPublic : type.IsNestedPublic; - } - - void SetInternalVisibility (TypeDefinition type) - { - type.Attributes &= ~TypeAttributes.VisibilityMask; - if (type.DeclaringType == null) - type.Attributes |= TypeAttributes.NotPublic; - else - type.Attributes |= TypeAttributes.NestedAssembly; - - MarkInternalized (type); - } - - void ProcessMethods (ICollection methods) - { - foreach (MethodDefinition method in methods) - ProcessMethod (method); - } - - void ProcessMethod (MethodDefinition method) - { - if (IsMarkedAsPublic (method)) - return; - - if (method.IsPublic) - SetInternalVisibility (method); - else if (method.IsFamily || method.IsFamilyOrAssembly) - SetProtectedAndInternalVisibility (method); - } - - void SetInternalVisibility (MethodDefinition method) - { - method.Attributes &= ~MethodAttributes.MemberAccessMask; - method.Attributes |= MethodAttributes.Assembly; - - MarkInternalized (method); - } - - void SetProtectedAndInternalVisibility (MethodDefinition method) - { - method.Attributes &= ~MethodAttributes.MemberAccessMask; - method.Attributes |= MethodAttributes.FamANDAssem; - - MarkInternalized (method); - } - - bool IsMarkedAsPublic (IMetadataTokenProvider provider) - { - return Annotations.IsPublic (provider); - } - - void ProcessFields (IEnumerable fields) - { - foreach (FieldDefinition field in fields) - ProcessField (field); - } - - void ProcessField (FieldDefinition field) - { - if (IsMarkedAsPublic (field)) - return; - - if (field.IsPublic) - SetInternalVisibility (field); - else if (field.IsFamily || field.IsFamilyOrAssembly) - SetProtectedAndInternalVisibility (field); - } - - void SetInternalVisibility (FieldDefinition field) - { - field.Attributes &= ~FieldAttributes.FieldAccessMask; - field.Attributes |= FieldAttributes.Assembly; - - MarkInternalized (field); - } - - void SetProtectedAndInternalVisibility (FieldDefinition field) - { - field.Attributes &= ~FieldAttributes.FieldAccessMask; - field.Attributes |= FieldAttributes.FamANDAssem; - - MarkInternalized (field); - } - - void MarkInternalized (IMetadataTokenProvider provider) - { - TunerAnnotations.Internalized (Context, provider); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs b/mcs/tools/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs deleted file mode 100644 index 6a910a9d97f..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs +++ /dev/null @@ -1,164 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public abstract class ApplyPreserveAttributeBase : BaseSubStep { - - // set 'removeAttribute' to true if you want the preserved attribute to be removed from the final assembly - protected abstract bool IsPreservedAttribute (ICustomAttributeProvider provider, CustomAttribute attribute, out bool removeAttribute); - - public override SubStepTargets Targets { - get { - return SubStepTargets.Type - | SubStepTargets.Field - | SubStepTargets.Method - | SubStepTargets.Property - | SubStepTargets.Event; - } - } - - public override bool IsActiveFor (AssemblyDefinition assembly) - { - return !Profile.IsSdkAssembly (assembly) && Annotations.GetAction (assembly) == AssemblyAction.Link; - } - - public override void ProcessType (TypeDefinition type) - { - TryApplyPreserveAttribute (type); - } - - public override void ProcessField (FieldDefinition field) - { - foreach (var attribute in GetPreserveAttributes (field)) - Mark (field, attribute); - } - - public override void ProcessMethod (MethodDefinition method) - { - MarkMethodIfPreserved (method); - } - - public override void ProcessProperty (PropertyDefinition property) - { - foreach (var attribute in GetPreserveAttributes (property)) { - MarkMethod (property.GetMethod, attribute); - MarkMethod (property.SetMethod, attribute); - } - } - - public override void ProcessEvent (EventDefinition @event) - { - foreach (var attribute in GetPreserveAttributes (@event)) { - MarkMethod (@event.AddMethod, attribute); - MarkMethod (@event.InvokeMethod, attribute); - MarkMethod (@event.RemoveMethod, attribute); - } - } - - void MarkMethodIfPreserved (MethodDefinition method) - { - foreach (var attribute in GetPreserveAttributes (method)) - MarkMethod (method, attribute); - } - - void MarkMethod (MethodDefinition method, CustomAttribute preserve_attribute) - { - if (method == null) - return; - - Mark (method, preserve_attribute); - Annotations.SetAction (method, MethodAction.Parse); - } - - void Mark (IMetadataTokenProvider provider, CustomAttribute preserve_attribute) - { - if (IsConditionalAttribute (preserve_attribute)) { - PreserveConditional (provider); - return; - } - - PreserveUnconditional (provider); - } - - void PreserveConditional (IMetadataTokenProvider provider) - { - var method = provider as MethodDefinition; - if (method == null) { - // workaround to support (uncommon but valid) conditional fields form [Preserve] - PreserveUnconditional (provider); - return; - } - - Annotations.AddPreservedMethod (method.DeclaringType, method); - } - - static bool IsConditionalAttribute (CustomAttribute attribute) - { - if (attribute == null) - return false; - - foreach (var named_argument in attribute.Fields) - if (named_argument.Name == "Conditional") - return (bool) named_argument.Argument.Value; - - return false; - } - - void PreserveUnconditional (IMetadataTokenProvider provider) - { - Annotations.Mark (provider); - - var member = provider as IMemberDefinition; - if (member == null || member.DeclaringType == null) - return; - - Mark (member.DeclaringType, null); - } - - void TryApplyPreserveAttribute (TypeDefinition type) - { - foreach (var attribute in GetPreserveAttributes (type)) { - Annotations.Mark (type); - - if (!attribute.HasFields) - continue; - - foreach (var named_argument in attribute.Fields) - if (named_argument.Name == "AllMembers" && (bool)named_argument.Argument.Value) - Annotations.SetPreserve (type, TypePreserve.All); - } - } - - List GetPreserveAttributes (ICustomAttributeProvider provider) - { - List attrs = new List (); - - if (!provider.HasCustomAttributes) - return attrs; - - var attributes = provider.CustomAttributes; - - for (int i = attributes.Count - 1; i >= 0; i--) { - var attribute = attributes [i]; - - bool remote_attribute; - if (!IsPreservedAttribute (provider, attribute, out remote_attribute)) - continue; - - attrs.Add (attribute); - if (remote_attribute) - attributes.RemoveAt (i); - } - - return attrs; - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/CecilRocks.cs b/mcs/tools/tuner/Mono.Tuner/CecilRocks.cs deleted file mode 100644 index 69958598dda..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/CecilRocks.cs +++ /dev/null @@ -1,519 +0,0 @@ -// -// MethodBodyRocks.cs -// -// Author: -// Jb Evain (jbevain@gmail.com) -// -// Copyright (c) 2008 - 2011 Jb Evain -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections.Generic; -using System.Linq; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Tuner { - - public static class MethodBodyRocks { - - public static IEnumerable GetAllTypes (this ModuleDefinition self) - { - return self.Types.SelectMany (t => t.GetAllTypes ()); - } - - static IEnumerable GetAllTypes (this TypeDefinition self) - { - yield return self; - - if (!self.HasNestedTypes) - yield break; - - foreach (var type in self.NestedTypes.SelectMany (t => t.GetAllTypes ())) - yield return type; - } - - public static IEnumerable GetMethods (this TypeDefinition self) - { - return self.Methods.Where (m => !m.IsConstructor); - } - - public static IEnumerable GetConstructors (this TypeDefinition self) - { - return self.Methods.Where (m => m.IsConstructor); - } - - public static MethodDefinition GetTypeConstructor (this TypeDefinition self) - { - return self.GetConstructors ().FirstOrDefault (c => c.IsStatic); - } - - public static void SimplifyMacros (this MethodBody self) - { - if (self == null) - throw new ArgumentNullException ("self"); - - foreach (var instruction in self.Instructions) { - if (instruction.OpCode.OpCodeType != OpCodeType.Macro) - continue; - - switch (instruction.OpCode.Code) { - case Code.Ldarg_0: - ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (0)); - break; - case Code.Ldarg_1: - ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (1)); - break; - case Code.Ldarg_2: - ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (2)); - break; - case Code.Ldarg_3: - ExpandMacro (instruction, OpCodes.Ldarg, self.GetParameter (3)); - break; - case Code.Ldloc_0: - ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [0]); - break; - case Code.Ldloc_1: - ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [1]); - break; - case Code.Ldloc_2: - ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [2]); - break; - case Code.Ldloc_3: - ExpandMacro (instruction, OpCodes.Ldloc, self.Variables [3]); - break; - case Code.Stloc_0: - ExpandMacro (instruction, OpCodes.Stloc, self.Variables [0]); - break; - case Code.Stloc_1: - ExpandMacro (instruction, OpCodes.Stloc, self.Variables [1]); - break; - case Code.Stloc_2: - ExpandMacro (instruction, OpCodes.Stloc, self.Variables [2]); - break; - case Code.Stloc_3: - ExpandMacro (instruction, OpCodes.Stloc, self.Variables [3]); - break; - case Code.Ldarg_S: - instruction.OpCode = OpCodes.Ldarg; - break; - case Code.Ldarga_S: - instruction.OpCode = OpCodes.Ldarga; - break; - case Code.Starg_S: - instruction.OpCode = OpCodes.Starg; - break; - case Code.Ldloc_S: - instruction.OpCode = OpCodes.Ldloc; - break; - case Code.Ldloca_S: - instruction.OpCode = OpCodes.Ldloca; - break; - case Code.Stloc_S: - instruction.OpCode = OpCodes.Stloc; - break; - case Code.Ldc_I4_M1: - ExpandMacro (instruction, OpCodes.Ldc_I4, -1); - break; - case Code.Ldc_I4_0: - ExpandMacro (instruction, OpCodes.Ldc_I4, 0); - break; - case Code.Ldc_I4_1: - ExpandMacro (instruction, OpCodes.Ldc_I4, 1); - break; - case Code.Ldc_I4_2: - ExpandMacro (instruction, OpCodes.Ldc_I4, 2); - break; - case Code.Ldc_I4_3: - ExpandMacro (instruction, OpCodes.Ldc_I4, 3); - break; - case Code.Ldc_I4_4: - ExpandMacro (instruction, OpCodes.Ldc_I4, 4); - break; - case Code.Ldc_I4_5: - ExpandMacro (instruction, OpCodes.Ldc_I4, 5); - break; - case Code.Ldc_I4_6: - ExpandMacro (instruction, OpCodes.Ldc_I4, 6); - break; - case Code.Ldc_I4_7: - ExpandMacro (instruction, OpCodes.Ldc_I4, 7); - break; - case Code.Ldc_I4_8: - ExpandMacro (instruction, OpCodes.Ldc_I4, 8); - break; - case Code.Ldc_I4_S: - ExpandMacro (instruction, OpCodes.Ldc_I4, (int) (sbyte) instruction.Operand); - break; - case Code.Br_S: - instruction.OpCode = OpCodes.Br; - break; - case Code.Brfalse_S: - instruction.OpCode = OpCodes.Brfalse; - break; - case Code.Brtrue_S: - instruction.OpCode = OpCodes.Brtrue; - break; - case Code.Beq_S: - instruction.OpCode = OpCodes.Beq; - break; - case Code.Bge_S: - instruction.OpCode = OpCodes.Bge; - break; - case Code.Bgt_S: - instruction.OpCode = OpCodes.Bgt; - break; - case Code.Ble_S: - instruction.OpCode = OpCodes.Ble; - break; - case Code.Blt_S: - instruction.OpCode = OpCodes.Blt; - break; - case Code.Bne_Un_S: - instruction.OpCode = OpCodes.Bne_Un; - break; - case Code.Bge_Un_S: - instruction.OpCode = OpCodes.Bge_Un; - break; - case Code.Bgt_Un_S: - instruction.OpCode = OpCodes.Bgt_Un; - break; - case Code.Ble_Un_S: - instruction.OpCode = OpCodes.Ble_Un; - break; - case Code.Blt_Un_S: - instruction.OpCode = OpCodes.Blt_Un; - break; - case Code.Leave_S: - instruction.OpCode = OpCodes.Leave; - break; - } - } - } - - static void ExpandMacro (Instruction instruction, OpCode opcode, object operand) - { - instruction.OpCode = opcode; - instruction.Operand = operand; - } - - static void MakeMacro (Instruction instruction, OpCode opcode) - { - instruction.OpCode = opcode; - instruction.Operand = null; - } - - public static void OptimizeMacros (this MethodBody self) - { - if (self == null) - throw new ArgumentNullException ("self"); - - var method = self.Method; - - foreach (var instruction in self.Instructions) { - int index; - switch (instruction.OpCode.Code) { - case Code.Ldarg: - index = ((ParameterDefinition) instruction.Operand).Index; - if (index == -1 && instruction.Operand == self.ThisParameter) - index = 0; - else if (method.HasThis) - index++; - - switch (index) { - case 0: - MakeMacro (instruction, OpCodes.Ldarg_0); - break; - case 1: - MakeMacro (instruction, OpCodes.Ldarg_1); - break; - case 2: - MakeMacro (instruction, OpCodes.Ldarg_2); - break; - case 3: - MakeMacro (instruction, OpCodes.Ldarg_3); - break; - default: - if (index < 256) - ExpandMacro (instruction, OpCodes.Ldarg_S, instruction.Operand); - break; - } - break; - case Code.Ldloc: - index = ((VariableDefinition) instruction.Operand).Index; - switch (index) { - case 0: - MakeMacro (instruction, OpCodes.Ldloc_0); - break; - case 1: - MakeMacro (instruction, OpCodes.Ldloc_1); - break; - case 2: - MakeMacro (instruction, OpCodes.Ldloc_2); - break; - case 3: - MakeMacro (instruction, OpCodes.Ldloc_3); - break; - default: - if (index < 256) - ExpandMacro (instruction, OpCodes.Ldloc_S, instruction.Operand); - break; - } - break; - case Code.Stloc: - index = ((VariableDefinition) instruction.Operand).Index; - switch (index) { - case 0: - MakeMacro (instruction, OpCodes.Stloc_0); - break; - case 1: - MakeMacro (instruction, OpCodes.Stloc_1); - break; - case 2: - MakeMacro (instruction, OpCodes.Stloc_2); - break; - case 3: - MakeMacro (instruction, OpCodes.Stloc_3); - break; - default: - if (index < 256) - ExpandMacro (instruction, OpCodes.Stloc_S, instruction.Operand); - break; - } - break; - case Code.Ldarga: - index = ((ParameterDefinition) instruction.Operand).Index; - if (index == -1 && instruction.Operand == self.ThisParameter) - index = 0; - else if (method.HasThis) - index++; - if (index < 256) - ExpandMacro (instruction, OpCodes.Ldarga_S, instruction.Operand); - break; - case Code.Ldloca: - if (((VariableDefinition) instruction.Operand).Index < 256) - ExpandMacro (instruction, OpCodes.Ldloca_S, instruction.Operand); - break; - case Code.Ldc_I4: - int i = (int) instruction.Operand; - switch (i) { - case -1: - MakeMacro (instruction, OpCodes.Ldc_I4_M1); - break; - case 0: - MakeMacro (instruction, OpCodes.Ldc_I4_0); - break; - case 1: - MakeMacro (instruction, OpCodes.Ldc_I4_1); - break; - case 2: - MakeMacro (instruction, OpCodes.Ldc_I4_2); - break; - case 3: - MakeMacro (instruction, OpCodes.Ldc_I4_3); - break; - case 4: - MakeMacro (instruction, OpCodes.Ldc_I4_4); - break; - case 5: - MakeMacro (instruction, OpCodes.Ldc_I4_5); - break; - case 6: - MakeMacro (instruction, OpCodes.Ldc_I4_6); - break; - case 7: - MakeMacro (instruction, OpCodes.Ldc_I4_7); - break; - case 8: - MakeMacro (instruction, OpCodes.Ldc_I4_8); - break; - default: - if (i >= -128 && i < 128) - ExpandMacro (instruction, OpCodes.Ldc_I4_S, (sbyte) i); - break; - } - break; - } - } - - OptimizeBranches (self); - } - - static void OptimizeBranches (MethodBody body) - { - ComputeOffsets (body); - - foreach (var instruction in body.Instructions) { - if (instruction.OpCode.OperandType != OperandType.InlineBrTarget) - continue; - - if (OptimizeBranch (instruction)) - ComputeOffsets (body); - } - } - - static bool OptimizeBranch (Instruction instruction) - { - var offset = ((Instruction) instruction.Operand).Offset - (instruction.Offset + instruction.OpCode.Size + 4); - if (!(offset >= -128 && offset <= 127)) - return false; - - switch (instruction.OpCode.Code) { - case Code.Br: - instruction.OpCode = OpCodes.Br_S; - break; - case Code.Brfalse: - instruction.OpCode = OpCodes.Brfalse_S; - break; - case Code.Brtrue: - instruction.OpCode = OpCodes.Brtrue_S; - break; - case Code.Beq: - instruction.OpCode = OpCodes.Beq_S; - break; - case Code.Bge: - instruction.OpCode = OpCodes.Bge_S; - break; - case Code.Bgt: - instruction.OpCode = OpCodes.Bgt_S; - break; - case Code.Ble: - instruction.OpCode = OpCodes.Ble_S; - break; - case Code.Blt: - instruction.OpCode = OpCodes.Blt_S; - break; - case Code.Bne_Un: - instruction.OpCode = OpCodes.Bne_Un_S; - break; - case Code.Bge_Un: - instruction.OpCode = OpCodes.Bge_Un_S; - break; - case Code.Bgt_Un: - instruction.OpCode = OpCodes.Bgt_Un_S; - break; - case Code.Ble_Un: - instruction.OpCode = OpCodes.Ble_Un_S; - break; - case Code.Blt_Un: - instruction.OpCode = OpCodes.Blt_Un_S; - break; - case Code.Leave: - instruction.OpCode = OpCodes.Leave_S; - break; - } - - return true; - } - - static void ComputeOffsets (MethodBody body) - { - var offset = 0; - foreach (var instruction in body.Instructions) { - instruction.Offset = offset; - offset += instruction.GetSize (); - } - } - - public static ParameterDefinition GetParameter (this MethodBody self, int index) - { - var method = self.Method; - - if (method.HasThis) { - if (index == 0) - return self.ThisParameter; - - index--; - } - - var parameters = method.Parameters; - - if (index < 0 || index >= parameters.Count) - return null; - - return parameters [index]; - } - - public static bool Implements (this TypeReference self, string interfaceName) - { - if (interfaceName == null) - throw new ArgumentNullException ("interfaceName"); - if (self == null) - return false; - - TypeDefinition type = self.Resolve (); - if (type == null) - return false; // not enough information available - - // special case, check if we implement ourselves - if (type.IsInterface && (type.FullName == interfaceName)) - return true; - - return Implements (type, interfaceName, (interfaceName.IndexOf ('`') >= 0)); - } - - public static bool Implements (TypeDefinition type, string interfaceName, bool generic) - { - while (type != null) { - // does the type implements it itself - if (type.HasInterfaces) { - foreach (var iface in type.Interfaces) { - string fullname = (generic) ? iface.InterfaceType.GetElementType ().FullName : iface.InterfaceType.FullName; - if (fullname == interfaceName) - return true; - //if not, then maybe one of its parent interfaces does - if (Implements (iface.InterfaceType.Resolve (), interfaceName, generic)) - return true; - } - } - - type = type.BaseType != null ? type.BaseType.Resolve () : null; - } - return false; - } - - public static bool Inherits (this TypeReference self, string @namespace, string name) - { - if (@namespace == null) - throw new ArgumentNullException ("namespace"); - if (name == null) - throw new ArgumentNullException ("name"); - if (self == null) - return false; - - TypeReference current = self.Resolve (); - while (current != null) { - if (current.Is (@namespace, name)) - return true; - if (current.Is ("System", "Object")) - return false; - - TypeDefinition td = current.Resolve (); - if (td == null) - return false; // could not resolve type - current = td.BaseType; - } - return false; - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/CheckVisibility.cs b/mcs/tools/tuner/Mono.Tuner/CheckVisibility.cs deleted file mode 100644 index df553db5abe..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/CheckVisibility.cs +++ /dev/null @@ -1,375 +0,0 @@ -// -// CheckVisibility.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Text; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Tuner { - - public class CheckVisibility : BaseStep { - - bool throw_on_error; - - protected override void Process () - { - throw_on_error = GetThrowOnVisibilityErrorParameter (); - } - - bool GetThrowOnVisibilityErrorParameter () - { - try { - return bool.Parse (Context.GetParameter ("throw_on_visibility_error")); - } catch { - return false; - } - } - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (assembly.Name.Name == "mscorlib" || assembly.Name.Name == "smcs") - return; - - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - Report ("in assembly {0}", assembly.Name); - - foreach (ModuleDefinition module in assembly.Modules) - foreach (TypeDefinition type in module.Types) - CheckType (type); - } - - void CheckType (TypeDefinition type) - { - if (!IsVisibleFrom (type, type.BaseType)) { - ReportError ("Base type `{0}` of type `{1}` is not visible", - type.BaseType, type); - } - - CheckInterfaces (type); - - CheckFields (type); - CheckMethods (type); - } - - void CheckInterfaces (TypeDefinition type) - { - foreach (var iface in type.Interfaces) { - if (!IsVisibleFrom (type, iface.InterfaceType)) { - ReportError ("Interface `{0}` implemented by `{1}` is not visible", - iface, type); - } - } - } - - static bool IsPublic (TypeDefinition type) - { - return (type.DeclaringType == null && type.IsPublic) || type.IsNestedPublic; - } - - static bool AreInDifferentAssemblies (TypeDefinition type, TypeDefinition target) - { - if (type.Module.Assembly.Name.FullName == target.Module.Assembly.Name.FullName) - return false; - - return !IsInternalVisibleTo (target.Module.Assembly, type.Module.Assembly); - } - - static bool IsInternalVisibleTo (AssemblyDefinition assembly, AssemblyDefinition candidate) - { - foreach (CustomAttribute attribute in assembly.CustomAttributes) { - if (!IsInternalsVisibleToAttribute (attribute)) - continue; - - if (attribute.ConstructorArguments.Count == 0) - continue; - - string signature = (string) attribute.ConstructorArguments [0].Value; - - if (InternalsVisibleToSignatureMatch (signature, candidate.Name)) - return true; - } - - return false; - } - - static bool InternalsVisibleToSignatureMatch (string signature, AssemblyNameReference reference) - { - int pos = signature.IndexOf (","); - if (pos == -1) - return signature == reference.Name; - - string assembly_name = signature.Substring (0, pos); - - pos = signature.IndexOf ("="); - if (pos == -1) - throw new ArgumentException (); - - string public_key = signature.Substring (pos + 1).ToLower (); - - return assembly_name == reference.Name && public_key == ToPublicKeyString (reference.PublicKey); - } - - static string ToPublicKeyString (byte [] public_key) - { - StringBuilder signature = new StringBuilder (public_key.Length); - for (int i = 0; i < public_key.Length; i++) - signature.Append (public_key [i].ToString ("x2")); - - return signature.ToString (); - } - - static bool IsInternalsVisibleToAttribute (CustomAttribute attribute) - { - return attribute.Constructor.DeclaringType.FullName == "System.Runtime.CompilerServices.InternalsVisibleToAttribute"; - } - - bool IsVisibleFrom (TypeDefinition type, TypeReference reference) - { - if (reference == null) - return true; - - if (reference is GenericParameter || reference.GetElementType () is GenericParameter) - return true; - - TypeDefinition other = reference.Resolve (); - if (other == null) - return true; - - if (!AreInDifferentAssemblies (type, other)) - return true; - - if (IsPublic (other)) - return true; - - return false; - } - - bool IsVisibleFrom (TypeDefinition type, MethodReference reference) - { - if (reference == null) - return true; - - MethodDefinition meth = reference.Resolve (); - if (meth == null) - return true; - - TypeDefinition dec = (TypeDefinition) meth.DeclaringType; - if (!IsVisibleFrom (type, dec)) - return false; - - if (meth.IsPublic) - return true; - - if (type == dec || IsNestedIn (type, dec)) - return true; - - if (meth.IsFamily && InHierarchy (type, dec)) - return true; - - if (meth.IsFamilyOrAssembly && (!AreInDifferentAssemblies (type, dec) || InHierarchy (type, dec))) - return true; - - if (meth.IsFamilyAndAssembly && (!AreInDifferentAssemblies (type, dec) && InHierarchy (type, dec))) - return true; - - if (!AreInDifferentAssemblies (type, dec) && meth.IsAssembly) - return true; - - return false; - } - - bool IsVisibleFrom (TypeDefinition type, FieldReference reference) - { - if (reference == null) - return true; - - FieldDefinition field = reference.Resolve (); - if (field == null) - return true; - - TypeDefinition dec = (TypeDefinition) field.DeclaringType; - if (!IsVisibleFrom (type, dec)) - return false; - - if (field.IsPublic) - return true; - - if (type == dec || IsNestedIn (type, dec)) - return true; - - if (field.IsFamily && InHierarchy (type, dec)) - return true; - - if (field.IsFamilyOrAssembly && (!AreInDifferentAssemblies (type, dec) || InHierarchy (type, dec))) - return true; - - if (field.IsFamilyAndAssembly && (!AreInDifferentAssemblies (type, dec) && InHierarchy (type, dec))) - return true; - - if (!AreInDifferentAssemblies (type, dec) && field.IsAssembly) - return true; - - return false; - } - - static bool IsNestedIn (TypeDefinition type, TypeDefinition other) - { - TypeDefinition declaring = type.DeclaringType; - - if (declaring == null) - return false; - - if (declaring == other) - return true; - - if (declaring.DeclaringType == null) - return false; - - return IsNestedIn (declaring, other); - } - - static bool InHierarchy (TypeDefinition type, TypeDefinition other) - { - if (type.BaseType == null) - return false; - - TypeDefinition baseType = type.BaseType.Resolve (); - - if (baseType == other) - return true; - - return InHierarchy (baseType, other); - } - - static void Report (string pattern, params object [] parameters) - { - Console.WriteLine ("[check] " + pattern, parameters); - } - - void ReportError (string pattern, params object [] parameters) - { - Report (pattern, parameters); - - if (throw_on_error) - throw new VisibilityErrorException (string.Format (pattern, parameters)); - } - - void CheckFields (TypeDefinition type) - { - foreach (FieldDefinition field in type.Fields) { - if (!IsVisibleFrom (type, field.FieldType)) { - ReportError ("Field `{0}` of type `{1}` is not visible from `{2}`", - field.Name, field.FieldType, type); - } - } - } - - void CheckMethods (TypeDefinition type) - { - CheckMethods (type, type.Methods); - } - - void CheckMethods (TypeDefinition type, ICollection methods) - { - foreach (MethodDefinition method in methods) { - if (!IsVisibleFrom (type, method.ReturnType)) { - ReportError ("Method return type `{0}` in method `{1}` is not visible", - method.ReturnType, method); - } - - foreach (ParameterDefinition parameter in method.Parameters) { - if (!IsVisibleFrom (type, parameter.ParameterType)) { - ReportError ("Parameter `{0}` of type `{1}` in method `{2}` is not visible.", - parameter.Index, parameter.ParameterType, method); - } - } - - if (method.HasBody) - CheckBody (method); - } - } - - void CheckBody (MethodDefinition method) - { - TypeDefinition type = (TypeDefinition) method.DeclaringType; - - foreach (VariableDefinition variable in method.Body.Variables) { - if (!IsVisibleFrom ((TypeDefinition) method.DeclaringType, variable.VariableType)) { - ReportError ("Variable `{0}` of type `{1}` from method `{2}` is not visible", - variable.Index, variable.VariableType, method); - } - } - - foreach (Instruction instr in method.Body.Instructions) { - switch (instr.OpCode.OperandType) { - case OperandType.InlineType: - case OperandType.InlineMethod: - case OperandType.InlineField: - case OperandType.InlineTok: - bool error = false; - TypeReference type_ref = instr.Operand as TypeReference; - if (type_ref != null) - error = !IsVisibleFrom (type, type_ref); - - MethodReference meth_ref = instr.Operand as MethodReference; - if (meth_ref != null) - error = !IsVisibleFrom (type, meth_ref); - - FieldReference field_ref = instr.Operand as FieldReference; - if (field_ref != null) - error = !IsVisibleFrom (type, field_ref); - - if (error) { - ReportError ("Operand `{0}` of type {1} at offset 0x{2} in method `{3}` is not visible", - instr.Operand, instr.OpCode.OperandType, instr.Offset.ToString ("x4"), method); - } - - break; - default: - continue; - } - } - } - - class VisibilityErrorException : Exception { - - public VisibilityErrorException (string message) - : base (message) - { - } - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/CustomizeActions.cs b/mcs/tools/tuner/Mono.Tuner/CustomizeActions.cs deleted file mode 100644 index 1bb6d6fb0e1..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/CustomizeActions.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Tuner { - - public class CustomizeActions : BaseStep { - - readonly bool link_sdk_only; - readonly HashSet skipped_assemblies; - - public CustomizeActions (bool link_sdk_only, IEnumerable skipped_assemblies) - { - this.link_sdk_only = link_sdk_only; - this.skipped_assemblies = new HashSet (skipped_assemblies); - } - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (!IsSkipped (assembly) && IsLinked (assembly)) { - if (!Annotations.HasAction (assembly)) // stray assembly not picked up when resolving references - Annotations.SetAction (assembly, AssemblyAction.Link); - return; - } - ProcessUserAssembly (assembly); - } - - protected virtual bool IsPreservedAttribute (CustomAttribute attribute) - { - // [assembly: Preserve (type)] does not preserve all the code in the assembly, in fact it might - // not preserve anything in _this_ assembly, but something in a separate assembly (reference) - if (attribute.HasConstructorArguments) - return false; - return (attribute.AttributeType.Name == "PreserveAttribute"); - } - - protected virtual bool IsLinkerSafeAttribute (CustomAttribute attribute) - { - return (attribute.AttributeType.Name == "LinkerSafeAttribute"); - } - - const ModuleAttributes Supported = ModuleAttributes.ILOnly | ModuleAttributes.Required32Bit | - ModuleAttributes.Preferred32Bit | ModuleAttributes.StrongNameSigned; - - protected virtual bool IsSkipped (AssemblyDefinition assembly) - { - // Cecil can't save back mixed-mode assemblies - so we can't link them - if ((assembly.MainModule.Attributes & ~Supported) != 0) - return true; - - if (assembly.HasCustomAttributes) { - foreach (var ca in assembly.CustomAttributes) { - if (IsPreservedAttribute (ca)) - return true; - } - } - return skipped_assemblies.Contains (assembly.Name.Name); - } - - protected virtual bool IsLinked (AssemblyDefinition assembly) - { - // LinkAll - if (!link_sdk_only) - return true; - // Link SDK : applies to BCL/SDK and product assembly (e.g. monotouch.dll) - if (Profile.IsSdkAssembly (assembly)) - return true; - if (Profile.IsProductAssembly (assembly)) - return true; - // the assembly can be marked with [LinkAssembly] - if (assembly.HasCustomAttributes) { - foreach (var ca in assembly.CustomAttributes) { - if (IsLinkerSafeAttribute (ca)) - return true; - } - } - return false; - } - - protected void ProcessUserAssembly (AssemblyDefinition assembly) - { - ResolveFromAssemblyStep.ProcessLibrary (Context, assembly); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs b/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs deleted file mode 100644 index 9dcf5ee05af..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs +++ /dev/null @@ -1,288 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - [Flags] - public enum SubStepTargets { - None = 0, - - Assembly = 1, - Type = 2, - Field = 4, - Method = 8, - Property = 16, - Event = 32, - } - - public interface ISubStep { - - SubStepTargets Targets { get; } - - void Initialize (LinkContext context); - bool IsActiveFor (AssemblyDefinition assembly); - - void ProcessAssembly (AssemblyDefinition assembly); - void ProcessType (TypeDefinition type); - void ProcessField (FieldDefinition field); - void ProcessMethod (MethodDefinition method); - void ProcessProperty (PropertyDefinition property); - void ProcessEvent (EventDefinition @event); - } - - public abstract class BaseSubStep : ISubStep { - - protected LinkContext context; - - public AnnotationStore Annotations { - get { return context.Annotations; } - } - - public abstract SubStepTargets Targets { get; } - - public virtual void Initialize (LinkContext context) - { - this.context = context; - } - - public virtual bool IsActiveFor (AssemblyDefinition assembly) - { - return true; - } - - public virtual void ProcessAssembly (AssemblyDefinition assembly) - { - } - - public virtual void ProcessType (TypeDefinition type) - { - } - - public virtual void ProcessField (FieldDefinition field) - { - } - - public virtual void ProcessMethod (MethodDefinition method) - { - } - - public virtual void ProcessProperty (PropertyDefinition property) - { - } - - public virtual void ProcessEvent (EventDefinition @event) - { - } - } - - public class SubStepDispatcher : IStep, IEnumerable { - - List substeps = new List (); - - List on_assemblies; - List on_types; - List on_fields; - List on_methods; - List on_properties; - List on_events; - - public void Add (ISubStep substep) - { - substeps.Add (substep); - } - - public void Process (LinkContext context) - { - InitializeSubSteps (context); - - BrowseAssemblies (context.GetAssemblies ()); - } - - static bool HasSubSteps (List substeps) - { - return substeps != null && substeps.Count > 0; - } - - void BrowseAssemblies (IEnumerable assemblies) - { - foreach (var assembly in assemblies) { - CategorizeSubSteps (assembly); - - if (HasSubSteps (on_assemblies)) - DispatchAssembly (assembly); - - if (!ShouldDispatchTypes ()) - continue; - - BrowseTypes (assembly.MainModule.Types); - } - } - - bool ShouldDispatchTypes () - { - return HasSubSteps (on_types) - || HasSubSteps (on_fields) - || HasSubSteps (on_methods) - || HasSubSteps (on_properties) - || HasSubSteps (on_events); - } - - void BrowseTypes (ICollection types) - { - foreach (TypeDefinition type in types) { - DispatchType (type); - - if (type.HasFields && HasSubSteps (on_fields)) - BrowseFields (type.Fields); - - if (type.HasMethods && HasSubSteps (on_methods)) - BrowseMethods (type.Methods); - - if (type.HasProperties && HasSubSteps (on_properties)) - BrowseProperties (type.Properties); - - if (type.HasEvents && HasSubSteps (on_events)) - BrowseEvents (type.Events); - - if (type.HasNestedTypes) - BrowseTypes (type.NestedTypes); - } - } - - void BrowseFields (ICollection fields) - { - foreach (FieldDefinition field in fields) - DispatchField (field); - } - - void BrowseMethods (ICollection methods) - { - foreach (MethodDefinition method in methods) - DispatchMethod (method); - } - - void BrowseProperties (ICollection properties) - { - foreach (PropertyDefinition property in properties) - DispatchProperty (property); - } - - void BrowseEvents (ICollection events) - { - foreach (EventDefinition @event in events) - DispatchEvent (@event); - } - - void DispatchAssembly (AssemblyDefinition assembly) - { - foreach (var substep in on_assemblies) { - var bs = substep as BaseSubStep; - if (bs != null) - bs.Annotations.Push (substep); - substep.ProcessAssembly (assembly); - if (bs != null) - bs.Annotations.Pop (); - } - } - - void DispatchType (TypeDefinition type) - { - foreach (var substep in on_types) { - var bs = substep as BaseSubStep; - if (bs != null) - bs.Annotations.Push (substep); - substep.ProcessType (type); - if (bs != null) - bs.Annotations.Pop (); - } - } - - void DispatchField (FieldDefinition field) - { - foreach (var substep in on_fields) - substep.ProcessField (field); - } - - void DispatchMethod (MethodDefinition method) - { - foreach (var substep in on_methods) - substep.ProcessMethod (method); - } - - void DispatchProperty (PropertyDefinition property) - { - foreach (var substep in on_properties) - substep.ProcessProperty (property); - } - - void DispatchEvent (EventDefinition @event) - { - foreach (var substep in on_events) - substep.ProcessEvent (@event); - } - - void InitializeSubSteps (LinkContext context) - { - foreach (var substep in substeps) - substep.Initialize (context); - } - - void CategorizeSubSteps (AssemblyDefinition assembly) - { - on_assemblies = null; - on_types = null; - on_fields = null; - on_methods = null; - on_properties = null; - on_events = null; - - foreach (var substep in substeps) - CategorizeSubStep (substep, assembly); - } - - void CategorizeSubStep (ISubStep substep, AssemblyDefinition assembly) - { - if (!substep.IsActiveFor (assembly)) - return; - - CategorizeTarget (substep, SubStepTargets.Assembly, ref on_assemblies); - CategorizeTarget (substep, SubStepTargets.Type, ref on_types); - CategorizeTarget (substep, SubStepTargets.Field, ref on_fields); - CategorizeTarget (substep, SubStepTargets.Method, ref on_methods); - CategorizeTarget (substep, SubStepTargets.Property, ref on_properties); - CategorizeTarget (substep, SubStepTargets.Event, ref on_events); - } - - static void CategorizeTarget (ISubStep substep, SubStepTargets target, ref List list) - { - if (!Targets (substep, target)) - return; - - if (list == null) - list = new List (); - - list.Add (substep); - } - - static bool Targets (ISubStep substep, SubStepTargets target) - { - return (substep.Targets & target) == target; - } - - IEnumerator IEnumerable.GetEnumerator () - { - return GetEnumerator (); - } - - public IEnumerator GetEnumerator () - { - return substeps.GetEnumerator (); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/Extensions.cs b/mcs/tools/tuner/Mono.Tuner/Extensions.cs deleted file mode 100644 index 3e3b312133b..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/Extensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; - -using Mono.Cecil; - -using Mono.Linker; - -namespace Mono.Tuner { - - public static partial class Extensions { - - public static bool TryGetLinkedAssembly (this LinkContext context, string name, out AssemblyDefinition assembly) - { - assembly = GetAssembly (context, name); - if (assembly == null) - return false; - - return context.Annotations.GetAction (assembly) == AssemblyAction.Link; - } - - public static AssemblyDefinition GetAssembly (this LinkContext context, string assembly_name) - { - foreach (var assembly in context.GetAssemblies ()) - if (assembly.Name.Name == assembly_name) - return assembly; - - return null; - } - - // note: direct check, no inheritance - public static bool Is (this TypeReference type, string @namespace, string name) - { - return ((type != null) && (type.Name == name) && (type.Namespace == @namespace)); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/FilterAttributes.cs b/mcs/tools/tuner/Mono.Tuner/FilterAttributes.cs deleted file mode 100644 index 19a334a5ccb..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/FilterAttributes.cs +++ /dev/null @@ -1,157 +0,0 @@ -// -// FilterAttributes.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class FilterAttributes : BaseStep { - - static Hashtable attributes = new Hashtable (); - - static FilterAttributes () - { - FilterAttribute ("System.Runtime.InteropServices.ComVisibleAttribute"); - } - - static void FilterAttribute (string fullname) - { - attributes.Add (fullname, null); - } - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - Filter (assembly); - - foreach (ModuleDefinition module in assembly.Modules) - ProcessModule (module); - } - - static void ProcessModule (ModuleDefinition module) - { - Filter (module); - - foreach (TypeDefinition type in module.Types) - ProcessType (type); - } - - static void ProcessType (TypeDefinition type) - { - if (type.HasFields) - ProcessFields (type.Fields); - - if (type.HasMethods) - ProcessMethods (type.Methods); - - if (type.HasEvents) - ProcessEvents (type.Events); - - if (type.HasProperties) - ProcessProperties (type.Properties); - - ProcessGenericParameters (type); - } - - static void ProcessFields (ICollection fields) - { - foreach (FieldDefinition field in fields) - Filter (field); - } - - static void ProcessMethods (ICollection methods) - { - foreach (MethodDefinition method in methods) - ProcessMethod (method); - } - - static void ProcessMethod (MethodDefinition method) - { - ProcessGenericParameters (method); - - Filter (method.MethodReturnType); - - if (method.HasParameters) - ProcessParameters (method.Parameters); - } - - static void ProcessParameters (ICollection parameters) - { - foreach (ParameterDefinition parameter in parameters) - Filter (parameter); - } - - static void ProcessGenericParameters (IGenericParameterProvider provider) - { - if (!provider.HasGenericParameters) - return; - - foreach (GenericParameter parameter in provider.GenericParameters) - Filter (parameter); - } - - static void ProcessEvents (ICollection events) - { - foreach (EventDefinition @event in events) - Filter (@event); - } - - static void ProcessProperties (ICollection properties) - { - foreach (PropertyDefinition property in properties) - Filter (property); - } - - static void Filter (ICustomAttributeProvider provider) - { - if (!provider.HasCustomAttributes) - return; - - for (int i = 0; i < provider.CustomAttributes.Count; i++) { - CustomAttribute attribute = provider.CustomAttributes [i]; - if (!IsFilteredAttribute (attribute)) - continue; - - provider.CustomAttributes.RemoveAt (i--); - } - } - - static bool IsFilteredAttribute (CustomAttribute attribute) - { - return attributes.Contains (attribute.Constructor.DeclaringType.FullName); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/FixModuleFlags.cs b/mcs/tools/tuner/Mono.Tuner/FixModuleFlags.cs deleted file mode 100644 index 2bb01ab9bc5..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/FixModuleFlags.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class FixModuleFlags : BaseStep { - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - assembly.MainModule.Attributes = ModuleAttributes.ILOnly; - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/InjectSecurityAttributes.cs b/mcs/tools/tuner/Mono.Tuner/InjectSecurityAttributes.cs deleted file mode 100644 index 9489876ae97..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/InjectSecurityAttributes.cs +++ /dev/null @@ -1,500 +0,0 @@ -// -// InjectSecurityAttributes.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; -using System.Linq; -using System.Text; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Tuner { - - public class InjectSecurityAttributes : BaseStep { - - enum TargetKind { - Type, - Method, - } - - protected enum AttributeType { - Critical, - SafeCritical, - } - - const string _safe_critical = "System.Security.SecuritySafeCriticalAttribute"; - const string _critical = "System.Security.SecurityCriticalAttribute"; - const string _system_void = "System.Void"; - - const string sec_attr_folder = "secattrs"; - - protected AssemblyDefinition _assembly; - - MethodDefinition _safe_critical_ctor; - MethodDefinition _critical_ctor; - TypeDefinition _void_type; - - string data_folder; - - protected override bool ConditionToProcess () - { - if (!Context.HasParameter (sec_attr_folder)) { - Console.Error.WriteLine ("Warning: no secattrs folder specified."); - return false; - } - - data_folder = Context.GetParameter (sec_attr_folder); - return true; - } - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - string secattr_file = Path.Combine ( - data_folder, - assembly.Name.Name + ".secattr"); - - if (!File.Exists (secattr_file)) { - Console.Error.WriteLine ("Warning: file '{0}' not found, skipping.", secattr_file); - return; - } - - _assembly = assembly; - - // remove existing [SecurityCritical] and [SecuritySafeCritical] - RemoveSecurityAttributes (); - - // add [SecurityCritical] and [SecuritySafeCritical] from the data file - ProcessSecurityAttributeFile (secattr_file); - } - - protected void RemoveSecurityAttributes () - { - foreach (TypeDefinition type in _assembly.MainModule.Types) { - if (RemoveSecurityAttributes (type)) - type.HasSecurity = false; - - if (type.HasMethods) { - foreach (MethodDefinition method in type.Methods) { - if (RemoveSecurityAttributes (method)) - method.HasSecurity = false; - } - } - } - } - - static bool RemoveSecurityDeclarations (ISecurityDeclarationProvider provider) - { - // also remove already existing CAS security declarations - - if (provider == null) - return false; - - if (!provider.HasSecurityDeclarations) - return false; - - provider.SecurityDeclarations.Clear (); - return true; - } - - static bool RemoveSecurityAttributes (ICustomAttributeProvider provider) - { - bool result = RemoveSecurityDeclarations (provider as ISecurityDeclarationProvider); - - if (!provider.HasCustomAttributes) - return result; - - var attributes = provider.CustomAttributes; - for (int i = 0; i < attributes.Count; i++) { - CustomAttribute attribute = attributes [i]; - switch (attribute.Constructor.DeclaringType.FullName) { - case _safe_critical: - case _critical: - attributes.RemoveAt (i--); - break; - } - } - return result; - } - - void ProcessSecurityAttributeFile (string file) - { - using (StreamReader reader = File.OpenText (file)) { - string line; - while ((line = reader.ReadLine ()) != null) - ProcessLine (line); - } - } - - void ProcessLine (string line) - { - if (line == null || line.Length < 6 || line [0] == '#') - return; - - int sep = line.IndexOf (": "); - if (sep == -1) - return; - - string marker = line.Substring (0, sep); - string target = line.Substring (sep + 2); - - ProcessSecurityAttributeEntry ( - DecomposeAttributeType (marker), - DecomposeTargetKind (marker), - target); - } - - static AttributeType DecomposeAttributeType (string marker) - { - if (marker.StartsWith ("SC")) - return AttributeType.Critical; - else if (marker.StartsWith ("SSC")) - return AttributeType.SafeCritical; - else - throw new ArgumentException (); - } - - static TargetKind DecomposeTargetKind (string marker) - { - switch (marker [marker.Length - 1]) { - case 'T': - return TargetKind.Type; - case 'M': - return TargetKind.Method; - default: - throw new ArgumentException (); - } - } - - public static bool NeedsDefaultConstructor (TypeDefinition type) - { - if (type.IsInterface) - return false; - - TypeReference base_type = type.BaseType; - if ((base_type == null) || (base_type.Namespace != "System")) - return true; - - return ((base_type.Name != "Delegate") && (base_type.Name != "MulticastDelegate")); - } - - void ProcessSecurityAttributeEntry (AttributeType type, TargetKind kind, string target) - { - ICustomAttributeProvider provider = GetTarget (kind, target); - if (provider == null) { - Console.Error.WriteLine ("Warning: entry '{0}' could not be found", target); - return; - } - - // we need to be smarter when applying the attributes (mostly SC) to types - if (kind == TargetKind.Type) { - TypeDefinition td = (provider as TypeDefinition); - // ensure [SecurityCritical] types (well most) have a default constructor - if ((type == AttributeType.Critical) && NeedsDefaultConstructor (td)) { - if (GetDefaultConstructor (td) == null) { - // Console.Error.WriteLine ("Info: adding default ctor for '{0}'", td); - td.Methods.Add (CreateDefaultConstructor ()); - } - } - - // it's easier for some tools (e.g. less false positives in fxcop) - // and also quicker for the runtime (one less lookup) if all methods gets decorated - foreach (MethodDefinition method in td.Methods) { - bool skip = false; - - AttributeType mtype = type; - // there are cases where an SC cannot be applied to some methods - switch (method.Name) { - // e.g. everything we override from System.Object (which is transparent) - case "Equals": - skip = method.Parameters.Count == 1 && method.Parameters [0].ParameterType.FullName == "System.Object"; - break; - case "Finalize": - case "GetHashCode": - case "ToString": - skip = !method.HasParameters; - break; - // e.g. some transparent interfaces, like IDisposable (implicit or explicit) - // downgrade some SC into SSC to respect the override/inheritance rules - case "System.IDisposable.Dispose": - case "Dispose": - skip = !method.HasParameters; - break; - } - - if (skip) - continue; - - switch (mtype) { - case AttributeType.Critical: - AddCriticalAttribute (method); - break; - case AttributeType.SafeCritical: - AddSafeCriticalAttribute (method); - break; - } - } - } - - switch (type) { - case AttributeType.Critical: - AddCriticalAttribute (provider); - break; - case AttributeType.SafeCritical: - AddSafeCriticalAttribute (provider); - break; - } - } - - protected void AddCriticalAttribute (ICustomAttributeProvider provider) - { - // a [SecurityCritical] replaces a [SecuritySafeCritical] - if (HasSecurityAttribute (provider, AttributeType.SafeCritical)) - RemoveSecurityAttributes (provider); - - AddSecurityAttribute (provider, AttributeType.Critical); - } - - void AddSafeCriticalAttribute (ICustomAttributeProvider provider) - { - // a [SecuritySafeCritical] is ignored if a [SecurityCritical] is present - if (HasSecurityAttribute (provider, AttributeType.Critical)) - return; - - AddSecurityAttribute (provider, AttributeType.SafeCritical); - } - - void AddSecurityAttribute (ICustomAttributeProvider provider, AttributeType type) - { - if (HasSecurityAttribute (provider, type)) - return; - - var attributes = provider.CustomAttributes; - switch (type) { - case AttributeType.Critical: - attributes.Add (CreateCriticalAttribute ()); - break; - case AttributeType.SafeCritical: - attributes.Add (CreateSafeCriticalAttribute ()); - break; - } - } - - protected static bool HasSecurityAttribute (ICustomAttributeProvider provider, AttributeType type) - { - if (!provider.HasCustomAttributes) - return false; - - foreach (CustomAttribute attribute in provider.CustomAttributes) { - switch (attribute.Constructor.DeclaringType.Name) { - case _critical: - if (type == AttributeType.Critical) - return true; - - break; - case _safe_critical: - if (type == AttributeType.SafeCritical) - return true; - - break; - } - } - - return false; - } - - ICustomAttributeProvider GetTarget (TargetKind kind, string target) - { - switch (kind) { - case TargetKind.Type: - return GetType (target); - case TargetKind.Method: - return GetMethod (target); - default: - throw new ArgumentException (); - } - } - - TypeDefinition GetType (string fullname) - { - return _assembly.MainModule.GetType (fullname); - } - - MethodDefinition GetMethod (string signature) - { - int pos = signature.IndexOf (" "); - if (pos == -1) - throw new ArgumentException (); - - string tmp = signature.Substring (pos + 1); - - pos = tmp.IndexOf ("::"); - if (pos == -1) - throw new ArgumentException (); - - string type_name = tmp.Substring (0, pos); - - int parpos = tmp.IndexOf ("("); - if (parpos == -1) - throw new ArgumentException (); - - string method_name = tmp.Substring (pos + 2, parpos - pos - 2); - - TypeDefinition type = GetType (type_name); - if (type == null) - return null; - - return GetMethod (type.Methods, signature); - } - - static MethodDefinition GetMethod (IEnumerable methods, string signature) - { - foreach (MethodDefinition method in methods) - if (GetFullName (method) == signature) - return method; - - return null; - } - - static string GetFullName (MethodReference method) - { - var sentinel = method.Parameters.FirstOrDefault (p => p.ParameterType.IsSentinel); - var sentinel_pos = -1; - if (sentinel != null) - sentinel_pos = method.Parameters.IndexOf (sentinel); - - StringBuilder sb = new StringBuilder (); - sb.Append (method.ReturnType.FullName); - sb.Append (" "); - sb.Append (method.DeclaringType.FullName); - sb.Append ("::"); - sb.Append (method.Name); - if (method.HasGenericParameters) { - sb.Append ("<"); - for (int i = 0; i < method.GenericParameters.Count; i++ ) { - if (i > 0) - sb.Append (","); - sb.Append (method.GenericParameters [i].Name); - } - sb.Append (">"); - } - sb.Append ("("); - if (method.HasParameters) { - for (int i = 0; i < method.Parameters.Count; i++) { - if (i > 0) - sb.Append (","); - - if (i == sentinel_pos) - sb.Append ("...,"); - - sb.Append (method.Parameters [i].ParameterType.FullName); - } - } - sb.Append (")"); - return sb.ToString (); - } - - static MethodDefinition GetDefaultConstructor (TypeDefinition type) - { - foreach (MethodDefinition ctor in type.Methods.Where (m => m.IsConstructor)) - if (!ctor.IsStatic && !ctor.HasParameters) - return ctor; - - return null; - } - - MethodDefinition GetSafeCriticalCtor () - { - if (_safe_critical_ctor != null) - return _safe_critical_ctor; - - TypeDefinition safe_critical_type = Context.GetType (_safe_critical); - if (safe_critical_type == null) - throw new InvalidOperationException (String.Format ("{0} type not found", _safe_critical)); - - _safe_critical_ctor = GetDefaultConstructor (safe_critical_type); - return _safe_critical_ctor; - } - - MethodDefinition GetCriticalCtor () - { - if (_critical_ctor != null) - return _critical_ctor; - - TypeDefinition critical_type = Context.GetType (_critical); - if (critical_type == null) - throw new InvalidOperationException (String.Format ("{0} type not found", _critical)); - - _critical_ctor = GetDefaultConstructor (critical_type); - return _critical_ctor; - } - - TypeDefinition GetSystemVoid () - { - if (_void_type != null) - return _void_type; - - _void_type = Context.GetType (_system_void); - if (_void_type == null) - throw new InvalidOperationException (String.Format ("{0} type not found", _system_void)); - - return _void_type; - } - - MethodReference Import (MethodDefinition method) - { - return _assembly.MainModule.Import (method); - } - - CustomAttribute CreateSafeCriticalAttribute () - { - return new CustomAttribute (Import (GetSafeCriticalCtor ())); - } - - CustomAttribute CreateCriticalAttribute () - { - return new CustomAttribute (Import (GetCriticalCtor ())); - } - - MethodDefinition CreateDefaultConstructor () - { - MethodDefinition method = new MethodDefinition (".ctor", - MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, - GetSystemVoid ()); - method.Body.Instructions.Add (Instruction.Create (OpCodes.Ret)); - return method; - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/MarkNSObjectsBase.cs b/mcs/tools/tuner/Mono.Tuner/MarkNSObjectsBase.cs deleted file mode 100644 index 9d65be1de6b..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/MarkNSObjectsBase.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -// MarkNSObjectsBase.cs -// -// Authors: -// Jb Evain (jbevain@novell.com) -// Sebastien Pouliot -// -// (C) 2009 Novell, Inc. -// Copyright (C) 2011 Xamarin, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Tuner; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public abstract class MarkNSObjectsBase : BaseSubStep { - - protected abstract string ExportAttribute { get; } - - public override SubStepTargets Targets { - get { return SubStepTargets.Type; } - } - - public override void ProcessType (TypeDefinition type) - { - if (!IsProductType (type)) { - Annotations.Mark (type); - Annotations.SetPreserve (type, TypePreserve.All); - } else - PreserveProductType (type); - } - - void PreserveProductType (TypeDefinition type) - { - PreserveIntPtrConstructor (type); - PreserveExportedMethods (type); - } - - void PreserveExportedMethods (TypeDefinition type) - { - if (!type.HasMethods) - return; - - foreach (var method in type.GetMethods ()) { - if (!IsExportedMethod (method)) - continue; - - if (!IsOverridenInUserCode (method)) - continue; - - PreserveMethod (type, method); - } - } - - bool IsOverridenInUserCode (MethodDefinition method) - { - if (!method.IsVirtual) - return false; - - var overrides = Annotations.GetOverrides (method); - if (overrides == null || overrides.Count == 0) - return false; - - foreach (MethodDefinition @override in overrides) - if (!IsProductMethod (@override)) - return true; - - return false; - } - - bool IsExportedMethod (MethodDefinition method) - { - return HasExportAttribute (method); - } - - bool HasExportAttribute (ICustomAttributeProvider provider) - { - if (!provider.HasCustomAttributes) - return false; - - foreach (CustomAttribute attribute in provider.CustomAttributes) - if (attribute.AttributeType.FullName == ExportAttribute) - return true; - - return false; - } - - void PreserveIntPtrConstructor (TypeDefinition type) - { - if (!type.HasMethods) - return; - - foreach (MethodDefinition constructor in type.GetConstructors ()) { - if (!constructor.HasParameters) - continue; - - if (constructor.Parameters.Count != 1 || constructor.Parameters [0].ParameterType.FullName != "System.IntPtr") - continue; - - PreserveMethod (type, constructor); - break; // only one .ctor can match this - } - } - - void PreserveMethod (TypeDefinition type, MethodDefinition method) - { - Annotations.AddPreservedMethod (type, method); - } - - static bool IsProductMethod (MethodDefinition method) - { - return IsProductType (method.DeclaringType); - } - - static bool IsProductType (TypeDefinition type) - { - return Profile.IsProductAssembly (type.Module.Assembly); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yApiMarker.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yApiMarker.cs deleted file mode 100644 index fcd61afbd78..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yApiMarker.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// MoonlightA11yApiMarker.cs -// -// Author: -// Andrés G. Aragoneses (aaragoneses@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Xml; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class MoonlightA11yApiMarker : MarkStep { - - bool IsA11yAssembly (AssemblyDefinition assembly) - { - return assembly.ToString ().Contains ("DummyEntry") || assembly.ToString ().Contains ("MoonAtkBridge"); - } - - protected override void InitializeAssembly (AssemblyDefinition assembly) - { - if (IsA11yAssembly (assembly)) - base.InitializeAssembly (assembly); - } - - protected override void EnqueueMethod (MethodDefinition method) - { - if (IsA11yAssembly (method.DeclaringType.Module.Assembly)) - base.EnqueueMethod (method); - else - Annotations.Mark (method); - } - - protected override bool IgnoreScope (IMetadataScope scope) - { - return false; - } - - protected override TypeDefinition MarkType (TypeReference reference) - { - if (reference == null) - throw new ArgumentNullException ("reference"); - - reference = GetOriginalType (reference); - - if (reference is GenericParameter) - return null; - - TypeDefinition type = reference.Resolve (); - - if (type == null) - throw new ResolutionException (reference); - - if (CheckProcessed (type)) - return type; - - Annotations.Mark (type); - return type; - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yAssemblyStep.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yAssemblyStep.cs deleted file mode 100644 index 63a82b28dcb..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yAssemblyStep.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// MoonlightA11yAssemblyStep.cs -// -// Author: -// Andrés G. Aragoneses (aaragoneses@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class MoonlightA11yAssemblyStep : MoonlightAssemblyStep { - - protected override void CustomizePipeline (Pipeline pipeline) - { - pipeline.RemoveStep (typeof (LoadI18nAssemblies)); - pipeline.RemoveStep (typeof (BlacklistStep)); - pipeline.RemoveStep (typeof (MarkStep)); - pipeline.RemoveStep (typeof (SweepStep)); - pipeline.RemoveStep (typeof (CleanStep)); - pipeline.RemoveStep (typeof (RegenerateGuidStep)); - pipeline.AddStepBefore (typeof (OutputStep), new MoonlightA11yProcessor ()); - } - - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yDescriptorGenerator.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yDescriptorGenerator.cs deleted file mode 100644 index 17db23b2a8b..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yDescriptorGenerator.cs +++ /dev/null @@ -1,337 +0,0 @@ -// -// MoonlightA11yDescriptorGenerator.cs -// -// Author: -// Andrés G. Aragoneses (aaragoneses@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; - -using System.IO; -using System.Text.RegularExpressions; -using System.Text; - -using System.Xml; -using System.Xml.XPath; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class MoonlightA11yDescriptorGenerator : BaseStep { - - XmlTextWriter writer = null; - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (assembly.Name.Name == "MoonAtkBridge" || assembly.Name.Name == "System.Windows" || - assembly.Name.Name.Contains ("Dummy")) - return; - - if (writer == null) { - if (!Directory.Exists (Context.OutputDirectory)) - Directory.CreateDirectory (Context.OutputDirectory); - - string file_name = "descriptors.xml"; - string file_path = Path.Combine (Context.OutputDirectory, file_name); - if (File.Exists (file_path)) - File.Delete (file_path); - FileStream xml_file = new FileStream (file_path, FileMode.OpenOrCreate); - Console.WriteLine ("Created file {0}", file_name); - Console.Write ("Writing contents..."); - - writer = new XmlTextWriter (xml_file, System.Text.Encoding.UTF8); - writer.Formatting = Formatting.Indented; - writer.WriteStartElement("linker"); - } - - SortedDictionary types = ScanAssembly (assembly); - if (types != null && types.Count > 0) { - writer.WriteStartElement("assembly"); - writer.WriteAttributeString ("fullname", assembly.Name.Name); - - foreach (TypeDefinition type in types.Keys) { - IList members = types [type]; - if (members != null && members.Count > 0) { - writer.WriteStartElement("type"); - writer.WriteAttributeString ("fullname", type.FullName); - - foreach (IMetadataTokenProvider member in members) { - MethodDefinition method = member as MethodDefinition; - if (method != null) { - writer.WriteStartElement("method"); - writer.WriteAttributeString ("signature", - method.ReturnType.FullName + " " + - method.Name + GetMethodParams (method)); - writer.WriteEndElement (); - continue; - } - - FieldDefinition field = member as FieldDefinition; - if (field != null) { - writer.WriteStartElement("field"); - writer.WriteAttributeString ("signature", field.DeclaringType.FullName + " " + field.Name); - writer.WriteEndElement (); - } - } - writer.WriteEndElement (); - } - } - - writer.WriteEndElement (); - Console.WriteLine (); - } - - } - - protected override void EndProcess () - { - Console.WriteLine (); - - foreach (FileStream stream in streams) - stream.Close (); - - if (writer != null) { - writer.WriteEndElement (); - writer.Close (); - writer = null; - } - } - - //this is almost the ToString method of MethodDefinition... - private string GetMethodParams (MethodDefinition method) - { - string @params = "("; - if (method.HasParameters) { - for (int i = 0; i < method.Parameters.Count; i++) { - if (i > 0) - @params += ","; - - @params += method.Parameters [i].ParameterType.FullName; - } - } - @params += ")"; - return @params; - } - - SortedDictionary /*,List>*/ ScanAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return null; - - SortedDictionary members_used = new SortedDictionary (new TypeComparer ()); - foreach (TypeDefinition type in assembly.MainModule.Types) { - IList used_providers = FilterPublicMembers (ScanType (type)); - if (used_providers.Count > 0) - members_used [type] = used_providers; - else if (IsInternal (type, true) && - Annotations.IsMarked (type)) - throw new NotSupportedException (String.Format ("The type {0} is used while its API is not", type.ToString ())); - } - return members_used; - } - - IList ScanType (TypeDefinition type) - { - return ExtractUsedProviders (type.Methods, type.Fields); - } - - static IList FilterPublicMembers (IList members) - { - IList new_list = new ArrayList (); - foreach (MemberReference item in members) - if (IsInternal (item, true)) - new_list.Add (item); - - return new_list; - } - - static string [] master_infos = Directory.GetFiles (Environment.CurrentDirectory, "*.info"); - - static string FindMasterInfoFile (string name) - { - if (master_infos.Length == 0) - throw new Exception ("No masterinfo files found in current directory"); - - foreach (string file in master_infos) { - if (file.EndsWith (name + ".info")) - return file; - } - - return null; - } - - const string xpath_init = "assemblies/assembly/namespaces/namespace[@name='{0}']/classes/class[@name='{1}']"; - - static string GetXPathSearchForType (TypeDefinition type) - { - TypeDefinition parent_type = type; - string xpath = String.Empty; - while (parent_type.DeclaringType != null) { - xpath = String.Format ("/classes/class[@name='{0}']", parent_type.Name) + xpath; - parent_type = parent_type.DeclaringType; - } - return String.Format (xpath_init, parent_type.Namespace, parent_type.Name) + xpath; - } - - static bool IsInternal (MemberReference member, bool master_info) - { - TypeDefinition type = null; - string master_info_file = null; - - if (member is TypeDefinition) { - type = member as TypeDefinition; - if (!master_info) - return (!type.IsNested && !type.IsPublic) || - (type.IsNested && (!type.IsNestedPublic || IsInternal (type.DeclaringType, false))); - - master_info_file = FindMasterInfoFile (type.Module.Assembly.Name.Name); - if (master_info_file == null) - return IsInternal (member, false); - - return !NodeExists (master_info_file, GetXPathSearchForType (type)); - } - - type = member.DeclaringType.Resolve (); - - if (IsInternal (type, master_info)) - return true; - - MethodDefinition method = member as MethodDefinition; - FieldDefinition field = member as FieldDefinition; - - if (field == null && method == null) - throw new System.NotSupportedException ("Members to scan should be methods or fields"); - - if (!master_info) { - - if (method != null) - return !method.IsPublic; - - return !field.IsPublic; - } - - master_info_file = FindMasterInfoFile (type.Module.Assembly.Name.Name); - if (master_info_file == null) - return IsInternal (member, false); - - string xpath_type = GetXPathSearchForType (type); - string name; - if (field != null) - name = field.Name; - else { - name = method.ToString (); - - //lame, I know... - name = WackyOutArgs (WackyCommas (name.Substring (name.IndexOf ("::") + 2) - .Replace ("/", "+") // nested classes - .Replace ('<', '[').Replace ('>', ']'))); //generic params - } - - if (field != null || !IsPropertyMethod (method)) - return !NodeExists (master_info_file, xpath_type + String.Format ("/*/*[@name='{0}']", name)); - - return !NodeExists (master_info_file, xpath_type + String.Format ("/properties/*/*/*[@name='{0}']", name)); - } - - //at some point I want to get rid of this method and ask cecil's maintainer to spew commas in a uniform way... - static string WackyCommas (string method) - { - string outstring = String.Empty; - bool square_bracket = false; - foreach (char c in method) { - if (c == '[') - square_bracket = true; - else if (c == ']') - square_bracket = false; - - outstring = outstring + c; - - if (c == ',' && !square_bracket) - outstring = outstring + " "; - } - return outstring; - } - - //ToString() spews & but not 'out' keyword - static string WackyOutArgs (string method) - { - return Regex.Replace (method, @"\w+&", delegate (Match m) { return "out " + m.ToString (); }); - } - - //copied from MarkStep (violating DRY unless I can put this in a better place... Cecil?) - static bool IsPropertyMethod (MethodDefinition md) - { - return (md.SemanticsAttributes & MethodSemanticsAttributes.Getter) != 0 || - (md.SemanticsAttributes & MethodSemanticsAttributes.Setter) != 0; - } - - static Dictionary navs = new Dictionary (); - static List streams = new List (); - - static bool NodeExists (string file, string xpath) - { - Console.Write ("."); - //Console.WriteLine ("Looking for node {0} in file {1}", xpath, file.Substring (file.LastIndexOf ("/") + 1)); - - XPathNavigator nav = null; - if (!navs.TryGetValue (file, out nav)) { - FileStream stream = new FileStream (file, FileMode.Open); - XPathDocument document = new XPathDocument (stream); - nav = document.CreateNavigator (); - streams.Add (stream); - navs [file] = nav; - } - return nav.SelectSingleNode (xpath) != null; - } - - IList /*List*/ ExtractUsedProviders (params IList[] members) - { - IList used = new ArrayList (); - if (members == null || members.Length == 0) - return used; - - foreach (IList members_list in members) - foreach (IMetadataTokenProvider provider in members_list) - if (Annotations.IsMarked (provider)) - used.Add (provider); - - return used; - } - - class TypeComparer : IComparer { - - public int Compare (TypeDefinition x, TypeDefinition y) - { - return string.Compare (x.ToString (), y.ToString ()); - } - - } - - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yProcessor.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yProcessor.cs deleted file mode 100644 index 2971b11ad5e..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yProcessor.cs +++ /dev/null @@ -1,179 +0,0 @@ -// -// MoonlightA11yProcessor.cs -// -// Author: -// Andrés G. Aragoneses (aaragoneses@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using System.Linq; - -using Mono.Cecil; - -using Mono.Linker; - -namespace Mono.Tuner { - - public class MoonlightA11yProcessor : InjectSecurityAttributes { - - protected override bool ConditionToProcess () - { - return true; - } - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - _assembly = assembly; - - // remove existing [SecurityCritical] and [SecuritySafeCritical] - RemoveSecurityAttributes (); - - // add [SecurityCritical] - AddSecurityAttributes (); - - // convert all public members into internal - MakeApiInternal (); - } - - void MakeApiInternal () - { - foreach (TypeDefinition type in _assembly.MainModule.Types) { - if (type.IsPublic) - type.IsPublic = false; - - if (type.HasMethods && !type.Name.EndsWith ("Adapter")) - foreach (MethodDefinition ctor in type.Methods.Where (m => m.IsConstructor)) - if (ctor.IsPublic) - ctor.IsAssembly = true; - - if (type.HasMethods) - foreach (MethodDefinition method in type.Methods.Where (m => !m.IsConstructor)) - if (method.IsPublic) - method.IsAssembly = true; - } - } - - void AddSecurityAttributes () - { - foreach (TypeDefinition type in _assembly.MainModule.Types) { - AddCriticalAttribute (type); - - if (type.HasMethods) - foreach (MethodDefinition ctor in type.Methods.Where (m => m.IsConstructor)) - AddCriticalAttribute (ctor); - - if (type.HasMethods) - foreach (MethodDefinition method in type.Methods.Where (m => !m.IsConstructor)) { - MethodDefinition parent = null; - - //TODO: take in account generic params - if (!method.HasGenericParameters) { - - /* - * we need to scan base methods because the CoreCLR complains about SC attribs added - * to overriden methods whose base (virtual or interface) method is not marked as SC - * with TypeLoadExceptions - */ - parent = GetBaseMethod (type, method); - } - - //if there's no base method - if (parent == null || - - //if it's our bridge assembly, we're sure it will (finally, at the end of the linking process) have the SC attrib - _assembly.MainModule.Types.Contains (parent.DeclaringType) || - - //if the type is in the moonlight assemblies, check if it has the SC attrib - HasSecurityAttribute (parent, AttributeType.Critical)) - - AddCriticalAttribute (method); - } - - } - } - - MethodDefinition GetBaseMethod (TypeDefinition finalType, MethodDefinition final) - { - // both GetOverridenMethod and GetInterfaceMethod return null if there is no base method - return GetOverridenMethod (finalType, final) ?? GetInterfaceMethod (finalType, final); - } - - //note: will not return abstract methods - MethodDefinition GetOverridenMethod (TypeDefinition finalType, MethodDefinition final) - { - TypeReference baseType = finalType.BaseType; - while (baseType != null && baseType.Resolve () != null) { - foreach (MethodDefinition method in baseType.Resolve ().Methods) { - if (!method.IsVirtual || method.Name != final.Name) - continue; - - //TODO: should we discard them? - if (method.IsAbstract) - continue; - - if (HasSameSignature (method, final)) - return method; - } - baseType = baseType.Resolve().BaseType; - } - return null; - } - - MethodDefinition GetInterfaceMethod (TypeDefinition finalType, MethodDefinition final) - { - TypeDefinition baseType = finalType; - while (baseType != null) { - if (baseType.HasInterfaces) - foreach (var @interface in baseType.Interfaces) - foreach (MethodDefinition method in @interface.InterfaceType.Resolve ().Methods) - if (method.Name == final.Name && HasSameSignature (method, final)) - return method; - - baseType = baseType.BaseType == null ? null : baseType.BaseType.Resolve (); - } - return null; - } - - bool HasSameSignature (MethodDefinition method1, MethodDefinition method2) - { - if (method1.ReturnType.FullName != method2.ReturnType.FullName) - return false; - - if (method1.Parameters.Count != method2.Parameters.Count) - return false; - - for (int i = 0; i < method1.Parameters.Count; i++) { - if (method1.Parameters [i].ParameterType.FullName != - method2.Parameters [i].ParameterType.FullName) - return false; - } - - return true; - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yUsageInspectionStep.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightA11yUsageInspectionStep.cs deleted file mode 100644 index 27aa4a2ff4a..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/MoonlightA11yUsageInspectionStep.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// MoonlightA11yUsageInspectionStep.cs -// -// Author: -// Andrés G. Aragoneses (aaragoneses@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class MoonlightA11yUsageInspectionStep : MoonlightAssemblyStep { - - protected override void CustomizePipeline (Pipeline pipeline) - { - pipeline.ReplaceStep (typeof (MarkStep), new MoonlightA11yApiMarker ()); - pipeline.ReplaceStep (typeof (SweepStep), new MoonlightA11yDescriptorGenerator ()); - pipeline.RemoveStep (typeof (LoadI18nAssemblies)); - pipeline.RemoveStep (typeof (CleanStep)); - pipeline.RemoveStep (typeof (RegenerateGuidStep)); - pipeline.RemoveStep (typeof (OutputStep)); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/MoonlightAssemblyStep.cs b/mcs/tools/tuner/Mono.Tuner/MoonlightAssemblyStep.cs deleted file mode 100644 index fc98536f52f..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/MoonlightAssemblyStep.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// MoonlightAssemblyStep.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.IO; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class MoonlightAssemblyStep : IStep { - - public void Process (LinkContext context) - { - CustomizePipeline (context.Pipeline); - ProcessAssemblies (context); - } - - static void ProcessAssemblies (LinkContext context) - { - foreach (AssemblyDefinition assembly in context.GetAssemblies ()) - context.Annotations.SetAction (assembly, AssemblyAction.Link); - } - - protected virtual void CustomizePipeline (Pipeline pipeline) - { - pipeline.RemoveStep (typeof (LoadI18nAssemblies)); - pipeline.RemoveStep (typeof (BlacklistStep)); - pipeline.RemoveStep (typeof (TypeMapStep)); - pipeline.RemoveStep (typeof (MarkStep)); - pipeline.RemoveStep (typeof (SweepStep)); - pipeline.RemoveStep (typeof (CleanStep)); - pipeline.RemoveStep (typeof (RegenerateGuidStep)); - pipeline.AddStepBefore (typeof (OutputStep), new InjectSecurityAttributes ()); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/PreserveCrypto.cs b/mcs/tools/tuner/Mono.Tuner/PreserveCrypto.cs deleted file mode 100644 index 18dbe7ff251..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/PreserveCrypto.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace Mono.Tuner { - - public class PreserveCrypto : IStep { - - AnnotationStore annotations; - - public void Process (LinkContext context) - { - annotations = context.Annotations; - - ProcessCorlib (context); - ProcessSystemCore (context); - } - - void ProcessCorlib (LinkContext context) - { - AssemblyDefinition corlib; - if (!context.TryGetLinkedAssembly ("mscorlib", out corlib)) - return; - - AddPreserveInfo (corlib, "DES", "DESCryptoServiceProvider"); - AddPreserveInfo (corlib, "DSA", "DSACryptoServiceProvider"); - AddPreserveInfo (corlib, "RandomNumberGenerator", "RNGCryptoServiceProvider"); - AddPreserveInfo (corlib, "SHA1", "SHA1CryptoServiceProvider"); - AddPreserveInfo (corlib, "SHA1", "SHA1Managed"); - AddPreserveInfo (corlib, "MD5", "MD5CryptoServiceProvider"); - AddPreserveInfo (corlib, "RC2", "RC2CryptoServiceProvider"); - AddPreserveInfo (corlib, "TripleDES", "TripleDESCryptoServiceProvider"); - - AddPreserveInfo (corlib, "Rijndael", "RijndaelManaged"); - AddPreserveInfo (corlib, "RIPEMD160", "RIPEMD160Managed"); - AddPreserveInfo (corlib, "SHA256", "SHA256Managed"); - AddPreserveInfo (corlib, "SHA384", "SHA384Managed"); - AddPreserveInfo (corlib, "SHA512", "SHA512Managed"); - - AddPreserveInfo (corlib, "HMAC", "HMACMD5"); - AddPreserveInfo (corlib, "HMAC", "HMACRIPEMD160"); - AddPreserveInfo (corlib, "HMAC", "HMACSHA1"); - AddPreserveInfo (corlib, "HMAC", "HMACSHA256"); - AddPreserveInfo (corlib, "HMAC", "HMACSHA384"); - AddPreserveInfo (corlib, "HMAC", "HMACSHA512"); - - AddPreserveInfo (corlib, "HMACMD5", "MD5CryptoServiceProvider"); - AddPreserveInfo (corlib, "HMACRIPEMD160", "RIPEMD160Managed"); - AddPreserveInfo (corlib, "HMACSHA1", "SHA1CryptoServiceProvider"); - AddPreserveInfo (corlib, "HMACSHA1", "SHA1Managed"); - AddPreserveInfo (corlib, "HMACSHA256", "SHA256Managed"); - AddPreserveInfo (corlib, "HMACSHA384", "SHA384Managed"); - AddPreserveInfo (corlib, "HMACSHA512", "SHA512Managed"); - - TryAddPreserveInfo (corlib, "Aes", "AesManaged"); - - var corlibAes = GetCryptoType (corlib, "Aes"); - Preserve (corlibAes, GetCryptoType (corlib, "AesManaged")); - - AssemblyDefinition syscore; - if (context.TryGetLinkedAssembly ("System.Core", out syscore)) - Preserve (corlibAes, GetCryptoType (syscore, "AesCryptoServiceProvider")); - } - - void ProcessSystemCore (LinkContext context) - { - AssemblyDefinition syscore; - if (!context.TryGetLinkedAssembly ("System.Core", out syscore)) - return; - - // AddPreserveInfo (syscore, "Aes", "AesCryptoServiceProvider"); - TryAddPreserveInfo (syscore, "Aes", "AesManaged"); - } - - bool TryAddPreserveInfo (AssemblyDefinition assembly, string name, string type) - { - var marker = GetCryptoType (assembly, name); - if (marker == null) - return false; - - var implementation = GetCryptoType (assembly, type); - if (implementation == null) - return false; - - Preserve (marker, implementation); - return true; - } - - void AddPreserveInfo (AssemblyDefinition assembly, string name, string type) - { - var marker = GetCryptoType (assembly, name); - if (marker == null) - throw new ArgumentException (name); - - var implementation = GetCryptoType (assembly, type); - if (implementation == null) - throw new ArgumentException (type); - - Preserve (marker, implementation); - } - - void Preserve (TypeDefinition marker, TypeDefinition implementation) - { - if (marker == null || implementation == null) - return; - foreach (var constructor in implementation.GetConstructors ()) - annotations.AddPreservedMethod (marker, constructor); - } - - TypeDefinition GetCryptoType (AssemblyDefinition assembly, string name) - { - return assembly.MainModule.GetType ("System.Security.Cryptography." + name); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/PreserveHttps.cs b/mcs/tools/tuner/Mono.Tuner/PreserveHttps.cs deleted file mode 100644 index c3c56c79fc8..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/PreserveHttps.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.IO; -using System.Xml.XPath; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class PreserveHttps : BaseStep { - - static string [] types = new [] { - "System.Net.WebRequest", - "System.Net.WebClient", - "System.Net.Security.RemoteCertificateValidationCallback", - "System.Web.Services.Protocols.WebClientProtocol", - "System.Security.Cryptography.X509Certificates.X509Certificate", - "System.ServiceModel.ClientBase`1", - "System.Web.Services.WebServiceBindingAttribute", - "System.Web.Services.Protocols.SoapHttpClientProtocol", - "System.Xml.XmlDocument" - }; - - bool need_https; - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (need_https) - return; - - if (Profile.IsSdkAssembly (assembly) || Profile.IsProductAssembly (assembly)) - return; - - if (HasNeededReference (assembly.MainModule)) - need_https = true; - } - - static bool HasNeededReference (ModuleDefinition module) - { - foreach (var type in types) - if (module.HasTypeReference (type)) - return true; - - return false; - } - - protected override void EndProcess () - { - if (!need_https) - return; - - var mono_security = Context.Resolve ("Mono.Security"); - if (mono_security == null) - return; - - if (Annotations.GetAction (mono_security) != AssemblyAction.Link) - return; - - var xml_preserve = CreatePreserveStep (); - Context.Pipeline.AddStepAfter (typeof (PreserveHttps), xml_preserve); -// Context.Pipeline.AddStepAfter (xml_preserve, new PreserveCrypto ()); - } - - static IStep CreatePreserveStep () - { - return new ResolveFromXmlStep ( - new XPathDocument ( - new StringReader (descriptor))); - } - - const string descriptor = @" - - - - - - - -"; - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/PreserveSoapHttpClients.cs b/mcs/tools/tuner/Mono.Tuner/PreserveSoapHttpClients.cs deleted file mode 100644 index bdb04a94db2..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/PreserveSoapHttpClients.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; - -using Mono.Linker; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class PreserveSoapHttpClients : BaseSubStep { - - public override SubStepTargets Targets { - get { return SubStepTargets.Type; } - } - - public override bool IsActiveFor (AssemblyDefinition assembly) - { - return Annotations.GetAction (assembly) == AssemblyAction.Link && !Profile.IsSdkAssembly (assembly); - } - - public override void ProcessType (TypeDefinition type) - { - if (IsWebServiceClient (type)) - PreserveClient (type); - } - - void PreserveClient (TypeDefinition type) - { - if (!type.HasMethods) - return; - - foreach (MethodDefinition method in type.Methods) { - string sync_method; - if (!TryExtractSyncMethod (method, out sync_method)) - continue; - - AddPreservedMethod (method, sync_method); - } - } - - void AddPreservedMethod (MethodDefinition target, string methodName) - { - foreach (MethodDefinition method in target.DeclaringType.Methods) - if (method.Name == methodName) - Annotations.AddPreservedMethod (target, method); - } - - static bool TryExtractSyncMethod (MethodDefinition method, out string sync_method) - { - if (TryExtractPrefixedMethodName ("Begin", method.Name, out sync_method)) - return true; - - if (TryExtractPrefixedMethodName ("End", method.Name, out sync_method)) - return true; - - if (TryExtractSuffixedMethodName ("Async", method.Name, out sync_method)) - return true; - - return false; - } - - static bool TryExtractPrefixedMethodName (string prefix, string fullName, out string methodName) - { - methodName = null; - - int pos = fullName.IndexOf (prefix, StringComparison.Ordinal); - if (pos == -1) - return false; - - methodName = fullName.Substring (prefix.Length); - return true; - } - - static bool TryExtractSuffixedMethodName (string suffix, string fullName, out string methodName) - { - methodName = null; - - int pos = fullName.LastIndexOf (suffix, StringComparison.Ordinal); - if (pos == -1) - return false; - - methodName = fullName.Substring (0, pos); - return true; - } - - static bool IsWebServiceClient (TypeDefinition type) - { - return type.Inherits ("System.Web.Services.Protocols", "SoapHttpClientProtocol"); - } - } -} \ No newline at end of file diff --git a/mcs/tools/tuner/Mono.Tuner/PrintStatus.cs b/mcs/tools/tuner/Mono.Tuner/PrintStatus.cs deleted file mode 100644 index 374395bac8a..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/PrintStatus.cs +++ /dev/null @@ -1,86 +0,0 @@ -// -// PrintStatus.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class PrintStatus : BaseStep { - - static string display_internalized = "display_internalized"; - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - Console.WriteLine ("Assembly `{0}' ({1}) tuned", assembly.Name, assembly.MainModule.FullyQualifiedName); - - if (!DisplayInternalized ()) - return; - - foreach (TypeDefinition type in assembly.MainModule.Types) - ProcessType (type); - } - - bool DisplayInternalized () - { - try { - return bool.Parse (Context.GetParameter (display_internalized)); - } catch { - return false; - } - } - - void ProcessType (TypeDefinition type) - { - ProcessCollection (type.Fields); - ProcessCollection (type.Methods); - } - - void ProcessCollection (ICollection collection) - { - foreach (IMetadataTokenProvider provider in collection) - ProcessProvider (provider); - } - - void ProcessProvider (IMetadataTokenProvider provider) - { - if (!TunerAnnotations.IsInternalized (Context, provider)) - return; - - Console.WriteLine ("[internalized] {0}", provider); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/PrintTypeMap.cs b/mcs/tools/tuner/Mono.Tuner/PrintTypeMap.cs deleted file mode 100644 index 8838b1aede9..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/PrintTypeMap.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// PrintTypeMap.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2009 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Generic; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class PrintTypeMap : BaseStep { - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - foreach (TypeDefinition type in assembly.MainModule.GetAllTypes ()) - PrintMap (type); - } - - void PrintMap (TypeDefinition type) - { - if (!type.HasMethods) - return; - - Console.WriteLine ("Type {0} map", type); - - foreach (MethodDefinition method in type.Methods) { - if (!method.IsVirtual) - continue; - - Console.WriteLine (" Method {0} map", method); - - IEnumerable overrides = Annotations.GetOverrides (method); - foreach (var @override in overrides ?? new MethodDefinition [0]) - Console.WriteLine (" HasOverride {0}", @override); - - IEnumerable bases = Annotations.GetBaseMethods (method); - foreach (var @base in bases ?? new MethodDefinition [0]) - Console.WriteLine (" Base {0}", @base); - } - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/Profile.cs b/mcs/tools/tuner/Mono.Tuner/Profile.cs deleted file mode 100644 index 54cfffa64f1..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/Profile.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public abstract class Profile { - - static Profile current; - - public static Profile Current { - get { - if (current != null) - return current; - - current = CreateProfile ("MonoTouch"); - if (current != null) - return current; - - current = CreateProfile ("MonoDroid"); - if (current != null) - return current; - - current = CreateProfile ("MonoMac"); - if (current != null) - return current; - - throw new NotSupportedException ("No active profile"); - } - set { - current = value; - } - } - - static Profile CreateProfile (string name) - { - var type = Type.GetType (string.Format ("{0}.Tuner.{0}Profile", name)); - if (type == null) - return null; - - return (Profile) Activator.CreateInstance (type); - } - - public static bool IsSdkAssembly (AssemblyDefinition assembly) - { - return Current.IsSdk (assembly); - } - - public static bool IsSdkAssembly (string assemblyName) - { - return Current.IsSdk (assemblyName); - } - - public static bool IsProductAssembly (AssemblyDefinition assembly) - { - return Current.IsProduct (assembly); - } - - public static bool IsProductAssembly (string assemblyName) - { - return Current.IsProduct (assemblyName); - } - - protected virtual bool IsSdk (AssemblyDefinition assembly) - { - return IsSdk (assembly.Name.Name); - } - - protected virtual bool IsProduct (AssemblyDefinition assembly) - { - return IsProduct (assembly.Name.Name); - } - - protected abstract bool IsSdk (string assemblyName); - protected abstract bool IsProduct (string assemblyName); - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/RemoveAttributesBase.cs b/mcs/tools/tuner/Mono.Tuner/RemoveAttributesBase.cs deleted file mode 100644 index 61101809fd4..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/RemoveAttributesBase.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Tuner; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public abstract class RemoveAttributesBase : BaseSubStep { - - public override SubStepTargets Targets { - get { - return SubStepTargets.Assembly - | SubStepTargets.Type - | SubStepTargets.Field - | SubStepTargets.Method - | SubStepTargets.Property - | SubStepTargets.Event; - } - } - - public override bool IsActiveFor (AssemblyDefinition assembly) - { - return Annotations.GetAction (assembly) == AssemblyAction.Link; - } - - public override void ProcessAssembly (AssemblyDefinition assembly) - { - ProcessAttributeProvider (assembly); - ProcessAttributeProvider (assembly.MainModule); - } - - public override void ProcessType (TypeDefinition type) - { - ProcessAttributeProvider (type); - - if (type.HasGenericParameters) - ProcessAttributeProviderCollection (type.GenericParameters); - } - - void ProcessAttributeProviderCollection (IList list) - { - for (int i = 0; i < list.Count; i++) - ProcessAttributeProvider ((ICustomAttributeProvider) list [i]); - } - - public override void ProcessField (FieldDefinition field) - { - ProcessAttributeProvider (field); - } - - public override void ProcessMethod (MethodDefinition method) - { - ProcessMethodAttributeProvider (method); - } - - void ProcessMethodAttributeProvider (MethodDefinition method) - { - ProcessAttributeProvider (method); - ProcessAttributeProvider (method.MethodReturnType); - - if (method.HasParameters) - ProcessAttributeProviderCollection (method.Parameters); - - if (method.HasGenericParameters) - ProcessAttributeProviderCollection (method.GenericParameters); - } - - public override void ProcessProperty (PropertyDefinition property) - { - ProcessAttributeProvider (property); - } - - public override void ProcessEvent (EventDefinition @event) - { - ProcessAttributeProvider (@event); - } - - void ProcessAttributeProvider (ICustomAttributeProvider provider) - { - if (!provider.HasCustomAttributes) - return; - - for (int i = 0; i < provider.CustomAttributes.Count; i++) { - var attrib = provider.CustomAttributes [i]; - if (!IsRemovedAttribute (attrib)) - continue; - - WillRemoveAttribute (provider, attrib); - provider.CustomAttributes.RemoveAt (i--); - } - } - - protected abstract bool IsRemovedAttribute (CustomAttribute attribute); - protected virtual void WillRemoveAttribute (ICustomAttributeProvider provider, CustomAttribute attribute) { } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/RemoveResources.cs b/mcs/tools/tuner/Mono.Tuner/RemoveResources.cs deleted file mode 100644 index 7edc44f0316..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/RemoveResources.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class RemoveResources : IStep { - - readonly I18nAssemblies assemblies; - - public RemoveResources (I18nAssemblies assemblies) - { - this.assemblies = assemblies; - } - - public virtual void Process (LinkContext context) - { - AssemblyDefinition assembly; - if (!context.TryGetLinkedAssembly ("mscorlib", out assembly)) - return; - - // skip this if we're not linking mscorlib, e.g. --linkskip=mscorlib - if (context.Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - var resources = assembly.MainModule.Resources; - - for (int i = 0; i < resources.Count; i++) { - var resource = resources [i] as EmbeddedResource; - if (resource == null) - continue; - - switch (resource.Name) { - case "collation.core.bin": - case "collation.tailoring.bin": - continue; - default: - if (!resource.Name.Contains ("cjk")) - continue; - if (IncludeCJK ()) - continue; - - resources.RemoveAt (i--); - break; - } - } - } - - bool IncludeCJK () - { - return (assemblies & I18nAssemblies.CJK) != 0; - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/RemoveSecurity.cs b/mcs/tools/tuner/Mono.Tuner/RemoveSecurity.cs deleted file mode 100644 index 2704564a65e..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/RemoveSecurity.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class RemoveSecurity : BaseSubStep { - - public override SubStepTargets Targets { - get { - return SubStepTargets.Assembly - | SubStepTargets.Type - | SubStepTargets.Method; - } - } - - public override bool IsActiveFor (AssemblyDefinition assembly) - { - return Annotations.GetAction (assembly) == AssemblyAction.Link; - } - - public override void ProcessAssembly (AssemblyDefinition assembly) - { - ProcessSecurityProvider (assembly); - } - - public override void ProcessType (TypeDefinition type) - { - ProcessSecurityProvider (type); - } - - public override void ProcessMethod (MethodDefinition method) - { - ProcessSecurityProvider (method); - } - - static void ProcessSecurityProvider (ISecurityDeclarationProvider provider) - { - if (!provider.HasSecurityDeclarations) - return; - - provider.SecurityDeclarations.Clear (); - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/RemoveSerialization.cs b/mcs/tools/tuner/Mono.Tuner/RemoveSerialization.cs deleted file mode 100644 index d38aef196c0..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/RemoveSerialization.cs +++ /dev/null @@ -1,149 +0,0 @@ -// -// RemoveSerialization.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; - -namespace Mono.Tuner { - - public class RemoveSerialization : BaseStep { - - static readonly string _Serialization = "System.Runtime.Serialization"; - static readonly string _ISerializable = Concat (_Serialization, "ISerializable"); - static readonly string _IDeserializationCallback = Concat (_Serialization, "IDeserializationCallback"); - static readonly string _SerializationInfo = Concat (_Serialization, "SerializationInfo"); - static readonly string _StreamingContext = Concat (_Serialization, "StreamingContext"); - - static readonly string _GetObjectData = "GetObjectData"; - static readonly string _OnDeserialization = "OnDeserialization"; - - static string Concat (string lhs, string rhs) - { - return string.Concat (lhs, ".", rhs); - } - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (assembly.Name.Name == "mscorlib") - return; - - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - foreach (ModuleDefinition module in assembly.Modules) - foreach (TypeDefinition type in module.Types) - ProcessType (type); - } - - static void RemoveInterface (TypeDefinition type, string name) - { - for (int i = 0; i < type.Interfaces.Count; i++) { - TypeReference iface = type.Interfaces [i].InterfaceType; - if (iface.FullName == name) { - type.Interfaces.RemoveAt (i); - return; - } - } - } - - static void RemoveSerializableFlag (TypeDefinition type) - { - type.Attributes &= ~TypeAttributes.Serializable; - } - - static void ProcessType (TypeDefinition type) - { - RemoveSerializableFlag (type); - - RemoveInterface (type, _ISerializable); - RemoveMethod (type, ".ctor", _SerializationInfo, _StreamingContext); - RemoveInterfaceMethod (type, _ISerializable, _GetObjectData, _SerializationInfo, _StreamingContext); - - RemoveInterface (type, _IDeserializationCallback); - RemoveInterfaceMethod (type, _IDeserializationCallback, _OnDeserialization, "System.Object"); - - RemoveField (type); - } - - static void RemoveField (TypeDefinition type) - { - for (int i = 0; i < type.Fields.Count; i++) { - FieldDefinition field = type.Fields [i]; - if (field.FieldType.FullName == _SerializationInfo) { - type.Fields.RemoveAt (i); - break; - } - } - } - - static bool ParametersMatch (IMethodSignature meth, string [] parameters) - { - for (int i = 0; i < parameters.Length; i++) { - ParameterDefinition param = meth.Parameters [i]; - if (param.ParameterType.FullName != parameters [i]) - return false; - } - - return true; - } - - static void RemoveInterfaceMethod (TypeDefinition type, string iface, string method, params string [] parameters) - { - RemoveMethod (type, method, parameters); - RemoveMethod (type, Concat (iface, method), parameters); - } - - static void RemoveMethod (TypeDefinition type, string name, params string [] parameters) - { - RemoveMethod (type.Methods, name, parameters); - } - - static void RemoveMethod (IList container, string name, params string [] parameters) - { - for (int i = 0; i < container.Count; i++) { - MethodDefinition method = (MethodDefinition) container [i]; - if (method.Name != name) - continue; - - if (method.Parameters.Count != parameters.Length) - continue; - - if (!ParametersMatch (method, parameters)) - continue; - - container.RemoveAt (i); - return; - } - } - } -} diff --git a/mcs/tools/tuner/Mono.Tuner/TunerAnnotations.cs b/mcs/tools/tuner/Mono.Tuner/TunerAnnotations.cs deleted file mode 100644 index 2107ac4a0f5..00000000000 --- a/mcs/tools/tuner/Mono.Tuner/TunerAnnotations.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// TunerAnnotations.cs -// -// Author: -// Jb Evain (jbevain@novell.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using Mono.Cecil; -using Mono.Linker; - -namespace Mono.Tuner { - - public class TunerAnnotations { - - static readonly object _internalizedKey = new object (); - - public static void Internalized (LinkContext context, IMetadataTokenProvider provider) - { - var annotations = context.Annotations.GetCustomAnnotations (_internalizedKey); - annotations [provider] = _internalizedKey; - } - - public static bool IsInternalized (LinkContext context, IMetadataTokenProvider provider) - { - var annotations = context.Annotations.GetCustomAnnotations (_internalizedKey); - - return annotations.ContainsKey (provider); - } - - private TunerAnnotations () - { - } - } -} diff --git a/mcs/tools/tuner/MonoMac.Tuner/ApplyPreserveAttribute.cs b/mcs/tools/tuner/MonoMac.Tuner/ApplyPreserveAttribute.cs deleted file mode 100644 index d7c49b88677..00000000000 --- a/mcs/tools/tuner/MonoMac.Tuner/ApplyPreserveAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Tuner; - -using Mono.Cecil; - -namespace MonoMac.Tuner { - - public class ApplyPreserveAttribute : ApplyPreserveAttributeBase { - - protected override string PreserveAttribute { - get { return "MonoMac.Foundation.PreserveAttribute"; } - } - } -} diff --git a/mcs/tools/tuner/MonoMac.Tuner/Extensions.cs b/mcs/tools/tuner/MonoMac.Tuner/Extensions.cs deleted file mode 100644 index ec7fd1f8d19..00000000000 --- a/mcs/tools/tuner/MonoMac.Tuner/Extensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; - -using Mono.Cecil; - -using Mono.Linker; - -using Mono.Tuner; - -namespace MonoMac.Tuner { - - static class Extensions { - - const string NSObject = "MonoMac.Foundation.NSObject"; - const string INativeObject = "MonoMac.ObjCRuntime.INativeObject"; - - public static bool IsNSObject (this TypeDefinition type) - { - return type.Inherits (NSObject); - } - - public static bool IsNativeObject (this TypeDefinition type) - { - return type.Implements (INativeObject); - } - } -} diff --git a/mcs/tools/tuner/MonoMac.Tuner/MarkNSObjects.cs b/mcs/tools/tuner/MonoMac.Tuner/MarkNSObjects.cs deleted file mode 100644 index 163deccbbbc..00000000000 --- a/mcs/tools/tuner/MonoMac.Tuner/MarkNSObjects.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// MarkNSObjects.cs -// -// Authors: -// Jb Evain (jbevain@novell.com) -// Sebastien Pouliot -// -// (C) 2009 Novell, Inc. -// Copyright (C) 2011 Xamarin, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -using Mono.Tuner; - -using Mono.Cecil; - -namespace MonoMac.Tuner { - - public class MarkNSObjects : MarkNSObjectsBase { - - protected override string ExportAttribute { - get { return "MonoMac.Foundation.ExportAttribute"; } - } - - public override void ProcessType (TypeDefinition type) - { - if (!type.IsNSObject () || !type.IsNativeObject ()) - return; - - base.ProcessType (type); - } - } -} diff --git a/mcs/tools/tuner/MonoMac.Tuner/MethodMapInjection.cs b/mcs/tools/tuner/MonoMac.Tuner/MethodMapInjection.cs deleted file mode 100644 index ebb24073ab0..00000000000 --- a/mcs/tools/tuner/MonoMac.Tuner/MethodMapInjection.cs +++ /dev/null @@ -1,382 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Tuner; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -namespace MonoMac.Tuner { - - public class MethodMapInjection : BaseStep { - - struct ExportedMethod { - public readonly CustomAttribute attribute; - public readonly MethodDefinition method; - - public ExportedMethod (CustomAttribute attribute, MethodDefinition method) - { - this.attribute = attribute; - this.method = method; - } - } - - ModuleDefinition module; - - bool imported; - TypeReference void_type; - TypeReference dictionary_intptr_methoddesc; - MethodReference dictionary_intptr_methoddesc_ctor; - MethodReference dictionary_intptr_methoddesc_set_item; - MethodReference methoddesc_ctor; - MethodReference selector_get_handle; - MethodReference methodbase_get_method_from_handle; - MethodReference class_register_methods; - MethodReference type_get_type_from_handle; - FieldReference selector_init; - - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - if (Annotations.GetAction (assembly) != AssemblyAction.Link) - return; - - module = assembly.MainModule; - - foreach (TypeDefinition type in module.GetAllTypes ()) { - if (!type.IsNSObject ()) - continue; - - ProcessNSObject (type); - } - - imported = false; - } - - void PrepareImports () - { - if (imported) - return; - - var corlib = Context.GetAssembly ("mscorlib"); - - void_type = Import (corlib, "System.Void"); - - var monomac = Context.GetAssembly ("MonoMac"); - - var dictionary = Import (corlib, "System.Collections.Generic.Dictionary`2"); - - var intptr = Import (corlib, "System.IntPtr"); - var method_desc = Import (monomac, "MonoMac.ObjCRuntime.MethodDescription"); - - var dic_i_md = new GenericInstanceType (dictionary); - dic_i_md.GenericArguments.Add (intptr); - dic_i_md.GenericArguments.Add (method_desc); - dictionary_intptr_methoddesc = dic_i_md; - - dictionary_intptr_methoddesc_ctor = Import (".ctor", dic_i_md, false, void_type, Import (corlib, "System.Int32")); - - dictionary_intptr_methoddesc_set_item = Import ("set_Item", dic_i_md, false, void_type, - dictionary.GenericParameters [0], - dictionary.GenericParameters [1]); - - methoddesc_ctor = Import (".ctor", method_desc, false, void_type, - Import (corlib, "System.Reflection.MethodBase"), - Import (monomac, "MonoMac.ObjCRuntime.ArgumentSemantic")); - - var selector = Import (monomac, "MonoMac.ObjCRuntime.Selector"); - - selector_get_handle = Import ("GetHandle", selector, true, intptr, Import (corlib, "System.String")); - selector_init = new FieldReference ("Init", selector, intptr); - - var methodbase = Import (corlib, "System.Reflection.MethodBase"); - - methodbase_get_method_from_handle = Import ("GetMethodFromHandle", methodbase, true, methodbase, Import (corlib, "System.RuntimeMethodHandle")); - - var type = Import (corlib, "System.Type"); - - type_get_type_from_handle = Import ("GetTypeFromHandle", type, true, type, Import (corlib, "System.RuntimeTypeHandle")); - - var @class = Import (monomac, "MonoMac.ObjCRuntime.Class"); - - class_register_methods = Import ("RegisterMethods", @class, true, void_type, type, dic_i_md); - - imported = true; - } - - MethodReference Import (string name, TypeReference declaring_type, bool @static, TypeReference return_type, params TypeReference [] parameters_type) - { - var reference = new MethodReference (name, return_type, declaring_type) { - HasThis = !@static, - ExplicitThis = false, - CallingConvention = MethodCallingConvention.Default, - }; - - foreach (var parameter_type in parameters_type) - reference.Parameters.Add (new ParameterDefinition (parameter_type)); - - return reference; - } - - TypeReference Import (TypeReference type) - { - return module.Import (type); - } - - TypeReference Import (AssemblyDefinition assembly, string type_name) - { - return Import (assembly.MainModule.GetType (type_name)); - } - - void ProcessNSObject (TypeDefinition type) - { - var exported = new List (); - - if (type.HasMethods) { - ProcessMethods (type, exported); - ProcessConstructors (type, exported); - } - - if (exported.Count == 0) - return; - - InjectMethodMap (type, exported); - } - - void InjectMethodMap (TypeDefinition type, List exported_methods) - { - PrepareImports (); - - var cctor = GetTypeConstructor (type); - - var selectors = MapSelectors (cctor); - - var map = new VariableDefinition (dictionary_intptr_methoddesc); - map.Name = "$method_map"; - cctor.Body.Variables.Add (map); - cctor.Body.SimplifyMacros (); - - var il = cctor.Body.GetILProcessor (); - - var instructions = new List { - il.Create (OpCodes.Ldc_I4, exported_methods.Count), - il.Create (OpCodes.Newobj, dictionary_intptr_methoddesc_ctor), - il.Create (OpCodes.Stloc, map), - }; - - foreach (var exported in exported_methods) { - - instructions.Add (il.Create (OpCodes.Ldloc, map)); - - if (!IsDefaultConstructor (exported)) { - var selector_name = GetSelectorName (exported); - FieldReference selector; - - if (selectors != null && selectors.TryGetValue (selector_name, out selector)) { - instructions.Add (il.Create (OpCodes.Ldsfld, selector)); - } else { - instructions.AddRange (new [] { - il.Create (OpCodes.Ldstr, selector_name), - il.Create (OpCodes.Call, selector_get_handle), - }); - } - } else - instructions.Add (il.Create (OpCodes.Ldsfld, selector_init)); - - instructions.AddRange (new [] { - il.Create (OpCodes.Ldtoken, exported.method), - il.Create (OpCodes.Call, methodbase_get_method_from_handle), - il.Create (OpCodes.Ldc_I4, GetArgumentSemantic (exported)), - il.Create (OpCodes.Newobj, methoddesc_ctor), - il.Create (OpCodes.Callvirt, dictionary_intptr_methoddesc_set_item), - }); - } - - instructions.AddRange (new [] { - il.Create (OpCodes.Ldtoken, type), - il.Create (OpCodes.Call, type_get_type_from_handle), - il.Create (OpCodes.Ldloc, map), - il.Create (OpCodes.Call, class_register_methods), - }); - - Append (il, instructions); - - cctor.Body.OptimizeMacros (); - } - - static Dictionary MapSelectors (MethodDefinition cctor) - { - var instructions = cctor.Body.Instructions; - Dictionary selectors = null; - - for (int i = 0; i < instructions.Count; i++) { - var instruction = instructions [i]; - - FieldReference field; - if (!IsCreateSelector (instruction, out field)) - continue; - - if (selectors == null) - selectors = new Dictionary (); - - selectors.Add ((string) instruction.Operand, field); - } - - return selectors; - } - - static bool IsCreateSelector (Instruction instruction, out FieldReference field) - { - field = null; - - if (instruction.OpCode != OpCodes.Ldstr) - return false; - - if (instruction.Next == null) - return false; - - instruction = instruction.Next; - - if (instruction.OpCode != OpCodes.Call) - return false; - - var method = (MethodReference) instruction.Operand; - if (method.DeclaringType.Name != "Selector") - return false; - - if (method.Name != "GetHandle" && method.Name != "sel_registerName") - return false; - - if (instruction.Next == null) - return false; - - instruction = instruction.Next; - - if (instruction.OpCode != OpCodes.Stsfld) - return false; - - field = instruction.Operand as FieldReference; - return true; - } - - static bool IsDefaultConstructor (ExportedMethod exported) - { - return exported.attribute == null && exported.method.IsConstructor && !exported.method.IsStatic; - } - - static void Append (ILProcessor il, IEnumerable instructions) - { - var method_instructions = il.Body.Instructions; - var last = method_instructions [method_instructions.Count - 1]; - - foreach (var instruction in instructions) - il.InsertBefore (last, instruction); - } - - static int GetArgumentSemantic (ExportedMethod exported) - { - if (exported.attribute == null) - return 0; // Assign - - var arguments = exported.attribute.ConstructorArguments; - - if (arguments.Count == 2) - return (int) arguments [1].Value; - - if (arguments.Count == 1) - return -1; // None - - return 0; // Assign - } - - static string GetSelectorName (ExportedMethod exported) - { - var arguments = exported.attribute.ConstructorArguments; - - if (arguments.Count == 0) - return exported.method.Name; - - return (string) arguments [0].Value; - } - - MethodDefinition GetTypeConstructor (TypeDefinition type) - { - return type.GetTypeConstructor () ?? CreateTypeConstructor (type); - } - - MethodDefinition CreateTypeConstructor (TypeDefinition type) - { - var cctor = new MethodDefinition (".cctor", MethodAttributes.Private | MethodAttributes.Static | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, void_type); - cctor.Body.GetILProcessor ().Emit (OpCodes.Ret); - - type.Methods.Add (cctor); - - return cctor; - } - - void ProcessConstructors (TypeDefinition type, List exported) - { - foreach (MethodDefinition ctor in type.GetConstructors ()) { - if (!ctor.HasParameters && !ctor.IsStatic) { - exported.Add (new ExportedMethod (null, ctor)); - continue; - } - - CustomAttribute export; - if (!TryGetExportAttribute (ctor, out export)) - continue; - - exported.Add (new ExportedMethod (export, ctor)); - } - } - - static bool TryGetExportAttribute (MethodDefinition method, out CustomAttribute export) - { - export = null; - - if (!method.HasCustomAttributes) - return false; - - foreach (CustomAttribute attribute in method.CustomAttributes) { - if (attribute.AttributeType.FullName != "MonoMac.Foundation.ExportAttribute") - continue; - - export = attribute; - return true; - } - - return false; - } - - void ProcessMethods (TypeDefinition type, List exported) - { - foreach (MethodDefinition method in type.GetMethods ()) { - CustomAttribute attribute; - if (TryGetExportAttribute (method, out attribute)) { - exported.Add (new ExportedMethod (attribute, method)); - continue; - } - - if (!method.IsVirtual) - continue; - - var bases = Annotations.GetBaseMethods (method); - if (bases == null) - continue; - - foreach (MethodDefinition @base in bases) { - if (@base.DeclaringType.IsInterface) - continue; - - if (TryGetExportAttribute (@base, out attribute)) { - exported.Add (new ExportedMethod (attribute, method)); - break; - } - } - } - } - } -} diff --git a/mcs/tools/tuner/MonoMac.Tuner/MonoMac.xml b/mcs/tools/tuner/MonoMac.Tuner/MonoMac.xml deleted file mode 100644 index 9a078c88786..00000000000 --- a/mcs/tools/tuner/MonoMac.Tuner/MonoMac.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mcs/tools/tuner/MonoMac.Tuner/MonoMacProfile.cs b/mcs/tools/tuner/MonoMac.Tuner/MonoMacProfile.cs deleted file mode 100644 index 0692e481e7a..00000000000 --- a/mcs/tools/tuner/MonoMac.Tuner/MonoMacProfile.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using System.Collections.Generic; - -using Mono.Tuner; - -using Mono.Cecil; - -namespace MonoMac.Tuner { - - class MonoMacProfile : Profile { - - static readonly HashSet Sdk = new HashSet { - "mscorlib", - "I18N.CJK", - "I18N", - "I18N.MidEast", - "I18N.Other", - "I18N.Rare", - "I18N.West", - "Microsoft.Build.Engine", - "Microsoft.Build.Framework", - "Microsoft.Build.Tasks.v4.0", - "Microsoft.Build.Utilities.v4.0", - "Microsoft.CSharp", - "Microsoft.Web.Infrastructure", - "Mono.C5", - "Mono.Cairo", - "Mono.CodeContracts", - "Mono.CompilerServices.SymbolWriter", - "Mono.Configuration.Crypto", - "Mono.CSharp", - "Mono.Data.Sqlite", - "Mono.Data.Tds", - "Mono.Debugger.Soft", - "Mono.Http", - "Mono.Management", - "Mono.Messaging", - "Mono.Messaging.RabbitMQ", - "Mono.Options", - "Mono.Parallel", - "Mono.Posix", - "Mono.Security", - "Mono.Security.Win32", - "Mono.Simd", - "Mono.Tasklets", - "Mono.Tuner", - "Mono.WebBrowser", - "Mono.Web", - "Novell.Directory.Ldap", - "Npgsql", - "OpenSystem.C", - "PEAPI", - "System.ComponentModel.Composition", - "System.ComponentModel.DataAnnotations", - "System.Configuration", - "System.Configuration.Install", - "System.Core", - "System.Data.DataSetExtensions", - "System.Data", - "System.Data.Linq", - "System.Data.OracleClient", - "System.Data.Services.Client", - "System.Data.Services", - "System.Design", - "System.DirectoryServices", - "System", - "System.Drawing.Design", - "System.Drawing", - "System.Dynamic", - "System.EnterpriseServices", - "System.IdentityModel", - "System.IdentityModel.Selectors", - "System.Management", - "System.Messaging", - "System.Net", - "System.Numerics", - "System.Runtime.Caching", - "System.Runtime.DurableInstancing", - "System.Runtime.Remoting", - "System.Runtime.Serialization", - "System.Runtime.Serialization.Formatters.Soap", - "System.Security", - "System.ServiceModel.Discovery", - "System.ServiceModel", - "System.ServiceModel.Routing", - "System.ServiceModel.Web", - "System.ServiceProcess", - "System.Transactions", - "System.Web.Abstractions", - "System.Web.ApplicationServices", - "System.Web", - "System.Web.DynamicData", - "System.Web.Extensions.Design", - "System.Web.Extensions", - "System.Web.Routing", - "System.Web.Services", - "System.Windows.Forms.DataVisualization", - "System.Windows.Forms", - "System.Xaml", - "System.Xml", - "System.Xml.Linq", - "WebMatrix.Data", - "WindowsBase", - "Microsoft.VisualBasic", - }; - - protected override bool IsSdk (AssemblyDefinition assembly) - { - return Sdk.Contains (assembly.Name.Name); - } - - protected override bool IsProduct (AssemblyDefinition assembly) - { - return assembly.Name.Name == "MonoMac"; - } - } -} diff --git a/mcs/tools/tuner/MonoMac.Tuner/RemoveSelectors.cs b/mcs/tools/tuner/MonoMac.Tuner/RemoveSelectors.cs deleted file mode 100644 index 0c201aecebc..00000000000 --- a/mcs/tools/tuner/MonoMac.Tuner/RemoveSelectors.cs +++ /dev/null @@ -1,189 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -using Mono.Linker; -using Mono.Linker.Steps; - -using Mono.Cecil; -using Mono.Cecil.Cil; - -using Mono.Tuner; - -namespace MonoMac.Tuner { - - public class RemoveSelectors : IStep { - - public void Process (LinkContext context) - { - AssemblyDefinition monomac; - if (!context.TryGetLinkedAssembly ("MonoMac", out monomac)) - return; - - foreach (TypeDefinition type in monomac.MainModule.Types) { - if (!type.IsNSObject ()) - continue; - - ProcessNSObject (type); - } - } - - static void ProcessNSObject (TypeDefinition type) - { - var selectors = PopulateSelectors (type); - if (selectors == null) - return; - - foreach (var method in CollectMethods (type)) - CheckSelectorUsage (method, selectors); - - if (selectors.Count == 0) - return; - - PatchStaticConstructor (type, selectors); - RemoveUnusedSelectors (type, selectors); - } - - static void CheckSelectorUsage (MethodDefinition method, HashSet selectors) - { - if (!method.HasBody) - return; - - foreach (Instruction instruction in method.Body.Instructions) { - switch (instruction.OpCode.OperandType) { - case OperandType.InlineTok: - case OperandType.InlineField: - var field = instruction.Operand as FieldDefinition; - if (field == null) - continue; - - if (selectors.Contains (field)) - selectors.Remove (field); - - break; - } - } - } - - static void PatchStaticConstructor (TypeDefinition type, HashSet selectors) - { - var cctor = type.GetTypeConstructor (); - if (cctor == null || !cctor.HasBody) - return; - - var instructions = cctor.Body.Instructions; - - for (int i = 0; i < instructions.Count; i++) { - var instruction = instructions [i]; - if (!IsCreateSelector (instruction, selectors)) - continue; - - instructions.RemoveAt (i--); - instructions.RemoveAt (i--); - instructions.RemoveAt (i--); - } - } - - static bool IsCreateSelector (Instruction instruction, HashSet selectors) - { - if (instruction.OpCode != OpCodes.Stsfld) - return false; - - var field = instruction.Operand as FieldDefinition; - if (field == null) - return false; - - if (!selectors.Contains (field)) - return false; - - instruction = instruction.Previous; - if (instruction == null) - return false; - - if (instruction.OpCode != OpCodes.Call) - return false; - - if (!IsRegisterSelector (instruction.Operand as MethodReference)) - return false; - - instruction = instruction.Previous; - if (instruction == null) - return false; - - if (instruction.OpCode != OpCodes.Ldstr) - return false; - - return true; - } - - static bool IsRegisterSelector (MethodReference method) - { - if (method == null) - return false; - - if (method.Name != "GetHandle" && method.Name != "sel_registerName") - return false; - - if (method.DeclaringType.FullName != "MonoMac.ObjCRuntime.Selector") - return false; - - return true; - } - - static void RemoveUnusedSelectors (TypeDefinition type, HashSet selectors) - { - var fields = type.Fields; - - for (int i = 0; i < fields.Count; i++) - if (selectors.Contains (fields [i])) - fields.RemoveAt (i--); - } - - static HashSet PopulateSelectors (TypeDefinition type) - { - if (!type.HasFields) - return null; - - HashSet selectors = null; - - foreach (FieldDefinition field in type.Fields) { - if (!IsSelector (field)) - continue; - - if (selectors == null) - selectors = new HashSet (); - - selectors.Add (field); - } - - return selectors; - } - - static bool IsSelector (FieldDefinition field) - { - if (!field.IsStatic) - return false; - - if (field.FieldType.FullName != "System.IntPtr") - return false; - - if (!field.Name.StartsWith ("sel")) - return false; - - return true; - } - - static IEnumerable CollectMethods (TypeDefinition type) - { - if (!type.HasMethods) - yield break; - - foreach (MethodDefinition method in type.Methods) { - if (method.IsStatic && method.IsConstructor) - continue; - - yield return method; - } - } - } -} -- 2.25.1