| 208 | } |
| 209 | |
| 210 | void LoopAnalyzer::updateFieldFlow(ArgFlow &AF, std::vector<int> Indices) { |
| 211 | auto &A = AF.getLLVMArg(); |
| 212 | auto *T = A.getType(); |
| 213 | while (isa<llvm::PointerType>(T)) |
| 214 | T = T->getPointerElementType(); |
| 215 | |
| 216 | auto *ST = dyn_cast_or_null<llvm::StructType>(T); |
| 217 | if (!ST) |
| 218 | return; |
| 219 | |
| 220 | for (unsigned S = 0; S < ST->getNumElements(); ++S) { |
| 221 | Indices.push_back(S); |
| 222 | if (!Report.has(A, Indices)) { |
| 223 | Indices.pop_back(); |
| 224 | continue; |
| 225 | } |
| 226 | |
| 227 | AF.setStruct(ST); |
| 228 | auto &FF = AF.getOrCreateFieldFlow(S); |
| 229 | auto Value = Report.get(A, Indices); |
| 230 | FF.LoopExit = Value.LoopExit; |
| 231 | FF.LoopDepth = Value.LoopDepth; |
| 232 | auto FI = FF.getFieldInfo(); |
| 233 | updateFieldFlow(FF, Indices); |
| 234 | Indices.pop_back(); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | } // namespace ftg |
nothing calls this directly
no test coverage detected