@@ -8,16 +8,46 @@ namespace dataflow {
8
8
9
9
/* *
10
10
* Implement your data-flow analysis.
11
- * 1. Define "transfer" that computes the semantics of each instruction.
12
- * 2. Define "doAnalysis" that stores your results in "InMap" and "OutMap".
13
- * 3. Define "check" that checks if a given instruction is erroneous or not.
11
+ * 1. Define "join" that joins the memory state of two flows.
12
+ * 2. Define "order" which states if two memory sets are ordered
13
+ * 3. Define "flowIn" that joins the memory set of all incomming flows
14
+ * 4. Define "transfer" that computes the semantics of each instruction.
15
+ * 5. Define "flowOut" that flows the memory set to all outgoing flows
16
+ * 6. Define "doAnalysis" that stores your results in "InMap" and "OutMap".
17
+ * 7. Define "check" that checks if a given instruction is erroneous or not.
14
18
*/
15
19
20
+
21
+ void join (Memory *Result, Memory *M1, Memory *M2) {
22
+ /* Add your code here */
23
+ }
24
+
25
+ bool order (Memory *M1, Memory *M2) {
26
+ /* Add your code here */
27
+ }
28
+
29
+
30
+ void DivZeroAnalysis::flowIn (Instruction *I, Memory *In) {
31
+ /* Add your code here */
32
+ }
33
+
16
34
void DivZeroAnalysis::transfer (Instruction *I, const Memory *In, Memory *NOut) {
17
35
/* Add your code here */
18
36
}
19
37
20
- void DivZeroAnalysis::doAnalysis (Function &F) { /* Add your code here */ }
38
+ void DivZeroAnalysis::flowOut (Instruction *I, Memory *Pre, Memory *Post, SetVector <Instruction *> &WorkSet) {
39
+ /* Add your code here */
40
+ }
41
+
42
+ void DivZeroAnalysis::doAnalysis (Function &F) {
43
+ SetVector<Instruction *> WorkSet;
44
+ for (inst_iterator I = inst_begin (F), E = inst_end (F); I != E; ++I) {
45
+ WorkSet.insert (&(*I));
46
+ }
47
+
48
+ /* Add your code here */
49
+
50
+ }
21
51
22
52
bool DivZeroAnalysis::check (Instruction *I) {
23
53
/* Add your code here */
0 commit comments