From: jjenista Date: Wed, 22 Apr 2009 19:56:48 +0000 (+0000) Subject: add a convenient method to retreive FlatMethod from task or method X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=eb40808a4084e4942b4cb979b44b0cce94d58e0c;hp=bdbcc390b0eced6f8ca187e1f80957d95d989716;p=IRC.git add a convenient method to retreive FlatMethod from task or method --- diff --git a/Robust/src/IR/State.java b/Robust/src/IR/State.java index 7a56b557..011a1756 100644 --- a/Robust/src/IR/State.java +++ b/Robust/src/IR/State.java @@ -188,6 +188,19 @@ public class State { return (FlatMethod)flatmethodmap.get(td); } + // The descriptor is either a method or task desc + // and should call one of the above methods + public FlatMethod getMethodFlat(Descriptor d) { + FlatMethod fm; + if( d instanceof MethodDescriptor ) { + fm = getMethodFlat( (MethodDescriptor) d); + } else { + assert d instanceof TaskDescriptor; + fm = getMethodFlat( (TaskDescriptor) d); + } + return fm; + } + public void addTreeCode(MethodDescriptor md, BlockNode bn) { treemethodmap.put(md,bn); }