Esempio n. 1
0
		public void InsertDeclarations()
		{
			DeclarationInserter deci = new DeclarationInserter(ssaIds, doms);
			foreach (Web web in this.webs)
			{
				if (!(web.Identifier is MemoryIdentifier))
					deci.InsertDeclaration(web);
			}
		}
Esempio n. 2
0
        public void InsertDeclarations()
        {
            DeclarationInserter deci = new DeclarationInserter(ssaIds, doms);

            foreach (Web web in this.webs)
            {
                if (!(web.Identifier is MemoryIdentifier))
                {
                    deci.InsertDeclaration(web);
                }
            }
        }
Esempio n. 3
0
		public void DeciWeb()
		{
			Build(new DiamondMock().Procedure);
			DeclarationInserter deci = new DeclarationInserter(ssaIds, doms);
			Web web = new Web();
			SsaIdentifier r_1 = ssaIds.Where(s => s.Identifier.Name == "r_1").Single();
            SsaIdentifier r_3 = ssaIds.Where(s => s.Identifier.Name == "r_3").Single();
            SsaIdentifier r_4 = ssaIds.Where(s => s.Identifier.Name == "r_4").Single();
			web.Add(r_1);
			web.Add(r_3);
			web.Add(r_4);
			deci.InsertDeclaration(web);
			Assert.AreEqual("word32 r_1", proc.ControlGraph.Blocks[2].Statements[0].Instruction.ToString());
		}
Esempio n. 4
0
        public void InsertDeclarations()
        {
            var deci = new DeclarationInserter(ssaIds, doms);

            foreach (Web web in this.webs)
            {
                bool isLive           = web.Uses.Count > 0;
                bool isOnlyUsedByPhis = web.Uses.All(u => u.Instruction is PhiAssignment);
                bool isMemoryId       = web.Identifier is MemoryIdentifier;
                if (isLive && !isOnlyUsedByPhis && !isMemoryId)
                {
                    deci.InsertDeclaration(web);
                }
                else
                {
                    var isDefinedByOutArg = OutDefinitionFinder.Find(web.Members);
                    if (isDefinedByOutArg)
                    {
                        deci.InsertDeclaration(web);
                    }
                }
            }
        }