* @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 */
| 83 | * - @a returnType is not null |
| 84 | */ |
| 85 | std::shared_ptr<FunctionType> Context::getFunctionType( |
| 86 | const std::shared_ptr<Type> &returnType, |
| 87 | const FunctionType::Parameters ¶meters, |
| 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. |
no test coverage detected