[mono/mono] 294f999c: Revert my last two commits; these would require a new cecil.
| Newsgroups | gmane.comp.gnome.mono.patches |
|---|---|
| Message-ID | <00000141f1b11d6d-c799eb72-7844-4ada-875a-eaef8444343e-000000@email.amazonses.com> |
Branch: refs/heads/mono-3.2.4-branch
Home: https://github.com/mono/mono
Compare: https://github.com/mono/mono/compare/b31c9486e3dd...294f999c3f1b
Commit: 294f999c3f1b5ef7c5e1f4e96b1032e618fde6b2
Author: Martin Baulig <[email protected]> (baulig)
Date: 2013-10-25 22:14:23 GMT
URL: https://github.com/mono/mono/commit/294f999c3f1b5ef7c5e1f4e96b1032e618fde6b2
Revert my last two commits; these would require a new cecil.
This reverts commits c29ac46c408aa2ae588548fa36a0aa9bf0b01014
and b31c9486e3dddb70cc877962a51e3bbe476c42eb.
Changed paths:
M mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs
Modified: mcs/tools/linker/Mono.Linker.Steps/SweepStep.cs
===================================================================
@@ -37,7 +37,6 @@ namespace Mono.Linker.Steps {
public class SweepStep : BaseStep {
AssemblyDefinition [] assemblies;
- HashSet<AssemblyDefinition> resolvedTypeReferences;
protected override void Process ()
{
@@ -103,51 +102,15 @@ void SweepReferences (AssemblyDefinition assembly, AssemblyDefinition target)
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:
+ if (Annotations.GetAction (assembly) == 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;
}
}
- void ResolveAllTypeReferences (AssemblyDefinition assembly)
- {
- if (resolvedTypeReferences == null)
- resolvedTypeReferences = new HashSet<AssemblyDefinition> ();
- if (resolvedTypeReferences.Contains (assembly))
- return;
- resolvedTypeReferences.Add (assembly);
-
- var hash = new Dictionary<TypeReference,IMetadataScope> ();
-
- foreach (TypeReference tr in assembly.MainModule.GetTypeReferences ()) {
- if (hash.ContainsKey (tr))
- continue;
- var td = tr.Resolve ();
- // at this stage reference might include things that can't be resolved
- var scope = td == null ? null : assembly.MainModule.Import (td).Scope;
- hash.Add (tr, 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;
- }
- }
-
void SweepType (TypeDefinition type)
{
if (type.HasFields)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches