Slight changes to make compile after upgrading the framework

This commit is contained in:
garbervetsky 2016-09-23 21:03:13 -03:00
Родитель c257a15a45
Коммит 37a1aa2ace
15 изменённых файлов: 113 добавлений и 116 удалений

Просмотреть файл

@ -9,9 +9,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScopeAnalysisTester", "Colu
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BulkScopeAnalyzer", "ColumnReductionAnalysis\BulkScopeAnalyzer\BulkScopeAnalyzer.csproj", "{4A4AD12B-670E-482B-909A-7B2BDF4843E1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Backend", "..\ZoppiFork\Backend\Backend.csproj", "{45C7B613-E32D-43E8-8030-932D509602EB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Backend", "analysis-net\Backend\Backend.csproj", "{45C7B613-E32D-43E8-8030-932D509602EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "..\ZoppiFork\Console\Console.csproj", "{C836D6AD-2A48-4FFF-A958-023C48A65478}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "analysis-net\Console\Console.csproj", "{C836D6AD-2A48-4FFF-A958-023C48A65478}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

Просмотреть файл

@ -33,40 +33,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Cci.ILGenerator">
<HintPath>..\Dependencies\Microsoft.Cci.ILGenerator.dll</HintPath>
<Reference Include="Microsoft.Cci.MetadataHelper">
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.MetadataHelper.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MetadataHelper, Version=1.0.13.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Microsoft.Cci.MetadataHelper.dll</HintPath>
<Reference Include="Microsoft.Cci.MetadataModel">
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.MetadataModel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MetadataModel, Version=1.0.13.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Microsoft.Cci.MetadataModel.dll</HintPath>
<Reference Include="Microsoft.Cci.PdbReader">
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.PdbReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MutableMetadataModel, Version=1.0.13.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Microsoft.Cci.MutableMetadataModel.dll</HintPath>
<Reference Include="Microsoft.Cci.PeReader">
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.PeReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PdbReader, Version=1.0.13.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Microsoft.Cci.PdbReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PdbWriter, Version=1.0.13.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Microsoft.Cci.PdbWriter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PeReader, Version=1.0.13.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Microsoft.Cci.PeReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PeWriter, Version=1.0.13.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Microsoft.Cci.PeWriter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.SourceModel, Version=1.0.13.0, Culture=neutral, PublicKeyToken=736440c9b414ea16, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Microsoft.Cci.SourceModel.dll</HintPath>
<Reference Include="Microsoft.Cci.SourceModel">
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.SourceModel.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -88,11 +68,11 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\ZoppiFork\Backend\Backend.csproj">
<ProjectReference Include="..\..\analysis-net\Backend\Backend.csproj">
<Project>{45c7b613-e32d-43e8-8030-932d509602eb}</Project>
<Name>Backend</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\ZoppiFork\Console\Console.csproj">
<ProjectReference Include="..\..\analysis-net\Console\Console.csproj">
<Project>{c836d6ad-2a48-4fff-a958-023c48a65478}</Project>
<Name>Console</Name>
</ProjectReference>

Просмотреть файл

@ -3,9 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.Cci;
using Frontend;
using Backend;
using Console;
using ScopeAnalyzer;
using Backend.Transformations;
namespace BulkScopeAnalyzer
{
@ -60,7 +60,7 @@ namespace BulkScopeAnalyzer
var disassembler = new Disassembler(assembly.Host, method, null);
var methodBody = disassembler.Execute();
var ins = methodBody.Instructions.OfType<Backend.ThreeAddressCode.Instructions.CreateObjectInstruction>().Single();
var ct = ins.Constructor.ContainingType;
var ct = ins.AllocationType;
var name = Microsoft.Cci.TypeHelper.GetTypeName(ct, NameFormattingOptions.Signature);
if (IsCompilerGenerated(name))

Просмотреть файл

@ -6,7 +6,7 @@ using System.Threading;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.Cci;
using Frontend;
using Console;
using ScopeAnalyzer;
using ScopeAnalyzer.Misc;
@ -239,7 +239,7 @@ namespace BulkScopeAnalyzer
string mappingPrefix = @"C:\Users\t-zpavli\Desktop\test output\mappings\";
var subdirs = Utils.GetSubDirectoriesPaths(mainFolder);
Console.WriteLine(String.Format("Analyzing {0} Scope projects", subdirs.Length));
System.Console.WriteLine(String.Format("Analyzing {0} Scope projects", subdirs.Length));
int dll_count = 0;
for (int i = 0; i < subdirs.Length; i++)
{
@ -249,7 +249,7 @@ namespace BulkScopeAnalyzer
string mapping = mappingPrefix + String.Format("{0}{1}.txt", Utils.PROCESSOR_ID_MAPPING_NAME, (i + 1));
if (!CreateProcessorIdMapping(subdir, libs, mapping))
{
Console.WriteLine("Skipping this Scope project...");
System.Console.WriteLine("Skipping this Scope project...");
continue;
}
@ -257,11 +257,11 @@ namespace BulkScopeAnalyzer
{
if (dll_count >= 150 && dll_count % 150 == 0)
{
Console.WriteLine("Giving myself 6 minutes...");
System.Console.WriteLine("Giving myself 6 minutes...");
Thread.Sleep(360000);
}
Console.WriteLine("Spawning process " + (dll_count + 1));
System.Console.WriteLine("Spawning process " + (dll_count + 1));
string output = outputPrefix + String.Format("output_{0}.txt", (dll_count + 1));
string input = libs[j];

Просмотреть файл

@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Cci;
using Frontend;
using Backend;
using Console;
namespace BulkScopeAnalyzer
{

Просмотреть файл

@ -35,32 +35,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Cci.ILGenerator">
<HintPath>..\Dependencies\Microsoft.Cci.ILGenerator.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MetadataHelper">
<HintPath>..\Dependencies\Microsoft.Cci.MetadataHelper.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.MetadataHelper.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MetadataModel">
<HintPath>..\Dependencies\Microsoft.Cci.MetadataModel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MutableMetadataModel">
<HintPath>..\Dependencies\Microsoft.Cci.MutableMetadataModel.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.MetadataModel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PdbReader">
<HintPath>..\Dependencies\Microsoft.Cci.PdbReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PdbWriter">
<HintPath>..\Dependencies\Microsoft.Cci.PdbWriter.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.PdbReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PeReader">
<HintPath>..\Dependencies\Microsoft.Cci.PeReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PeWriter">
<HintPath>..\Dependencies\Microsoft.Cci.PeWriter.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.PeReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.SourceModel">
<HintPath>..\Dependencies\Microsoft.Cci.SourceModel.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.SourceModel.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
@ -92,11 +80,11 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\ZoppiFork\Backend\Backend.csproj">
<ProjectReference Include="..\..\analysis-net\Backend\Backend.csproj">
<Project>{45c7b613-e32d-43e8-8030-932d509602eb}</Project>
<Name>Backend</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\ZoppiFork\Console\Console.csproj">
<ProjectReference Include="..\..\analysis-net\Console\Console.csproj">
<Project>{c836d6ad-2a48-4fff-a958-023c48a65478}</Project>
<Name>Console</Name>
</ProjectReference>

Просмотреть файл

@ -1,13 +1,12 @@
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ScopeAnalyzer;
using ScopeAnalyzer.Misc;
using Microsoft.Cci;
using ScopeAnalyzer.Analyses;
using Frontend;
using Console;
namespace ScopeAnalysisTester
{

Просмотреть файл

@ -3,12 +3,13 @@ using System.Collections.Generic;
using System.Linq;
using Backend.ThreeAddressCode.Values;
using Backend.ThreeAddressCode.Instructions;
using Backend.Analysis;
using Backend.Analyses;
using Backend.Visitors;
using Backend.Utils;
using Microsoft.Cci;
using ScopeAnalyzer.Interfaces;
using ScopeAnalyzer.Misc;
using Backend.Model;
namespace ScopeAnalyzer.Analyses
{

Просмотреть файл

@ -3,13 +3,14 @@ using System.Collections.Generic;
using System.Linq;
using Backend.ThreeAddressCode.Values;
using Backend.ThreeAddressCode.Instructions;
using Backend.Analysis;
using Backend.Analyses;
using Backend.Visitors;
using Backend.Utils;
using Microsoft.Cci;
using ScopeAnalyzer.Misc;
using ScopeAnalyzer;
using ScopeAnalyzer.Interfaces;
using Backend.Model;
namespace ScopeAnalyzer.Analyses
{

Просмотреть файл

@ -5,10 +5,11 @@ using System.Text;
using System.Threading.Tasks;
using Backend.ThreeAddressCode.Values;
using Backend.ThreeAddressCode.Instructions;
using Backend.Analysis;
using Backend.Analyses;
using ScopeAnalyzer.Interfaces;
using Microsoft.Cci;
using ScopeAnalyzer.Misc;
using Backend.Model;
namespace ScopeAnalyzer.Analyses
{

Просмотреть файл

@ -6,10 +6,11 @@ using System.Threading.Tasks;
using Microsoft.Cci;
using Backend.ThreeAddressCode.Values;
using Backend.ThreeAddressCode.Instructions;
using Backend.Analysis;
using Backend.Analyses;
namespace ScopeAnalyzer.Misc
{
using Backend.Model;
using CCI = Microsoft.Cci;
public static class Extensions

Просмотреть файл

@ -32,8 +32,8 @@ namespace ScopeAnalyzer
if (!IsVerbose)
return;
Console.WriteLine(message);
if (Output != null && Output != Console.Out)
System.Console.WriteLine(message);
if (Output != null && Output != System.Console.Out)
{
Output.WriteLine(message);
Output.Flush();

Просмотреть файл

@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
using Microsoft.Cci;
using Frontend;
using Console;
using Backend;
using System.Xml.Linq;
using ScopeAnalyzer.Misc;

Просмотреть файл

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using Backend;
using Microsoft.Cci;
using Backend.Analysis;
using Backend.Analyses;
using Backend.ThreeAddressCode.Values;
using Backend.ThreeAddressCode.Instructions;
using ScopeAnalyzer.Analyses;
@ -13,7 +13,10 @@ using ScopeAnalyzer.Misc;
namespace ScopeAnalyzer
{
using Assembly = Frontend.Assembly;
using Backend.Analyses;
using Backend.Model;
using Backend.Transformations;
using Assembly = Console.Assembly;
/// <summary>
/// Class that simply bundles together relevant information about
@ -321,39 +324,78 @@ namespace ScopeAnalyzer
var disassembler = new Disassembler(mhost, methodDefinition, sourceLocationProvider);
var methodBody = disassembler.Execute();
var cfg = ControlFlowGraph.GenerateNormalControlFlow(methodBody);
ControlFlowGraph.ComputeDominators(cfg);
ControlFlowGraph.IdentifyLoops(cfg);
var cfAnalysis = new ControlFlowAnalysis(methodBody);
var cfg = cfAnalysis.GenerateNormalControlFlow();
ControlFlowGraph.ComputeDominatorTree(cfg);
ControlFlowGraph.ComputeDominanceFrontiers(cfg);
var domAnalysis = new DominanceAnalysis(cfg);
domAnalysis.Analyze();
domAnalysis.GenerateDominanceTree();
var loopAnalysis = new NaturalLoopAnalysis(cfg);
loopAnalysis.Analyze();
var domFrontierAnalysis = new DominanceFrontierAnalysis(cfg);
domFrontierAnalysis.Analyze();
// Uniquely rename stack variables.
var splitter = new WebAnalysis(cfg);
splitter.Analyze();
splitter.Transform();
methodBody.UpdateVariables();
// Infer types for stack variables.
var typeAnalysis = new TypeInferenceAnalysis(cfg);
typeAnalysis.Analyze();
var analysis = new TypeInferenceAnalysis(cfg);
analysis.Analyze();
var backwardCopyAnalysis = new BackwardCopyPropagationAnalysis(cfg);
backwardCopyAnalysis.Analyze();
backwardCopyAnalysis.Transform(methodBody);
var copyProgapagtion = new ForwardCopyPropagationAnalysis(cfg);
copyProgapagtion.Analyze();
copyProgapagtion.Transform(methodBody);
var lva = new LiveVariablesAnalysis(cfg);
lva.Analyze();
var backwardCopyProgapagtion = new BackwardCopyPropagationAnalysis(cfg);
backwardCopyProgapagtion.Analyze();
backwardCopyProgapagtion.Transform(methodBody);
var ssa = new StaticSingleAssignmentAnalysis(methodBody, cfg);
var liveVariables = new LiveVariablesAnalysis(cfg);
var resultLiveVar = liveVariables.Analyze();
var ssa = new StaticSingleAssignment(methodBody, cfg);
ssa.Transform();
ssa.Prune(lva);
ssa.Prune(liveVariables);
methodBody.UpdateVariables();
//_code = methodBody.ToString();
return cfg;
//var cfg = ControlFlowGraph.GenerateNormalControlFlow(methodBody);
//ControlFlowGraph.ComputeDominators(cfg);
//ControlFlowGraph.IdentifyLoops(cfg);
//ControlFlowGraph.ComputeDominatorTree(cfg);
//ControlFlowGraph.ComputeDominanceFrontiers(cfg);
//// Uniquely rename stack variables.
//var splitter = new WebAnalysis(cfg);
//splitter.Analyze();
//splitter.Transform();
//methodBody.UpdateVariables();
//// Infer types for stack variables.
//var typeAnalysis = new TypeInferenceAnalysis(cfg);
//typeAnalysis.Analyze();
//var backwardCopyAnalysis = new BackwardCopyPropagationAnalysis(cfg);
//backwardCopyAnalysis.Analyze();
//backwardCopyAnalysis.Transform(methodBody);
//var lva = new LiveVariablesAnalysis(cfg);
//lva.Analyze();
//var ssa = new StaticSingleAssignmentAnalysis(methodBody, cfg);
//ssa.Transform();
//ssa.Prune(lva);
//methodBody.UpdateVariables();
////_code = methodBody.ToString();
//return cfg;
}
/// <summary>

Просмотреть файл

@ -48,32 +48,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Cci.ILGenerator">
<HintPath>..\Dependencies\Microsoft.Cci.ILGenerator.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MetadataHelper">
<HintPath>..\Dependencies\Microsoft.Cci.MetadataHelper.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.MetadataHelper.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MetadataModel">
<HintPath>..\Dependencies\Microsoft.Cci.MetadataModel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.MutableMetadataModel">
<HintPath>..\Dependencies\Microsoft.Cci.MutableMetadataModel.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.MetadataModel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PdbReader">
<HintPath>..\Dependencies\Microsoft.Cci.PdbReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PdbWriter">
<HintPath>..\Dependencies\Microsoft.Cci.PdbWriter.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.PdbReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PeReader">
<HintPath>..\Dependencies\Microsoft.Cci.PeReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.PeWriter">
<HintPath>..\Dependencies\Microsoft.Cci.PeWriter.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.PeReader.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Cci.SourceModel">
<HintPath>..\Dependencies\Microsoft.Cci.SourceModel.dll</HintPath>
<HintPath>..\..\analysis-net\Dependencies\Microsoft.Cci.SourceModel.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -119,11 +107,11 @@
<Content Include="TODO.txt" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\ZoppiFork\Backend\Backend.csproj">
<ProjectReference Include="..\..\analysis-net\Backend\Backend.csproj">
<Project>{45c7b613-e32d-43e8-8030-932d509602eb}</Project>
<Name>Backend</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\ZoppiFork\Console\Console.csproj">
<ProjectReference Include="..\..\analysis-net\Console\Console.csproj">
<Project>{c836d6ad-2a48-4fff-a958-023c48a65478}</Project>
<Name>Console</Name>
</ProjectReference>