MCPcopy Create free account
hub / github.com/avast/retdec / createFunctionType

Method createFunctionType

src/ctypes/function.cpp:194–210  ·  view source on GitHub ↗

* @brief Creates function type. * * @param context Storage for already created functions, types. * @param returnType Function return type. * @param parameters Function parameters. * @param callConvention Function call convention. * @param varArgness Info that function takes variable number of arguments or not. * * @par Preconditions * - @a context is not null * - @a returnType is not null */

Source from the content-addressed store, hash-verified

192* - @a returnType is not null
193*/
194std::shared_ptr<FunctionType> Function::createFunctionType(
195 const std::shared_ptr<Context> &context,
196 const std::shared_ptr<Type> &returnType,
197 const Parameters &parameters,
198 const CallConvention &callConvention,
199 VarArgness varArgness)
200{
201 assert(context && "violated precondition - context cannot be null");
202 assert(returnType && "violated precondition - returnType cannot be null");
203
204 FunctionType::Parameters paramTypes;
205 for (const auto &param: parameters)
206 {
207 paramTypes.push_back(param.getType());
208 }
209 return FunctionType::create(context, returnType, paramTypes, callConvention, varArgness);
210}
211
212/**
213* @brief Sets function's call convention.

Callers

nothing calls this directly

Calls 1

getTypeMethod · 0.45

Tested by

no test coverage detected