bug fixes: printing out linenum & source file name in the conflict graph.
[IRC.git] / Robust / src / Analysis / OoOJava / ContextTaskNames.java
1 package Analysis.OoOJava;
2
3 import IR.*;
4 import IR.Flat.*;
5 import java.util.*;
6 import java.io.*;
7
8 // The purpose of a ContextTaskNames is to collect the static and
9 // dynamic names for tasks that the context needs to track information
10 // in that context.
11 //
12 // For example, a method might have two tasks defined in different
13 // control branches, either of which may provide a value to a third
14 // task in the context.  In this case a dynamic task name should be
15 // saved here so that when the code for the method is generated, a
16 // local variable that points to a task will be declared.  Other flat
17 // nodes will have CodePlan objects that will expect the local task
18 // variable name to exist.
19 //
20 // There are two types of contexts: methods and task bodies.  Here we
21 // don't see the difference because the names of the local variables
22 // generated from these task names should be the same.
23
24
25 public class ContextTaskNames {
26
27   protected Set<SESEandAgePair> needStaticNameInCode;
28   protected Set<TempDescriptor> dynamicVars;
29
30
31   public ContextTaskNames() {
32     needStaticNameInCode = new HashSet<SESEandAgePair>();
33     dynamicVars          = new HashSet<TempDescriptor>();
34   }
35
36
37   public void addNeededStaticName( SESEandAgePair p ) {
38     needStaticNameInCode.add( p );
39   }
40
41   public Set<SESEandAgePair> getNeededStaticNames() {
42     return needStaticNameInCode;
43   }
44
45   public void addDynamicVar( TempDescriptor td ) {
46     dynamicVars.add( td );
47   }
48
49   public Set<TempDescriptor> getDynamicVarSet() {
50     return dynamicVars;
51   }
52
53 }