Skip to content

Commit

Permalink
Delete AvailableType/ExternalTypeNode (dotnet#2218)
Browse files Browse the repository at this point in the history
These nodes didn't do anything.
  • Loading branch information
MichalStrehovsky authored Jan 27, 2020
1 parent f4ed927 commit e325870
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 219 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,5 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer

return _signatureContext.CompareTo(otherNode._signatureContext, comparer);
}

protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory)
{
DependencyList dependencies = new DependencyList();
dependencies.Add(factory.NecessaryTypeSymbol(_fieldDesc.OwningType), "Type referenced in a fixup signature");
return dependencies;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,5 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer

return _signatureContext.CompareTo(otherNode._signatureContext, comparer);
}

protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory)
{
DependencyList dependencies = new DependencyList();
if (_typeArgument != null && !_typeArgument.IsRuntimeDeterminedSubtype)
{
dependencies.Add(factory.NecessaryTypeSymbol(_typeArgument), "Type referenced in a generic lookup signature");
}
return dependencies;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,5 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer

return _signatureContext.CompareTo(otherNode._signatureContext, comparer);
}

protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory)
{
DependencyList dependencies = new DependencyList();
dependencies.Add(factory.NecessaryTypeSymbol(_arrayType.ElementType), "Type used as array element");
return dependencies;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,5 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer

return _signatureContext.CompareTo(otherNode._signatureContext, comparer);
}

protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory)
{
DependencyList dependencies = new DependencyList();
dependencies.Add(factory.ConstructedTypeSymbol(_typeDesc), "Type constructed through new object fixup");
return dependencies;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,5 @@ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer

return _signatureContext.CompareTo(otherNode._signatureContext, comparer);
}

protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory)
{
DependencyList dependencies = new DependencyList();
dependencies.Add(factory.NecessaryTypeSymbol(_typeDesc), "Type referenced in a fixup signature");
return dependencies;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@

namespace ILCompiler.DependencyAnalysis
{
// TODO-REFACTOR: rename this
public interface IEETypeNode
{
TypeDesc Type { get; }
}

public struct NodeCache<TKey, TValue>
{
private Func<TKey, TValue> _creator;
Expand Down Expand Up @@ -87,8 +81,6 @@ public void SetMarkingComplete()

private void CreateNodeCaches()
{
_typeSymbols = new NodeCache<TypeDesc, IEETypeNode>(CreateNecessaryTypeNode);
_constructedTypeSymbols = new NodeCache<TypeDesc, IEETypeNode>(CreateConstructedTypeNode);
_methodEntrypoints = new NodeCache<MethodDesc, IMethodNode>(CreateMethodEntrypointNode);
_genericReadyToRunHelpersFromDict = new NodeCache<ReadyToRunGenericHelperKey, ISymbolNode>(CreateGenericLookupFromDictionaryNode);
_genericReadyToRunHelpersFromType = new NodeCache<ReadyToRunGenericHelperKey, ISymbolNode>(CreateGenericLookupFromTypeNode);
Expand All @@ -103,28 +95,10 @@ private void CreateNodeCaches()

protected abstract IMethodNode CreateMethodEntrypointNode(MethodDesc method);

protected abstract IEETypeNode CreateNecessaryTypeNode(TypeDesc type);

protected abstract IEETypeNode CreateConstructedTypeNode(TypeDesc type);

protected abstract ISymbolNode CreateGenericLookupFromDictionaryNode(ReadyToRunGenericHelperKey helperKey);

protected abstract ISymbolNode CreateGenericLookupFromTypeNode(ReadyToRunGenericHelperKey helperKey);

private NodeCache<TypeDesc, IEETypeNode> _typeSymbols;

public IEETypeNode NecessaryTypeSymbol(TypeDesc type)
{
return _typeSymbols.GetOrAdd(type);
}

private NodeCache<TypeDesc, IEETypeNode> _constructedTypeSymbols;

public IEETypeNode ConstructedTypeSymbol(TypeDesc type)
{
return _constructedTypeSymbols.GetOrAdd(type);
}

protected NodeCache<MethodDesc, IMethodNode> _methodEntrypoints;

// TODO-REFACTOR: we should try and get rid of this
Expand Down Expand Up @@ -706,33 +680,6 @@ public override void AttachToDependencyGraph(DependencyAnalyzerBase<NodeFactory>
MetadataManager.AttachToDependencyGraph(graph);
}

protected override IEETypeNode CreateNecessaryTypeNode(TypeDesc type)
{
if (CompilationModuleGroup.ContainsType(type))
{
return new AvailableType(this, type);
}
else
{
return new ExternalTypeNode(this, type);
}
}

protected override IEETypeNode CreateConstructedTypeNode(TypeDesc type)
{
// Canonical definition types are *not* constructed types (call NecessaryTypeSymbol to get them)
Debug.Assert(!type.IsCanonicalDefinitionType(CanonicalFormKind.Any));

if (CompilationModuleGroup.ContainsType(type))
{
return new AvailableType(this, type);
}
else
{
return new ExternalTypeNode(this, type);
}
}

protected override IMethodNode CreateMethodEntrypointNode(MethodDesc method)
{
ModuleToken moduleToken = Resolver.GetModuleTokenForMethod(method, throwIfNotFound: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ namespace ILCompiler
public interface IRootingServiceProvider
{
void AddCompilationRoot(MethodDesc method, string reason);
void AddCompilationRoot(TypeDesc type, string reason);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ public void AddCompilationRoot(MethodDesc method, string reason)
IMethodNode methodEntryPoint = _factory.MethodEntrypoint(canonMethod);
_rootAdder(methodEntryPoint, reason);
}

public void AddCompilationRoot(TypeDesc type, string reason)
{
_rootAdder(_factory.ConstructedTypeSymbol(type), reason);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,6 @@ public void AddCompilationRoots(IRootingServiceProvider rootProvider)
{
foreach (MetadataType type in _module.GetAllTypes())
{
try
{
rootProvider.AddCompilationRoot(type, "Library module type");
}
catch (TypeSystemException)
{
// Swallow type load exceptions while rooting
continue;
}

MetadataType typeWithMethods = type;
if (type.HasInstantiation)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\CopiedStrongNameSignatureNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\DelayLoadHelperMethodImport.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\ExceptionInfoLookupTableNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\ExternalTypeNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRunCodegenNodeFactory.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\AvailableType.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\ByteArrayComparer.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\CompilerIdentifierNode.cs" />
<Compile Include="Compiler\DependencyAnalysis\ReadyToRun\DebugInfoTableNode.cs" />
Expand Down

0 comments on commit e325870

Please sign in to comment.