private void ProcessArgumentArray(StatementCollection statements, ref int index, VariableReference typesArray, CallSiteInfo callSiteInfo, Action <MethodInvocationExpression, int, CallSiteInfo> action) { if (statements.get_Item(index) as ExpressionStatement != null && (statements.get_Item(index) as ExpressionStatement).get_Expression() as BinaryExpression != null) { V_1 = (statements.get_Item(index) as ExpressionStatement).get_Expression() as BinaryExpression; if (V_1.get_IsAssignmentExpression() && V_1.get_Left() as VariableReferenceExpression != null && V_1.get_Right() as MethodInvocationExpression != null) { index = index + 1; } } V_2 = index; index = V_2 + 1; V_0 = this.CheckNewArrayInitializationAndSize(statements.get_Item(V_2), typesArray); V_3 = 0; while (V_3 < V_0) { if (!statements.get_Item(index).IsAssignmentStatement()) { throw new Exception("Invalid statement."); } V_2 = index; index = V_2 + 1; V_4 = (statements.get_Item(V_2) as ExpressionStatement).get_Expression() as BinaryExpression; if (V_4.get_Left().get_CodeNodeType() != 39 || !this.CheckArrayIndexerExpression(V_4.get_Left() as ArrayIndexerExpression, typesArray, V_3) || V_4.get_Right().get_CodeNodeType() != 19) { throw new Exception("Invalid statement."); } action.Invoke(V_4.get_Right() as MethodInvocationExpression, V_3, callSiteInfo); V_3 = V_3 + 1; } return; }
public static string GetGenericName(IGenericDefinition genericDefinition, string leftBracket, string rightBracket, ILanguage language) { V_0 = false; if (genericDefinition as MethodDefinition != null) { V_0 = ((MethodDefinition)genericDefinition).get_HasOverrides(); } V_1 = GenericHelper.GetNonGenericName(genericDefinition.get_Name()); if (!V_0) { if (genericDefinition as MethodDefinition == null) { stackVariable70 = false; } else { stackVariable70 = ((MethodDefinition)genericDefinition).get_IsConstructor(); } if (!stackVariable70) { V_1 = GenericHelper.ReplaceInvalidCharactersName(language, V_1); } } if (genericDefinition.get_HasGenericParameters()) { V_2 = 0; if (genericDefinition as TypeDefinition != null) { V_3 = (genericDefinition as TypeDefinition).get_DeclaringType(); if (V_3 != null && V_3.get_HasGenericParameters()) { V_2 = V_3.get_GenericParameters().get_Count(); } } if (V_2 < genericDefinition.get_GenericParameters().get_Count()) { V_1 = String.Concat(V_1, leftBracket); while (V_2 < genericDefinition.get_GenericParameters().get_Count()) { V_4 = genericDefinition.get_GenericParameters().get_Item(V_2); if (V_4.get_IsCovariant()) { V_1 = String.Concat(V_1, "out "); } if (V_4.get_IsContravariant()) { V_1 = String.Concat(V_1, "in "); } V_1 = String.Concat(V_1, GenericHelper.ReplaceInvalidCharactersName(language, V_4.get_Name())); if (V_2 != genericDefinition.get_GenericParameters().get_Count() - 1) { V_1 = String.Concat(V_1, ", "); } V_2 = V_2 + 1; } V_1 = String.Concat(V_1, rightBracket); } } return(V_1); }
public HashSet <ISingleEntrySubGraph> GetDominatedNodes(ISingleEntrySubGraph construct) { if (!this.constructToNodeMap.TryGetValue(construct, out V_0)) { return(null); } V_1 = new HashSet <ISingleEntrySubGraph>(); V_2 = new Queue <DTNode>(); V_2.Enqueue(V_0); while (V_2.get_Count() > 0) { V_3 = V_2.Dequeue(); dummyVar0 = V_1.Add(V_3.get_Construct()); V_4 = V_3.get_TreeEdgeSuccessors().GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = (DTNode)V_4.get_Current(); V_2.Enqueue(V_5); } } finally { ((IDisposable)V_4).Dispose(); } } return(V_1); }
private TypeReference GetUseInMethodInvocation(MethodInvocationExpression methodInvocationExpression, VariableReference variable) { V_0 = null; V_1 = methodInvocationExpression.get_Arguments().GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); if (V_2 as VariableReferenceExpression == null || (object)(V_2 as VariableReferenceExpression).get_Variable() != (object)variable) { continue; } V_0 = V_2; } } finally { if (V_1 != null) { V_1.Dispose(); } } if (V_0 == null) { if ((object)(methodInvocationExpression.get_MethodExpression().get_Target() as VariableReferenceExpression).get_Variable() != (object)variable) { return(null); } return(methodInvocationExpression.get_MethodExpression().get_Member().get_DeclaringType()); } V_3 = methodInvocationExpression.get_Arguments().IndexOf(V_0); V_4 = methodInvocationExpression.get_MethodExpression().get_Method(); return(V_4.get_Parameters().get_Item(V_3).ResolveParameterType(V_4)); }
public List <TemplateViewModel> GetTemplates(string folder) { if (!Directory.Exists(folder)) { dummyVar0 = Directory.CreateDirectory(folder); } stackVariable7 = (new DirectoryInfo(folder)).GetFiles(string.Format("*{0}", ".cshtml")); V_0 = new List <TemplateViewModel>(); V_1 = stackVariable7; V_2 = 0; while (V_2 < (int)V_1.Length) { V_3 = V_1[V_2]; V_4 = V_3.OpenText(); try { stackVariable20 = new TemplateViewModel(); stackVariable20.set_FileFolder(folder); stackVariable20.set_Filename(V_3.get_Name()); stackVariable20.set_Extension(".cshtml"); stackVariable20.set_Content(V_4.ReadToEnd()); V_0.Add(stackVariable20); } finally { if (V_4 != null) { ((IDisposable)V_4).Dispose(); } } V_2 = V_2 + 1; } return(V_0); }
private LetClause GenerateLetClause(Dictionary <PropertyDefinition, Expression> propertyToValueMap, VariableReference oldIdentifier) { V_0 = null; V_1 = null; V_4 = propertyToValueMap.GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); if (!String.op_Equality(V_5.get_Key().get_Name(), oldIdentifier.get_Name()) || V_5.get_Value().get_CodeNodeType() != 26 || (object)(V_5.get_Value() as VariableReferenceExpression).get_Variable() != (object)oldIdentifier) { V_1 = V_5.get_Key(); } else { V_0 = V_5.get_Key(); } } } finally { ((IDisposable)V_4).Dispose(); } if (V_0 == null || V_1 == null) { return(null); } V_2 = propertyToValueMap.get_Item(V_1); V_3 = new LetClause(new VariableReferenceExpression(this.CreateNewIdentifier(V_1.get_Name(), V_2.get_ExpressionType()), null), V_2, null); propertyToValueMap.set_Item(V_1, V_3.get_Identifier()); return(V_3); }
private ICollection <DFSTNode> ExpandLoopBodyWithCrossEdges(ICollection <DFSTNode> nodesInLoop) { V_0 = new HashSet <DFSTNode>(nodesInLoop); V_1 = new Queue <DFSTNode>(nodesInLoop); while (V_1.get_Count() > 0) { V_2 = V_1.Dequeue(); V_4 = V_2.get_CrossEdgePredecessors().GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); if (V_0.Contains(V_5)) { continue; } dummyVar0 = V_0.Add(V_5); V_1.Enqueue(V_5); } } finally { ((IDisposable)V_4).Dispose(); } V_3 = V_2.get_Predecessor() as DFSTNode; if (V_3 == null || V_0.Contains(V_3)) { continue; } dummyVar1 = V_0.Add(V_3); V_1.Enqueue(V_3); } return(V_0); }
public static void ParseFilter(SingleValueNode node, ref Expression<Func<TModel, bool>> result, int kind = -1) { if (node as BinaryOperatorNode != null) { V_0 = node as BinaryOperatorNode; V_1 = V_0.get_Left(); V_2 = V_0.get_Right(); if (V_1 as ConvertNode != null) { ODataHelper<TModel>.ParseFilter(((ConvertNode)V_1).get_Source(), ref result, -1); } if (V_1 as BinaryOperatorNode != null) { ODataHelper<TModel>.ParseFilter(V_1, ref result, -1); } if (V_2 as ConvertNode != null) { ODataHelper<TModel>.ParseFilter(((ConvertNode)V_2).get_Source(), ref result, V_0.get_OperatorKind()); } if (V_2 as BinaryOperatorNode != null) { ODataHelper<TModel>.ParseFilter(V_2, ref result, V_0.get_OperatorKind()); } if (V_1 as SingleValuePropertyAccessNode != null && V_2 as ConstantNode != null) { V_3 = V_1 as SingleValuePropertyAccessNode; V_4 = V_2 as ConstantNode; if (V_3 != null && V_3.get_Property() != null && V_4 != null && V_4.get_Value() != null) { V_5 = ODataHelper<TModel>.FilterObjectSet(V_3, V_4, V_0.get_OperatorKind(), "model"); dummyVar0 = Expression.Parameter(Type.GetTypeFromHandle(//
public static Dictionary <MemberIdentifier, CodeSpan> GenerateMemberMapping(string assemblyFilePath, StringWriter writer, List <WritingInfo> writingInfos) { stackVariable1 = writer.ToString(); V_0 = new Dictionary <MemberIdentifier, CodeSpan>(); V_1 = new TwoDimensionalString(stackVariable1, writer.get_NewLine(), false); V_2 = writingInfos.GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = V_2.get_Current().get_MemberDeclarationToCodePostionMap().GetEnumerator(); try { while (V_3.MoveNext()) { V_4 = V_3.get_Current(); V_5 = V_4.get_Key(); V_6 = V_4.get_Value(); V_7 = ExternallyVisibleDecompilationUtilities.GetSpan(V_1, V_1.TrimStart(V_6)); V_0.Add(ExternallyVisibleDecompilationUtilities.GetIdentifier(assemblyFilePath, V_5), V_7); } } finally { ((IDisposable)V_3).Dispose(); } } } finally { ((IDisposable)V_2).Dispose(); } return(V_0); }
private void MapBlocks() { V_0 = this.logicalBuilderContext.get_CFG().get_Blocks(); V_1 = 0; while (V_1 < (int)V_0.Length) { V_2 = V_0[V_1]; V_3 = V_2.get_First().get_Offset(); stackVariable17 = this.logicalBuilderContext.get_CFGBlockToLogicalConstructMap(); stackVariable20 = new CFGBlockLogicalConstruct[1]; stackVariable20[0] = new CFGBlockLogicalConstruct(V_2, this.methodContext.get_Expressions().get_BlockExpressions().get_Item(V_3)); stackVariable17.Add(V_2, stackVariable20); V_1 = V_1 + 1; } V_0 = this.logicalBuilderContext.get_CFG().get_Blocks(); V_1 = 0; while (V_1 < (int)V_0.Length) { V_4 = V_0[V_1]; V_5 = this.logicalBuilderContext.get_CFGBlockToLogicalConstructMap().get_Item(V_4)[0]; V_6 = V_4.get_Successors(); V_7 = 0; while (V_7 < (int)V_6.Length) { V_8 = V_6[V_7]; V_9 = this.logicalBuilderContext.get_CFGBlockToLogicalConstructMap().get_Item(V_8)[0]; V_5.AddToSuccessors(V_9); V_9.AddToPredecessors(V_5); V_7 = V_7 + 1; } V_1 = V_1 + 1; } return; }
protected override string ToString(string constructName, HashSet <CFGBlockLogicalConstruct> printedBlocks, LogicalFlowBuilderContext context) { V_0 = new StringBuilder(); dummyVar0 = V_0.Append(this.get_LoopType()); dummyVar1 = V_0.AppendLine("LogicalConstruct"); dummyVar2 = V_0.AppendLine("{"); V_2 = this.GetSortedArrayFromCollection <ISingleEntrySubGraph>(this.get_Children()); V_3 = 0; while (V_3 < (int)V_2.Length) { V_4 = (LogicalConstructBase)V_2[V_3]; stackVariable27 = V_4.ToString(context); stackVariable29 = new String[1]; stackVariable29[0] = Environment.get_NewLine(); V_5 = stackVariable27.Split(stackVariable29, 1); V_6 = 0; while (V_6 < (int)V_5.Length) { V_7 = V_5[V_6]; dummyVar3 = V_0.Append('\t'); dummyVar4 = V_0.AppendLine(V_7); V_6 = V_6 + 1; } printedBlocks.UnionWith(V_4.get_CFGBlocks()); V_3 = V_3 + 1; } V_1 = String.Format("\tFollowNode: {0}", this.NodeILOffset(context, this.get_CFGFollowNode())); dummyVar5 = V_0.AppendLine(V_1); dummyVar6 = V_0.AppendLine("}"); return(V_0.ToString()); }
private List <IntervalConstruct> SortIntervalList(List <IntervalConstruct> intervals) { V_0 = new IntervalConstruct(intervals.get_Item(0)); V_2 = intervals.GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = V_2.get_Current(); dummyVar0 = V_0.get_Children().Add(V_3); } } finally { ((IDisposable)V_2).Dispose(); } stackVariable15 = DFSTBuilder.BuildTree(V_0); V_1 = new List <IntervalConstruct>(); V_4 = stackVariable15.get_ReversePostOrder().GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); V_1.Add(V_5.get_Construct() as IntervalConstruct); } } finally { ((IDisposable)V_4).Dispose(); } return(V_1); }
private static void GenericInstanceFriendlyFullName(this IGenericInstance self, ILanguage language, StringBuilder builder, bool useGenericName, string leftBracket, string rightBracket) { dummyVar0 = builder.Append(leftBracket); V_0 = self.get_GenericArguments(); V_1 = 0; while (V_1 < V_0.get_Count()) { V_2 = V_0.get_Item(V_1); if (self.get_PostionToArgument().ContainsKey(V_1)) { V_2 = self.get_PostionToArgument().get_Item(V_1); } if (V_1 > 0) { dummyVar1 = builder.Append(","); } V_3 = V_2.GetFriendlyFullName(language); if (useGenericName) { V_4 = V_2.Resolve(); if (V_4 != null) { V_3 = V_4.GetGenericFullName(language); } } dummyVar2 = builder.Append(V_3); V_1 = V_1 + 1; } dummyVar3 = builder.Append(rightBracket); return; }
private IEnumerable <BinaryExpression> GetAssignmentExpressions(IList <Expression> blockExpressions) { V_0 = new List <BinaryExpression>(); V_1 = blockExpressions.GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); if (V_2 as BinaryExpression == null || !(V_2 as BinaryExpression).get_IsAssignmentExpression()) { continue; } V_3 = V_2 as BinaryExpression; if (!this.CanBePropagated(V_3.get_Right()) || V_3.get_Left() as VariableReferenceExpression == null) { continue; } V_4 = V_3.get_Left() as VariableReferenceExpression; if (!V_4.get_ExpressionType().get_IsByReference() && !V_4.get_ExpressionType().get_IsPointer()) { continue; } V_0.Add(V_3); } } finally { if (V_1 != null) { V_1.Dispose(); } } return(V_0); }
private void RemoveTransitiveEdges() { V_0 = this.GenerateNodeToIndex(); V_1 = this.GeenrateAdjacencyMatrix(V_0); this.WarsawTransitiveClosure(V_1); V_2 = this.inferenceGraph.GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = V_2.get_Current(); V_4 = this.inferenceGraph.GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); V_6 = this.inferenceGraph.GetEnumerator(); try { while (V_6.MoveNext()) { V_7 = V_6.get_Current(); V_8 = V_0.get_Item(V_3); V_9 = V_0.get_Item(V_5); V_10 = V_0.get_Item(V_7); if (!V_1[V_8, V_9] || !V_1[V_9, V_10] || V_3.get_IsHardNode() && V_7.get_IsHardNode() || !V_3.get_SubTypes().Contains(V_7)) { continue; } this.RemoveSubtype(V_3, V_7); } } finally { if (V_6 != null) { V_6.Dispose(); } } } } finally { if (V_4 != null) { V_4.Dispose(); } } } } finally { if (V_2 != null) { V_2.Dispose(); } } return; }
private Dictionary <ILogicalConstruct, HashSet <ISingleEntrySubGraph> > GetValidCases(DominatorTree dominatorTree, ILogicalConstruct switchCFGBlock) { V_0 = new SwitchBuilder.u003cu003ec__DisplayClass9_0(); V_0.caseEntriesToDominatedNodesMap = new Dictionary <ILogicalConstruct, HashSet <ISingleEntrySubGraph> >(); V_1 = new HashSet <ISingleEntrySubGraph>(); dummyVar0 = V_1.Add(switchCFGBlock); V_4 = switchCFGBlock.get_SameParentSuccessors().GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = (ILogicalConstruct)V_4.get_Current(); if (V_5 == switchCFGBlock || dominatorTree.GetImmediateDominator(V_5) != switchCFGBlock) { continue; } V_6 = dominatorTree.GetDominatedNodes(V_5); V_0.caseEntriesToDominatedNodesMap.Add(V_5, V_6); V_1.UnionWith(V_6); } } finally { ((IDisposable)V_4).Dispose(); } stackVariable34 = DFSTBuilder.BuildTree(switchCFGBlock.get_Parent(), switchCFGBlock).get_ReversePostOrder(); stackVariable35 = SwitchBuilder.u003cu003ec.u003cu003e9__9_0; if (stackVariable35 == null) { dummyVar1 = stackVariable35; stackVariable35 = new Func <DFSTNode, ILogicalConstruct>(SwitchBuilder.u003cu003ec.u003cu003e9.u003cGetValidCasesu003eb__9_0); SwitchBuilder.u003cu003ec.u003cu003e9__9_0 = stackVariable35; } V_2 = new List <ILogicalConstruct>(stackVariable34.Select <DFSTNode, ILogicalConstruct>(stackVariable35).Where <ILogicalConstruct>(new Func <ILogicalConstruct, bool>(V_0.u003cGetValidCasesu003eb__1))); do { V_3 = false; V_7 = V_2.GetEnumerator(); try { while (V_7.MoveNext()) { V_8 = V_7.get_Current(); if (!V_0.caseEntriesToDominatedNodesMap.TryGetValue(V_8, out V_9) || this.IsCaseValid(V_8, V_1)) { continue; } V_1.ExceptWith(V_9); dummyVar2 = V_0.caseEntriesToDominatedNodesMap.Remove(V_8); V_3 = true; } } finally { ((IDisposable)V_7).Dispose(); } }while (V_3); return(V_0.caseEntriesToDominatedNodesMap); }
public static ICollection <ImplementedMember> GetExplicitlyImplementedEvents(this EventDefinition self) { V_0 = new List <ImplementedMember>(); if (!self.IsExplicitImplementation()) { return(V_0); } if (self.get_AddMethod() != null) { V_1 = self.get_AddMethod().GetExplicitlyImplementedMethods().GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); V_3 = EventDefinitionExtensions.GetMethodDeclaringEvent(V_2.get_Member() as MethodReference); if (V_3 == null) { continue; } V_0.Add(new ImplementedMember(V_2.get_DeclaringType(), V_3)); } } finally { if (V_1 != null) { V_1.Dispose(); } } return(V_0); } if (self.get_RemoveMethod() == null) { return(V_0); } V_1 = self.get_RemoveMethod().GetExplicitlyImplementedMethods().GetEnumerator(); try { while (V_1.MoveNext()) { V_4 = V_1.get_Current(); V_5 = EventDefinitionExtensions.GetMethodDeclaringEvent(V_4.get_Member() as MethodReference); if (V_5 == null) { continue; } V_0.Add(new ImplementedMember(V_4.get_DeclaringType(), V_5)); } } finally { if (V_1 != null) { V_1.Dispose(); } } return(V_0); }
public override RepositoryResponse<bool> SaveSubModels(MixPage parent, MixCmsContext _context = null, IDbContextTransaction _transaction = null) { stackVariable0 = new RepositoryResponse<bool>(); stackVariable0.set_IsSucceed(true); V_0 = stackVariable0; ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel>(this.get_View().SaveModel(true, _context, _transaction), ref V_0); if (V_0.get_IsSucceed() && this.get_Master() != null) { ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixTemplates.UpdateViewModel>(this.get_Master().SaveModel(true, _context, _transaction), ref V_0); } if (V_0.get_IsSucceed() && this.get_UrlAliases() != null) { V_1 = this.get_UrlAliases().GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); if (!V_0.get_IsSucceed()) { break; } V_2.set_SourceId(parent.get_Id().ToString()); V_2.set_Type(0); V_2.set_Specificulture(this.get_Specificulture()); ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixUrlAliases.UpdateViewModel>(V_2.SaveModel(false, _context, _transaction), ref V_0); } } finally { ((IDisposable)V_1).Dispose(); } } if (V_0.get_IsSucceed()) { V_4 = this.get_ModuleNavs().GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); V_5.set_PageId(parent.get_Id()); if (!V_5.get_IsActived()) { ViewModelHelper.HandleResult<MixPageModule>(V_5.RemoveModel(false, _context, _transaction), ref V_0); } else { ViewModelHelper.HandleResult<Mix.Cms.Lib.ViewModels.MixPageModules.ReadMvcViewModel>(V_5.SaveModel(false, _context, _transaction), ref V_0); } } } finally { ((IDisposable)V_4).Dispose(); } } return V_0; }
public List <FileViewModel> GetFilesWithContent(string fullPath) { this.CreateDirectoryIfNotExist(fullPath); V_0 = new List <FileViewModel>(); V_1 = Directory.GetDirectories(fullPath, "*", 1); V_2 = 0; while (V_2 < (int)V_1.Length) { stackVariable15 = new DirectoryInfo(V_1[V_2]); V_3 = stackVariable15.get_Name(); stackVariable17 = stackVariable15.GetFiles(); stackVariable18 = FileRepository.u003cu003ec.u003cu003e9__29_0; if (stackVariable18 == null) { dummyVar0 = stackVariable18; stackVariable18 = new Func <FileInfo, DateTime>(FileRepository.u003cu003ec.u003cu003e9.u003cGetFilesWithContentu003eb__29_0); FileRepository.u003cu003ec.u003cu003e9__29_0 = stackVariable18; } V_4 = ((IEnumerable <FileInfo>)stackVariable17).OrderByDescending <FileInfo, DateTime>(stackVariable18).GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); V_6 = V_5.OpenText(); try { V_7 = new FileViewModel(); V_7.set_FolderName(V_3); stackVariable33 = new string[2]; stackVariable33[0] = fullPath; stackVariable33[1] = V_3; V_7.set_FileFolder(CommonHelper.GetFullPath(stackVariable33)); V_7.set_Filename(V_5.get_Name().Substring(0, V_5.get_Name().LastIndexOf('.'))); V_7.set_Extension(V_5.get_Extension()); V_7.set_Content(V_6.ReadToEnd()); V_0.Add(V_7); } finally { if (V_6 != null) { ((IDisposable)V_6).Dispose(); } } } } finally { if (V_4 != null) { V_4.Dispose(); } } V_2 = V_2 + 1; } return(V_0); }
public void InferTypes() { V_0 = (new GreedyTypeInferer(this.context, this.offsetToExpression)).InferTypes(); V_1 = new ClassHierarchyBuilder(this.offsetToExpression, this.context.get_MethodContext().get_ControlFlowGraph().get_OffsetToInstruction(), this.context); this.inferenceGraph = V_1.BuildHierarchy(V_0); this.MergeConnectedComponents(); this.RemoveTransitiveEdges(); this.ProcessSingleConstraints(); V_2 = null; V_4 = this.inferenceGraph.GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); if (!V_5.get_IsHardNode() || !String.op_Equality(V_5.get_NodeType().get_FullName(), "System.Object")) { continue; } V_2 = V_5; goto Label0; } } finally { if (V_4 != null) { V_4.Dispose(); } } Label0: V_3 = new List <ClassHierarchyNode>(); V_3.Add(V_2); V_4 = this.inferenceGraph.GetEnumerator(); try { while (V_4.MoveNext()) { V_6 = V_4.get_Current(); if (V_6.get_IsHardNode()) { continue; } V_3.Add(V_6); } } finally { if (V_4 != null) { V_4.Dispose(); } } this.MergeNodes(V_3); this.InferIntegerTypes(V_0); this.AddCasts(); return; }
private bool TryMatchInternal(StatementCollection statements, int startIndex, out Statement result) { result = null; if (statements.get_Count() < startIndex + 2) { return(false); } if (statements.get_Item(startIndex).get_CodeNodeType() != 5 || statements.get_Item(startIndex + 1).get_CodeNodeType() != 3) { return(false); } if (!String.IsNullOrEmpty(statements.get_Item(startIndex + 1).get_Label())) { return(false); } V_3 = (statements.get_Item(startIndex) as ExpressionStatement).get_Expression() as BinaryExpression; if (!this.IsAssignToVariableExpression(V_3, out V_0)) { return(false); } V_1 = V_3.get_Right(); V_4 = statements.get_Item(startIndex + 1) as IfStatement; if (this.ContainsDummyAssignment(V_4.get_Then(), V_0)) { stackVariable50 = 1; } else { stackVariable50 = 0; } V_5 = stackVariable50; if (V_4.get_Else() != null || V_4.get_Then().get_Statements().get_Count() != 1 + V_5 || V_4.get_Then().get_Statements().get_Item(V_5).get_CodeNodeType() != 5 || !String.IsNullOrEmpty(V_4.get_Then().get_Statements().get_Item(V_5).get_Label())) { return(false); } V_6 = V_4.get_Condition() as BinaryExpression; if (V_6 == null || V_6.get_Operator() != 9 || V_6.get_Left().get_CodeNodeType() != 26 || (object)(V_6.get_Left() as VariableReferenceExpression).get_Variable() != (object)V_0 || V_6.get_Right().get_CodeNodeType() != 22 || (V_6.get_Right() as LiteralExpression).get_Value() != null) { return(false); } V_7 = (V_4.get_Then().get_Statements().get_Item(V_5) as ExpressionStatement).get_Expression() as BinaryExpression; if (V_7 == null || !this.IsAssignToVariableExpression(V_7, out V_8) || (object)V_8 != (object)V_0) { return(false); } V_2 = V_7.get_Right(); if (!V_1.get_HasType() || !V_2.get_HasType() || String.op_Inequality(V_1.get_ExpressionType().get_FullName(), V_2.get_ExpressionType().get_FullName())) { return(false); } V_9 = new BinaryExpression(27, V_1, V_2, this.typeSystem, null, false); V_10 = new BinaryExpression(26, new VariableReferenceExpression(V_0, null), V_9, this.typeSystem, null, false); stackVariable150 = new ExpressionStatement(V_10); stackVariable150.set_Parent(statements.get_Item(startIndex).get_Parent()); result = stackVariable150; this.FixContext(V_0.Resolve(), 1, V_5 + 1, result as ExpressionStatement); return(true); }
private void CreateGraph(IEnumerable <IntervalConstruct> intervals) { V_0 = intervals.GetEnumerator(); try { while (V_0.MoveNext()) { V_1 = V_0.get_Current(); V_2 = V_1.get_Children().GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = (ILogicalConstruct)V_2.get_Current(); V_4 = this.GetNodeSuccessors(V_3).GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); if (!this.nodeToInterval.ContainsKey(V_5) || this.nodeToInterval.get_Item(V_5) == V_1) { continue; } V_6 = this.nodeToInterval.get_Item(V_5); if (V_1.get_SameParentSuccessors().Contains(V_6)) { continue; } dummyVar0 = V_1.get_SameParentSuccessors().Add(V_6); dummyVar1 = V_6.get_SameParentPredecessors().Add(V_1); } } finally { if (V_4 != null) { V_4.Dispose(); } } } } finally { ((IDisposable)V_2).Dispose(); } } } finally { if (V_0 != null) { V_0.Dispose(); } } return; }
private bool RemoveStateSavingBlocks() { V_0 = this.theCFG.get_Blocks()[(int)this.theCFG.get_Blocks().Length - 1]; V_1 = V_0.get_First(); while (V_1.get_OpCode().get_Code() == null && (object)V_1 != (object)V_0.get_Last()) { V_1 = V_1.get_Next(); } if (V_1.get_OpCode().get_Code() != 41) { return(false); } V_2 = 0; V_4 = (new HashSet <InstructionBlock>(V_0.get_Predecessors())).GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); if ((int)V_5.get_Successors().Length <= 1) { if (V_5.get_Predecessors().get_Count() != 1 || !InstructionBlock.op_Inequality(this.theCFG.get_Blocks()[(int)this.theCFG.get_Blocks().Length - 2], V_5)) { V_5.set_Successors(new InstructionBlock[0]); V_2 = V_2 + 1; } else { if (this.CheckForStateFieldSet(V_5) && this.TryRemoveStateSavingBlock(V_5)) { continue; } V_6 = false; goto Label1; } } else { V_6 = false; goto Label1; } } goto Label0; } finally { ((IDisposable)V_4).Dispose(); } Label1: return(V_6); Label0: dummyVar0 = this.toBeRemoved.Add(V_0); return(V_2 == 2); }
public void MergeNodes(HashSet <ISingleEntrySubGraph> constructs, ISingleEntrySubGraph originalEntry, ISingleEntrySubGraph newConstruct) { V_0 = this.constructToNodeMap.get_Item(originalEntry); stackVariable5 = new DTNode(newConstruct); stackVariable5.set_Predecessor(V_0.get_Predecessor()); V_1 = stackVariable5; V_1.get_DominanceFrontier().UnionWith(V_0.get_DominanceFrontier()); dummyVar0 = V_1.get_DominanceFrontier().Remove(V_0); if (V_1.get_Predecessor() != null) { dummyVar1 = V_1.get_Predecessor().get_TreeEdgeSuccessors().Remove(V_0); dummyVar2 = V_1.get_Predecessor().get_TreeEdgeSuccessors().Add(V_1); } V_2 = constructs.GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = V_2.get_Current(); dummyVar3 = this.constructToNodeMap.Remove(V_3); } } finally { ((IDisposable)V_2).Dispose(); } V_4 = this.constructToNodeMap.GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); if (V_5.get_Value().get_Predecessor() != null && constructs.Contains(V_5.get_Value().get_Predecessor().get_Construct())) { V_5.get_Value().set_Predecessor(V_1); dummyVar4 = V_1.get_TreeEdgeSuccessors().Add(V_5.get_Value()); } if (!V_5.get_Value().get_DominanceFrontier().Remove(V_0)) { continue; } dummyVar5 = V_5.get_Value().get_DominanceFrontier().Add(V_1); } } finally { ((IDisposable)V_4).Dispose(); } if (this.get_RootConstruct() == originalEntry) { this.set_RootConstruct(newConstruct); } this.constructToNodeMap.Add(newConstruct, V_1); return; }
public int WriteParameterAttributes(ParameterDefinition parameter, bool isWinRTMethodImplementation) { if (isWinRTMethodImplementation) { stackVariable1 = null; } else { stackVariable1 = this.GetInAttribute(parameter); } V_0 = stackVariable1; if (isWinRTMethodImplementation) { stackVariable3 = null; } else { stackVariable3 = this.GetOutAttribute(parameter); } V_1 = stackVariable3; V_2 = new List <CustomAttribute>(); if (V_0 != null) { V_2.Add(V_0); } if (V_1 != null) { V_2.Add(V_1); } V_2.AddRange(parameter.get_CustomAttributes()); V_3 = 0; V_4 = V_2.GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); if (this.attributesNotToShow.Contains(V_5.get_AttributeType().get_FullName())) { continue; } if (V_3 != 0) { this.genericWriter.Write(this.get_ParameterAttributeSeparator()); } this.WriteAttribute(V_5, true, false); V_3 = V_3 + 1; } } finally { ((IDisposable)V_4).Dispose(); } return(V_3); }
protected override string ToString(string constructName, HashSet <CFGBlockLogicalConstruct> printedCFGBlocks, LogicalFlowBuilderContext context) { V_0 = new StringBuilder(this.GetType().get_Name()); dummyVar0 = V_0.AppendLine(); dummyVar1 = V_0.AppendLine("{"); this.IndentAndAppendString(V_0, (this.get_Entry() as LogicalConstructBase).ToString(context)); dummyVar2 = V_0.AppendLine(); if (this.get_DefaultCase() != null) { this.IndentAndAppendString(V_0, this.get_DefaultCase().ToString(context)); } V_1 = this.get_ConditionCases(); V_2 = 0; while (V_2 < (int)V_1.Length) { this.IndentAndAppendString(V_0, V_1[V_2].ToString(context)); V_2 = V_2 + 1; } V_4 = this.get_NonDominatedCFGSuccessors().GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); dummyVar3 = V_0.Append("\tCase"); V_6 = V_5.get_Key().GetEnumerator(); try { while (V_6.MoveNext()) { V_7 = V_6.get_Current(); dummyVar4 = V_0.Append(" ").Append(V_7); } } finally { ((IDisposable)V_6).Dispose(); } dummyVar5 = V_0.Append(": ").AppendLine(this.NodeILOffset(context, V_5.get_Value())); } } finally { ((IDisposable)V_4).Dispose(); } if (this.get_DefaultCase() == null) { dummyVar6 = V_0.Append("\tDefault: ").AppendLine(this.NodeILOffset(context, this.get_DefaultCFGSuccessor())); } dummyVar7 = V_0.Append("\tFollowNode: ").AppendLine(this.NodeILOffset(context, this.get_CFGFollowNode())); dummyVar8 = V_0.AppendLine("}"); printedCFGBlocks.UnionWith(this.get_CFGBlocks()); return(V_0.ToString()); }
private void MarkPartitioningVertices(int startInstructionBlockIndex) { V_0 = this.cfg.get_Blocks()[startInstructionBlockIndex]; V_1 = this.FindMostDistantSuccessor(V_0); if (InstructionBlock.op_Equality(V_1, null)) { return; } if (V_1.get_Index() == this.cfg.get_Blocks().Count <InstructionBlock>() - 1) { return; } V_2 = null; V_3 = V_0.get_Index() + 1; while (V_3 <= V_1.get_Index()) { if (!InstructionBlock.op_Equality(V_2, null)) { V_4 = this.FindMostDistantSuccessor(this.cfg.get_Blocks()[V_3]); if (V_4.get_Index() > V_2.get_Index()) { V_2 = V_4; } } else { V_2 = this.FindMostDistantSuccessor(this.cfg.get_Blocks()[V_3]); } V_3 = V_3 + 1; } if ((long)V_1.get_Index() < (ulong)this.mostDistantInstructionBlockIndexReached) { if (InstructionBlock.op_Inequality(V_2, null) && (long)V_2.get_Index() > (ulong)this.mostDistantInstructionBlockIndexReached) { this.mostDistantInstructionBlockIndexReached = V_2.get_Index(); } } else { if (!InstructionBlock.op_Inequality(V_2, null)) { this.verticesThatPartitionGraph.Add(V_1); } else { if (V_2.get_Index() <= V_1.get_Index()) { this.verticesThatPartitionGraph.Add(V_1); } } } this.MarkPartitioningVertices(V_1.get_Index()); return; }
public IEnumerable <ICollection <ClassHierarchyNode> > GetConnectedComponents() { do { V_0 = null; V_2 = this.inferenceGraph.GetEnumerator(); try { while (V_2.MoveNext()) { V_3 = V_2.get_Current(); if (this.used.ContainsKey(V_3)) { continue; } V_0 = V_3; goto Label0; } } finally { if (V_2 != null) { V_2.Dispose(); } } Label0: if (V_0 == null) { continue; } this.RecursiveDfs(V_0); }while (V_0 != null); V_1 = new ICollection <ClassHierarchyNode> [this.componentCount]; V_4 = this.nodeToComponent.get_Keys().GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); V_6 = this.nodeToComponent.get_Item(V_5); if (V_1[V_6] == null) { V_1[V_6] = new List <ClassHierarchyNode>(); } ((List <ClassHierarchyNode>)V_1[V_6]).Add(V_5); } } finally { ((IDisposable)V_4).Dispose(); } return(V_1); }
private void GenerateStackData() { V_0 = new StackUsageData(); V_1 = this.instructionOffsetToUsedInstructionsMap.GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); V_3 = new List<VariableDefinition>(V_2.get_Value().Select<int, VariableDefinition>(new Func<int, VariableDefinition>(this.u003cGenerateStackDatau003eb__25_0))); V_0.get_InstructionOffsetToUsedStackVariablesMap().set_Item(V_2.get_Key(), V_3); V_4 = V_3.GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); this.GetDefineUseInfo(V_0, V_5).get_UsedAt().Add(V_2.get_Key()); } } finally { ((IDisposable)V_4).Dispose(); } } } finally { ((IDisposable)V_1).Dispose(); } V_6 = this.instructionOffsetToVariableDefinitionMap.GetEnumerator(); try { while (V_6.MoveNext()) { V_7 = V_6.get_Current(); if (V_7.get_Key() >= 0) { V_0.get_InstructionOffsetToAssignedVariableMap().Add(V_7.get_Key(), V_7.get_Value()); dummyVar0 = this.GetDefineUseInfo(V_0, V_7.get_Value()).get_DefinedAt().Add(V_7.get_Key()); } else { V_0.get_ExceptionHandlerStartToExceptionVariableMap().Add(-V_7.get_Key(), V_7.get_Value()); } } } finally { ((IDisposable)V_6).Dispose(); } this.methodContext.set_StackData(V_0); return; }
private Statement FixSwitchingStatement(Statement statement) { if (statement as SwitchStatement == null) { if (statement as IfElseIfStatement != null) { V_4 = (statement as IfElseIfStatement).get_ConditionBlocks().GetEnumerator(); try { while (V_4.MoveNext()) { V_5 = V_4.get_Current(); this.FixConditionExpression(V_5.get_Key() as BinaryExpression); } } finally { ((IDisposable)V_4).Dispose(); } } } else { V_0 = statement as SwitchStatement; if (V_0.get_Condition().Equals(this.theIntVariable)) { V_0.set_Condition(this.theStringVariable.CloneExpressionOnly()); } V_1 = V_0.get_Cases().GetEnumerator(); try { while (V_1.MoveNext()) { V_2 = V_1.get_Current(); if (V_2 as ConditionCase == null) { continue; } stackVariable34 = V_2 as ConditionCase; V_3 = (Int32)(stackVariable34.get_Condition() as LiteralExpression).get_Value(); stackVariable34.set_Condition(new LiteralExpression(this.valueDictionary.get_Item(V_3), this.theTypeSystem, null)); } } finally { if (V_1 != null) { V_1.Dispose(); } } } return(statement); }