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

Method getFunctionType

src/ctypes/context.cpp:85–97  ·  view source on GitHub ↗

* @brief Returns function type from context. * * @return Requested type. If it is not in context return @c nullptr. * * @par Preconditions * - @a returnType is not null */

Source from the content-addressed store, hash-verified

83* - @a returnType is not null
84*/
85std::shared_ptr<FunctionType> Context::getFunctionType(
86 const std::shared_ptr<Type> &returnType,
87 const FunctionType::Parameters &parameters,
88 const CallConvention &callConvention,
89 FunctionType::VarArgness varArgness) const
90{
91 assert(returnType && "violated precondition - returnType cannot be null");
92
93 bool isVarArg = varArgness == FunctionType::VarArgness::IsVarArg;
94 std::string callConv = callConvention;
95 auto key = std::make_tuple(returnType, parameters, callConv, isVarArg);
96 return retdec::utils::mapGetValueOrDefault(functionTypes, key);
97}
98
99/**
100* @brief Inserts new function type to context.

Callers 5

modifyFunctionMethod · 0.80
getPairFunctionMethod · 0.80
connectWrappersMethod · 0.80
runFunctionMethod · 0.80
createMethod · 0.80

Calls 1

mapGetValueOrDefaultFunction · 0.85

Tested by

no test coverage detected