This repository was archived by the owner on May 21, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +67
-1
lines changed Expand file tree Collapse file tree 3 files changed +67
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ class SBType
90
90
bool
91
91
IsReferenceType ();
92
92
93
+ bool
94
+ IsFunctionType ();
95
+
93
96
lldb::SBType
94
97
GetPointerType ();
95
98
@@ -141,6 +144,12 @@ class SBType
141
144
lldb::TemplateArgumentKind
142
145
GetTemplateArgumentKind (uint32_t idx);
143
146
147
+ lldb::SBType
148
+ GetFunctionReturnType ();
149
+
150
+ lldb::SBTypeList
151
+ GetFunctionArgumentTypes ();
152
+
144
153
const char *
145
154
GetName ();
146
155
Original file line number Diff line number Diff line change @@ -161,6 +161,9 @@ public:
161
161
162
162
bool
163
163
IsReferenceType ();
164
+
165
+ bool
166
+ IsFunctionType ();
164
167
165
168
lldb::SBType
166
169
GetPointerType ();
@@ -216,6 +219,12 @@ public:
216
219
lldb::TemplateArgumentKind
217
220
GetTemplateArgumentKind (uint32_t idx);
218
221
222
+ lldb::SBType
223
+ GetFunctionReturnType ();
224
+
225
+ lldb::SBTypeList
226
+ GetFunctionArgumentTypes ();
227
+
219
228
bool
220
229
IsTypeComplete ();
221
230
@@ -240,7 +249,10 @@ public:
240
249
241
250
__swig_getmethods__[" is_reference" ] = IsReferenceType
242
251
if _newclass: is_reference = property (IsReferenceType, None, doc=' ' ' A read only property that returns a boolean value that indicates if this type is a reference type.' ' ' )
243
-
252
+
253
+ __swig_getmethods__[" is_function" ] = IsFunctionType
254
+ if _newclass: is_reference = property (IsReferenceType, None, doc=' ' ' A read only property that returns a boolean value that indicates if this type is a function type.' ' ' )
255
+
244
256
__swig_getmethods__[" num_fields" ] = GetNumberOfFields
245
257
if _newclass: num_fields = property (GetNumberOfFields, None, doc=' ' ' A read only property that returns number of fields in this type as an integer.' ' ' )
246
258
Original file line number Diff line number Diff line change @@ -219,6 +219,51 @@ SBType::GetDereferencedType()
219
219
return SBType (ClangASTType (m_opaque_sp->GetASTContext (),qt.getNonReferenceType ().getAsOpaquePtr ()));
220
220
}
221
221
222
+ bool
223
+ SBType::IsFunctionType ()
224
+ {
225
+ if (IsValid ())
226
+ {
227
+ QualType qual_type (QualType::getFromOpaquePtr (m_opaque_sp->GetOpaqueQualType ()));
228
+ const FunctionProtoType* func = dyn_cast<FunctionProtoType>(qual_type.getTypePtr ());
229
+ return func != NULL ;
230
+ }
231
+ return false ;
232
+ }
233
+
234
+ lldb::SBType
235
+ SBType::GetFunctionReturnType ()
236
+ {
237
+ if (IsValid ())
238
+ {
239
+ QualType qual_type (QualType::getFromOpaquePtr (m_opaque_sp->GetOpaqueQualType ()));
240
+ const FunctionProtoType* func = dyn_cast<FunctionProtoType>(qual_type.getTypePtr ());
241
+
242
+ if (func)
243
+ return SBType (ClangASTType (m_opaque_sp->GetASTContext (),
244
+ func->getResultType ().getAsOpaquePtr ()));
245
+ }
246
+ return lldb::SBType ();
247
+ }
248
+
249
+ lldb::SBTypeList
250
+ SBType::GetFunctionArgumentTypes ()
251
+ {
252
+ SBTypeList sb_type_list;
253
+ if (IsValid ())
254
+ {
255
+ QualType qual_type (QualType::getFromOpaquePtr (m_opaque_sp->GetOpaqueQualType ()));
256
+ const FunctionProtoType* func = dyn_cast<FunctionProtoType>(qual_type.getTypePtr ());
257
+ if (func)
258
+ {
259
+ const uint32_t num_args = func->getNumArgs ();
260
+ for (uint32_t i=0 ; i<num_args; ++i)
261
+ sb_type_list.Append (SBType (ClangASTType (m_opaque_sp->GetASTContext (), func->getArgType (i).getAsOpaquePtr ())));
262
+ }
263
+ }
264
+ return sb_type_list;
265
+ }
266
+
222
267
lldb::SBType
223
268
SBType::GetUnqualifiedType ()
224
269
{
You can’t perform that action at this time.
0 commit comments