1

这是相关的代码片段,我无法从 valuebox 中打印出值。我可以知道有什么问题吗?

public GuaranteedDefsAnalysis(UnitGraph graph)
{
    super(graph);
    DominatorsFinder df = new MHGDominatorsFinder(graph);
    unitToGenerateSet = new HashMap<Unit, FlowSet>(graph.size() * 2 + 1, 0.7f);

    // pre-compute generate sets
    for(Iterator unitIt = graph.iterator(); unitIt.hasNext();){
        Unit s = (Unit) unitIt.next();
        FlowSet genSet = emptySet.clone();

        for(Iterator domsIt = df.getDominators(s).iterator(); domsIt.hasNext();){
            Unit dom = (Unit) domsIt.next();
            for(Iterator boxIt = dom.getDefBoxes().iterator(); boxIt.hasNext();){
                ValueBox box = (ValueBox) boxIt.next();
                box.getValue().toString(); // simply using toString does not work
                if(box.getValue() instanceof Local)
                    genSet.add(box.getValue(), genSet);
            }
        }

        unitToGenerateSet.put(s, genSet);
    }

    doAnalysis();
}
4

1 回答 1

0

你能改写你的问题吗?“不起作用”是什么意思?您是否忘记添加 println 语句?

于 2014-01-06T08:12:19.843 回答