| 116 | } |
| 117 | |
| 118 | bool DefMapGenerator::isBufferAllocSize( |
| 119 | const ASTIRNode &Node, |
| 120 | const AllocSizeAnalysisReport &AllocSizeReport) const { |
| 121 | const auto *AN = Node.AST.getNodeForType(); |
| 122 | if (!AN) |
| 123 | return false; |
| 124 | |
| 125 | const auto *T = AN->getType().getTypePtrOrNull(); |
| 126 | if (!T || !T->isIntegerType()) |
| 127 | return false; |
| 128 | |
| 129 | auto &TNode = *const_cast<RDNode *>(&Node.IR); |
| 130 | if (auto *CB = llvm::dyn_cast<llvm::CallBase>(&TNode.getLocation())) { |
| 131 | if (auto *F = CB->getCalledFunction()) { |
| 132 | auto FuncName = F->getName().str(); |
| 133 | if (TNode.getIdx() >= 0 && |
| 134 | AllocSizeReport.has(FuncName, TNode.getIdx()) && |
| 135 | AllocSizeReport.get(FuncName, TNode.getIdx())) |
| 136 | return true; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | for (auto &FirstUse : TNode.getFirstUses()) { |
| 141 | auto FuncName = FirstUse.getFunctionName(); |
| 142 | if (AllocSizeReport.has(FuncName, FirstUse.ArgNo) && |
| 143 | AllocSizeReport.get(FuncName, FirstUse.ArgNo)) |
| 144 | return true; |
| 145 | } |
| 146 | |
| 147 | return false; |
| 148 | } |
| 149 | |
| 150 | bool DefMapGenerator::isLoopExit(const RDNode &Node, |
| 151 | const LoopAnalysisReport &LoopReport) const { |
nothing calls this directly
no test coverage detected