| 295 | } |
| 296 | |
| 297 | void AllocSizeAnalyzer::updateDefault(const llvm::Module &M) { |
| 298 | ManualAllocLoader MAL; |
| 299 | for (const auto &F : M) { |
| 300 | if (!F.isDeclaration()) |
| 301 | continue; |
| 302 | |
| 303 | if (MAL.isAllocFunction(F)) { |
| 304 | std::map<unsigned, bool> DefaultValueMap; |
| 305 | for (auto AllocSizeArg : MAL.getAllocSizeArgNo(F)) { |
| 306 | if (AllocSizeArg > F.arg_size()) |
| 307 | continue; |
| 308 | DefaultValueMap.emplace(AllocSizeArg, true); |
| 309 | } |
| 310 | updateDefault(*const_cast<llvm::Function *>(&F), DefaultValueMap); |
| 311 | continue; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | for (auto Iter : ArgFlowMap) { |
| 316 | auto &AF = Iter.second; |
| 317 | if (!AF) |
| 318 | continue; |
| 319 | |
| 320 | if (AF->getState() != AnalysisState_Pre_Analyzed) |
| 321 | continue; |
| 322 | |
| 323 | Report.add(*AF); |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | void AllocSizeAnalyzer::updateDefault(const llvm::Function &F, |
| 328 | const std::map<unsigned, bool> &Values) { |
nothing calls this directly
no test coverage detected