Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Design a dataflow analysis that detects unused declarations. An unused declaration is a declaration of a variable that is never used in a program
1. Design a dataflow analysis that detects unused declarations. An unused declaration is a declaration of a variable that is never used in a program (though it may be defined) a) This is a bit vector analysis, where each object of interest in the analysis takes on the value 0 or 1. Is it forward or backward? Explain your answer (b) What data do you need to keep track of at each program point? (c) Give the GEN(s) and KILL(s) sets for this analysis, in terms of DEF(s) and USE(s), the variables defined and used in a statement (d) Define IN and OUT for this analysis (don't forget which direction your analysis is running: if you're running forward, IN should be defined in terms of a state- ment's predecessors, and OUT should be defined in terms of IN. If you're running backwards, OUT is defined in terms of a statement's successors, and IN is defined in terms of OUT). Don't forget to think about how your analysis should behave at merge statemen (e) How should this analysis be initialized? (In a forward analysis, what is IN of the first statement, in a backward analysis, what is OUT of the last statement?)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started