Example #1
0
 public IRAssignment(IRBasicBlock parentBlock, IRExpression destination, IRExpression source)
     : base(parentBlock)
 {
     Destination = destination;
     Source      = source;
     if (Destination is IRVariable v)
     {
         Defs.Add(v);
     }
     Uses.UnionWith(Source.GetAllVariables());
 }
Example #2
0
        public virtual void GatherDefs()
        {
            Workspaces.Document item = Item;
            string ffn             = item.FullPath;
            IGrammarDescription gd = GrammarDescriptionFactory.Create(ffn);

            if (gd == null)
            {
                throw new Exception();
            }

            for (int classification = 0; classification < gd.IdentifyDefinition.Count; ++classification)
            {
                Func <IGrammarDescription, Dictionary <IParseTree, IList <CombinedScopeSymbol> >, IParseTree, bool> fun = gd.IdentifyDefinition[classification];
                if (fun == null)
                {
                    continue;
                }

                IEnumerable <IParseTree> it = AllNodes.Where(t => fun(gd, Attributes, t));
                foreach (IParseTree t in it)
                {
                    TerminalNodeImpl x = (t as TerminalNodeImpl);
                    if (x == null)
                    {
                        continue;
                    }

                    if (x.Symbol == null)
                    {
                        continue;
                    }

                    try
                    {
                        Defs.Add(x, classification);
                        Tags.Add(x, classification);
                    }
                    catch (ArgumentException)
                    {
                        // Duplicate
                    }
                }
            }
        }
        public static void Init(List <PlatformSupportInterface> Interfaces)
        {
            Definitions.Add(new PlatformDefinition("Win64", new List <string>()
            {
                "PLATFORM_WINDOWS"
            }, WindowsID));
#if false
            Defs.Add(new PlatformDefinition("Win64_DX12", new List <string>()
            {
                "PLATFORM_WINDOWS", "SINGLERHI_DX12", "ALLOW_SINGLE_RHI"
            }));
            Defs.Add(new PlatformDefinition("Win64_VK", new List <string>()
            {
                "PLATFORM_WINDOWS", "SINGLERHI_VK", "ALLOW_SINGLE_RHI"
            }));
            Definitions[(int)Platforms.Linux] = new PlatformDefinition("Linux", new List <string>()
            {
                "PLATFORM_LINUX"
            }, Platforms.Limit);
            Definitions[(int)Platforms.Linux].SystemType = "linux";

            Definitions[(int)Platforms.Android] = new PlatformDefinition("Android", new List <string>()
            {
                "PLATFORM_ANDROID", "SINGLERHI_VK", "ALLOW_SINGLE_RHI"
            }, Platforms.Android);
            Definitions[(int)Platforms.Android].SystemType    = "android";
            Definitions[(int)Platforms.Android].ProcessorArch = "ARM";
#endif
            foreach (PlatformSupportInterface i in Interfaces)
            {
                i.AddPlatforms(ref Definitions);
            }
            Console.WriteLine("Target Platforms:");
            foreach (PlatformDefinition pd in Definitions)
            {
                Console.WriteLine(pd.Name);
            }
            Console.WriteLine("");
        }
 public void Add(KeysGeneratorDef def)
 {
     Defs.Add(def);
 }