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

EmbeddedDataContainerNode.cs « DependencyAnalysis « Compiler « src « ILCompiler.Compiler « src - github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0cffffac19bfc1e9f7c4d9be377e3e5fc537ea5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Internal.TypeSystem;

namespace ILCompiler.DependencyAnalysis
{
    /// <summary>
    /// Represents a node that contains a set of embedded objects. The main function is 
    /// to serve as a base class, providing symbol name boundaries and node ordering.
    /// </summary>
    public abstract class EmbeddedDataContainerNode : ObjectNode
    {
        private ObjectAndOffsetSymbolNode _startSymbol;
        private ObjectAndOffsetSymbolNode _endSymbol;
        private string _startSymbolMangledName;

        public ObjectAndOffsetSymbolNode StartSymbol => _startSymbol;
        public ObjectAndOffsetSymbolNode EndSymbol => _endSymbol;

        protected EmbeddedDataContainerNode(string startSymbolMangledName, string endSymbolMangledName)
        {
            _startSymbolMangledName = startSymbolMangledName;
            _startSymbol = new ObjectAndOffsetSymbolNode(this, 0, startSymbolMangledName, true);
            _endSymbol = new ObjectAndOffsetSymbolNode(this, 0, endSymbolMangledName, true);
        }

        public override int ClassCode => -1410622237;

        public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
        {
            return _startSymbolMangledName.CompareTo(((EmbeddedDataContainerNode)other)._startSymbolMangledName);
        }
    }
}