| 256 | } |
| 257 | |
| 258 | void DirectionAnalyzer::updateFieldFlow(ArgFlow &AF, std::vector<int> Indices) { |
| 259 | auto &A = AF.getLLVMArg(); |
| 260 | auto *T = A.getType(); |
| 261 | while (isa<llvm::PointerType>(T)) |
| 262 | T = T->getPointerElementType(); |
| 263 | |
| 264 | auto *ST = dyn_cast_or_null<llvm::StructType>(T); |
| 265 | if (!ST) |
| 266 | return; |
| 267 | |
| 268 | for (unsigned S = 0; S < ST->getNumElements(); ++S) { |
| 269 | Indices.push_back(S); |
| 270 | if (Report->has(A, Indices)) { |
| 271 | AF.setStruct(ST); |
| 272 | auto &FF = AF.getOrCreateFieldFlow(S); |
| 273 | FF.setArgDir(Report->get(A, Indices)); |
| 274 | updateFieldFlow(FF, Indices); |
| 275 | } |
| 276 | Indices.pop_back(); |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | void DirectionAnalyzer::updateDefault(const llvm::Module &M) { |
| 281 | if (!Report) |