MCPcopy Create free account
hub / github.com/bytedance/bolt / processConcreteSignature

Function processConcreteSignature

bolt/expression/fuzzer/ExpressionFuzzer.cpp:415–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

413}
414
415std::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.

Callers 1

ExpressionFuzzerMethod · 0.85

Calls 5

tryResolveTypeFunction · 0.85
variableArityMethod · 0.80
emptyMethod · 0.45
isPrimitiveTypeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected