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

Function createType

bolt/type/Type.cpp:852–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

850}
851
852TypePtr createType(TypeKind kind, std::vector<TypePtr>&& children) {
853 if (kind == TypeKind::FUNCTION) {
854 BOLT_USER_CHECK_GE(
855 children.size(),
856 1,
857 "FUNCTION type should have at least one child type");
858 std::vector<TypePtr> argTypes(
859 children.begin(), children.begin() + children.size() - 1);
860 return std::make_shared<FunctionType>(std::move(argTypes), children.back());
861 }
862
863 if (kind == TypeKind::UNKNOWN) {
864 BOLT_USER_CHECK_EQ(
865 children.size(), 0, "UNKNOWN type should not have child types");
866 return UNKNOWN();
867 }
868 return BOLT_DYNAMIC_TYPE_DISPATCH(createType, kind, std::move(children));
869}
870
871template <>
872TypePtr createType<TypeKind::ROW>(std::vector<TypePtr>&& /*children*/) {

Callers 1

createMethod · 0.70

Calls 4

UNKNOWNFunction · 0.85
backMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected