本文整理匯總了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;
}