| 33 | } |
| 34 | |
| 35 | void LoopAnalyzer::analyzeLoop(llvm::Argument &A) { |
| 36 | std::set<Value *> VisitedNodes; |
| 37 | |
| 38 | ArgFlow &AF = getOrCreateArgFlow(A); |
| 39 | |
| 40 | // DefUseChanins used as stack, |
| 41 | // StackFrame includes the value(Argument/Field) need to tracking, |
| 42 | // and ArgFlow for which analysis result will be updated. |
| 43 | std::stack<StackFrame> DefUseChains; |
| 44 | DefUseChains.emplace(&A, AF); |
| 45 | |
| 46 | while (!DefUseChains.empty()) { |
| 47 | auto Frame = DefUseChains.top(); |
| 48 | DefUseChains.pop(); |
| 49 | handleStackFrame(Frame, DefUseChains, VisitedNodes); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | void LoopAnalyzer::handleStackFrame(StackFrame &Frame, |
| 54 | std::stack<StackFrame> &DefUseChains, |