Esempio n. 1
0
        public Identifier ResolveGlobal(string moduleName, int ordinal, IPlatform platform)
        {
            foreach (var program in project.Programs)
            {
                ModuleDescriptor mod;
                if (!program.EnvironmentMetadata.Modules.TryGetValue(moduleName, out mod))
                {
                    continue;
                }

                DataType dt;
                if (mod.GlobalsByOrdinal.TryGetValue(ordinal, out dt))
                {
                    return(new Identifier("ExportedGlobal_" + ordinal, dt, new MemoryStorage()));
                }
            }

            return(platform.LookupGlobalByOrdinal(moduleName, ordinal));
        }
Esempio n. 2
0
        public Identifier ResolveGlobal(string moduleName, int ordinal, IPlatform platform)
        {
            foreach (var program in project.Programs)
            {
                ModuleDescriptor mod;
                if (!program.EnvironmentMetadata.Modules.TryGetValue(moduleName, out mod))
                    continue;

                DataType dt;
                if (mod.GlobalsByOrdinal.TryGetValue(ordinal, out dt))
                {
                    return new Identifier("ExportedGlobal_" + ordinal, dt, new MemoryStorage());
                }
            }

            return platform.LookupGlobalByOrdinal(moduleName, ordinal);
        }