diff options
| author | Rusty Wagner <rusty@vector35.com> | 2016-01-25 15:16:43 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2016-01-25 23:13:23 -0500 |
| commit | ad05dd2072917e2487dcd34dbc249b2a0efac589 (patch) | |
| tree | 0392cd11853a91cbde36c0a8939116a5659fa1d3 /type.cpp | |
| parent | c2b2e11c009fa9b9c6c4a0fbba9210cb997e38ce (diff) | |
Initial implementation of platform ABI classes
Diffstat (limited to 'type.cpp')
| -rw-r--r-- | type.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -60,9 +60,12 @@ Ref<Type> Type::GetChildType() const } -BNCallingConvention Type::GetCallingConvention() const +Ref<CallingConvention> Type::GetCallingConvention() const { - return BNGetTypeCallingConvention(m_type); + BNCallingConvention* cc = BNGetTypeCallingConvention(m_type); + if (cc) + return new CoreCallingConvention(cc); + return nullptr; } @@ -196,7 +199,7 @@ Ref<Type> Type::ArrayType(Type* type, uint64_t elem) } -Ref<Type> Type::FunctionType(Type* returnValue, BNCallingConvention callingConvention, +Ref<Type> Type::FunctionType(Type* returnValue, CallingConvention* callingConvention, const std::vector<NameAndType>& params, bool varArg) { BNNameAndType* paramArray = new BNNameAndType[params.size()]; @@ -206,7 +209,8 @@ Ref<Type> Type::FunctionType(Type* returnValue, BNCallingConvention callingConve paramArray[i].type = params[i].type->GetTypeObject(); } - Type* type = new Type(BNCreateFunctionType(returnValue->GetTypeObject(), callingConvention, + Type* type = new Type(BNCreateFunctionType(returnValue->GetTypeObject(), + callingConvention ? callingConvention->GetCallingConventionObject() : nullptr, paramArray, params.size(), varArg)); delete[] paramArray; return type; |
