本文整理汇总了C#中AssociativeGraph.DependsOnTempSSA方法的典型用法代码示例。如果您正苦于以下问题:C# AssociativeGraph.DependsOnTempSSA方法的具体用法?C# AssociativeGraph.DependsOnTempSSA怎么用?C# AssociativeGraph.DependsOnTempSSA使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssociativeGraph
的用法示例。
在下文中一共展示了AssociativeGraph.DependsOnTempSSA方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRedefinedGraphNodes
/// <summary>
/// GetRedefinedGraphNodes will return a list of graphnodes that have been redefined by executingGraphNode
///
/// Given:
/// [1] a = b + c
/// [2] a = d
/// Statement [1] has been redefined by statment [2]
/// Return true if this has occured
///
/// </summary>
/// <param name="executingGraphNode"></param>
/// <param name="classScope"></param>
/// <param name="functionScope"></param>
public static List<AssociativeGraph.GraphNode> GetRedefinedGraphNodes(RuntimeCore runtimeCore, AssociativeGraph.GraphNode executingGraphNode, List<AssociativeGraph.GraphNode> nodesInScope, int classScope, int functionScope)
{
List<AssociativeGraph.GraphNode> redefinedNodes = new List<AssociativeGraph.GraphNode>();
if (executingGraphNode != null)
{
// Remove this condition when full SSA is enabled
bool isssa = (!executingGraphNode.IsSSANode() && executingGraphNode.DependsOnTempSSA());
if (runtimeCore.Options.ExecuteSSA)
{
isssa = executingGraphNode.IsSSANode();
}
if (!isssa)
{
foreach (AssociativeGraph.GraphNode graphNode in nodesInScope)
{
bool allowRedefine = true;
SymbolNode symbol = executingGraphNode.updateNodeRefList[0].nodeList[0].symbol;
bool isMember = symbol.classScope != Constants.kInvalidIndex
&& symbol.functionIndex == Constants.kInvalidIndex;
if (isMember)
{
// For member vars, do not allow if not in the same scope
if (symbol.classScope != graphNode.classIndex || symbol.functionIndex != graphNode.procIndex)
{
allowRedefine = false;
}
}
if (allowRedefine)
{
// Check if graphnode was redefined by executingGraphNode
if (AssociativeEngine.Utils.IsGraphNodeRedefined(graphNode, executingGraphNode))
{
redefinedNodes.Add(graphNode);
}
}
}
}
}
return redefinedNodes;
}