| 413 | } |
| 414 | |
| 415 | std::optional<CallableSignature> processConcreteSignature( |
| 416 | const std::string& functionName, |
| 417 | const std::vector<TypePtr>& argTypes, |
| 418 | const exec::FunctionSignature& signature, |
| 419 | bool enableComplexTypes) { |
| 420 | BOLT_CHECK( |
| 421 | signature.variables().empty(), |
| 422 | "Only concrete signatures are processed here."); |
| 423 | |
| 424 | CallableSignature callable{ |
| 425 | .name = functionName, |
| 426 | .args = argTypes, |
| 427 | .variableArity = signature.variableArity(), |
| 428 | .returnType = |
| 429 | SignatureBinder::tryResolveType(signature.returnType(), {}, {}), |
| 430 | .constantArgs = signature.constantArguments()}; |
| 431 | BOLT_CHECK_NOT_NULL(callable.returnType); |
| 432 | |
| 433 | bool onlyPrimitiveTypes = callable.returnType->isPrimitiveType(); |
| 434 | |
| 435 | for (const auto& arg : argTypes) { |
| 436 | onlyPrimitiveTypes = onlyPrimitiveTypes && arg->isPrimitiveType(); |
| 437 | } |
| 438 | |
| 439 | if (!(onlyPrimitiveTypes || enableComplexTypes)) { |
| 440 | LOG(WARNING) << "Skipping '" << callable.toString() |
| 441 | << "' because it contains non-primitive types."; |
| 442 | |
| 443 | return std::nullopt; |
| 444 | } |
| 445 | return callable; |
| 446 | } |
| 447 | |
| 448 | // Determine whether type is or contains typeName. typeName should be in lower |
| 449 | // case. |
no test coverage detected