| 1267 | } |
| 1268 | |
| 1269 | const SignatureTemplate* ExpressionFuzzer::findSignatureTemplate( |
| 1270 | const std::vector<TypePtr>& argTypes, |
| 1271 | const TypePtr& returnType, |
| 1272 | const std::string& typeName, |
| 1273 | const std::string& functionName) { |
| 1274 | std::vector<const SignatureTemplate*> eligible; |
| 1275 | if (expressionToTemplatedSignature_.find(functionName) == |
| 1276 | expressionToTemplatedSignature_.end()) { |
| 1277 | return nullptr; |
| 1278 | } |
| 1279 | auto it = expressionToTemplatedSignature_[functionName].find(typeName); |
| 1280 | if (it == expressionToTemplatedSignature_[functionName].end()) { |
| 1281 | return nullptr; |
| 1282 | } |
| 1283 | |
| 1284 | for (auto signatureTemplate : it->second) { |
| 1285 | // Skip signatures with constant arguments. |
| 1286 | if (signatureTemplate->signature->hasConstantArgument()) { |
| 1287 | continue; |
| 1288 | } |
| 1289 | |
| 1290 | FullSignatureBinder binder{ |
| 1291 | *signatureTemplate->signature, argTypes, returnType}; |
| 1292 | if (binder.tryBind()) { |
| 1293 | return signatureTemplate; |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | return nullptr; |
| 1298 | } |
| 1299 | |
| 1300 | core::TypedExprPtr ExpressionFuzzer::generateExpressionFromSignatureTemplate( |
| 1301 | const TypePtr& returnType, |
nothing calls this directly
no test coverage detected