Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs')
-rw-r--r--src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs
index 909edfae4..796ffce38 100644
--- a/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs
+++ b/src/ILCompiler.Compiler/src/Compiler/DependencyAnalysis/RuntimeImportMethodNode.cs
@@ -10,7 +10,7 @@ namespace ILCompiler.DependencyAnalysis
/// <summary>
/// Represents a method that is imported from the runtime library.
/// </summary>
- public class RuntimeImportMethodNode : ExternSymbolNode, IMethodNode
+ public class RuntimeImportMethodNode : ExternSymbolNode, IMethodNode, IExportableSymbolNode
{
private MethodDesc _method;
@@ -27,5 +27,27 @@ namespace ILCompiler.DependencyAnalysis
return _method;
}
}
+
+ public ExportForm GetExportForm(NodeFactory factory)
+ {
+ // Force non-fake exports for RuntimeImportMethods that have '*' as their module. ('*' means the method is
+ // REALLY a reference to the linked in native code)
+ if (((EcmaMethod)_method).GetRuntimeImportDllName() == "*")
+ {
+ ExportForm exportForm = factory.CompilationModuleGroup.GetExportMethodForm(_method, false);
+ if (exportForm == ExportForm.ByName)
+ return ExportForm.None; // Method symbols exported by name are naturally handled by the linker
+ return exportForm;
+ }
+
+ return ExportForm.None;
+ }
+
+ public override int ClassCode => -1173492615;
+
+ public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
+ {
+ return comparer.Compare(_method, ((RuntimeImportMethodNode)other)._method);
+ }
}
}