1359575Sdim%extend lldb::SBBreakpoint {
2359575Sdim    %pythoncode %{
3359575Sdim        def __eq__(self, rhs):
4359575Sdim            if not isinstance(rhs, type(self)):
5359575Sdim                return False
6359575Sdim
7359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
8359575Sdim
9359575Sdim        def __ne__(self, rhs):
10359575Sdim            if not isinstance(rhs, type(self)):
11359575Sdim                return True
12359575Sdim
13359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
14359575Sdim    %}
15359575Sdim}
16359575Sdim
17359575Sdim%extend lldb::SBBroadcaster {
18359575Sdim    %pythoncode %{
19359575Sdim        def __eq__(self, rhs):
20359575Sdim            if not isinstance(rhs, type(self)):
21359575Sdim                return False
22359575Sdim
23359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
24359575Sdim
25359575Sdim        def __ne__(self, rhs):
26359575Sdim            if not isinstance(rhs, type(self)):
27359575Sdim                return True
28359575Sdim
29359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
30359575Sdim    %}
31359575Sdim}
32359575Sdim
33359575Sdim%extend lldb::SBCommandReturnObject {
34359575Sdim        /* the write() and flush() calls are not part of the SB API proper, and are solely for Python usage
35359575Sdim        they are meant to make an SBCommandReturnObject into a file-like object so that instructions of the sort
36359575Sdim        print >>sb_command_return_object, "something"
37359575Sdim        will work correctly */
38359575Sdim
39359575Sdim        void lldb::SBCommandReturnObject::write (const char* str)
40359575Sdim        {
41359575Sdim            if (str)
42359575Sdim                $self->Printf("%s",str);
43359575Sdim        }
44359575Sdim        void lldb::SBCommandReturnObject::flush ()
45359575Sdim        {}
46359575Sdim}
47359575Sdim
48359575Sdim%extend lldb::SBCompileUnit {
49359575Sdim    %pythoncode %{
50359575Sdim        def __eq__(self, rhs):
51359575Sdim            if not isinstance(rhs, type(self)):
52359575Sdim                return False
53359575Sdim
54359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
55359575Sdim
56359575Sdim        def __ne__(self, rhs):
57359575Sdim            if not isinstance(rhs, type(self)):
58359575Sdim                return True
59359575Sdim
60359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
61359575Sdim    %}
62359575Sdim}
63359575Sdim
64359575Sdim%extend lldb::SBDeclaration {
65359575Sdim    %pythoncode %{
66359575Sdim        def __eq__(self, rhs):
67359575Sdim            if not isinstance(rhs, type(self)):
68359575Sdim                return False
69359575Sdim
70359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
71359575Sdim
72359575Sdim        def __ne__(self, rhs):
73359575Sdim            if not isinstance(rhs, type(self)):
74359575Sdim                return True
75359575Sdim
76359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
77359575Sdim    %}
78359575Sdim}
79359575Sdim
80359575Sdim%extend lldb::SBFunction {
81359575Sdim    %pythoncode %{
82359575Sdim        def __eq__(self, rhs):
83359575Sdim            if not isinstance(rhs, type(self)):
84359575Sdim                return False
85359575Sdim
86359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
87359575Sdim
88359575Sdim        def __ne__(self, rhs):
89359575Sdim            if not isinstance(rhs, type(self)):
90359575Sdim                return True
91359575Sdim
92359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
93359575Sdim    %}
94359575Sdim}
95359575Sdim
96359575Sdim%extend lldb::SBLineEntry {
97359575Sdim    %pythoncode %{
98359575Sdim        def __eq__(self, rhs):
99359575Sdim            if not isinstance(rhs, type(self)):
100359575Sdim                return False
101359575Sdim
102359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
103359575Sdim
104359575Sdim        def __ne__(self, rhs):
105359575Sdim            if not isinstance(rhs, type(self)):
106359575Sdim                return True
107359575Sdim
108359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
109359575Sdim    %}
110359575Sdim}
111359575Sdim
112359575Sdim%extend lldb::SBModule {
113359575Sdim    %pythoncode %{
114359575Sdim        def __eq__(self, rhs):
115359575Sdim            if not isinstance(rhs, type(self)):
116359575Sdim                return False
117359575Sdim
118359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
119359575Sdim
120359575Sdim        def __ne__(self, rhs):
121359575Sdim            if not isinstance(rhs, type(self)):
122359575Sdim                return True
123359575Sdim
124359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
125359575Sdim    %}
126359575Sdim}
127359575Sdim
128359575Sdim%extend lldb::SBSection {
129359575Sdim    %pythoncode %{
130359575Sdim        def __eq__(self, rhs):
131359575Sdim            if not isinstance(rhs, type(self)):
132359575Sdim                return False
133359575Sdim
134359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
135359575Sdim
136359575Sdim        def __ne__(self, rhs):
137359575Sdim            if not isinstance(rhs, type(self)):
138359575Sdim                return True
139359575Sdim
140359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
141359575Sdim    %}
142359575Sdim}
143359575Sdim%extend lldb::SBStream {
144359575Sdim        /* the write() and flush() calls are not part of the SB API proper, and are solely for Python usage
145359575Sdim        they are meant to make an SBStream into a file-like object so that instructions of the sort
146359575Sdim        print >>sb_stream, "something"
147359575Sdim        will work correctly */
148359575Sdim
149359575Sdim        void lldb::SBStream::write (const char* str)
150359575Sdim        {
151359575Sdim            if (str)
152359575Sdim                $self->Printf("%s",str);
153359575Sdim        }
154359575Sdim        void lldb::SBStream::flush ()
155359575Sdim        {}
156359575Sdim}
157359575Sdim%extend lldb::SBSymbol {
158359575Sdim    %pythoncode %{
159359575Sdim        def __eq__(self, rhs):
160359575Sdim            if not isinstance(rhs, type(self)):
161359575Sdim                return False
162359575Sdim
163359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
164359575Sdim
165359575Sdim        def __ne__(self, rhs):
166359575Sdim            if not isinstance(rhs, type(self)):
167359575Sdim                return True
168359575Sdim
169359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
170359575Sdim    %}
171359575Sdim}
172359575Sdim
173359575Sdim%extend lldb::SBTarget {
174359575Sdim    %pythoncode %{
175359575Sdim        def __eq__(self, rhs):
176359575Sdim            if not isinstance(rhs, type(self)):
177359575Sdim                return False
178359575Sdim
179359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
180359575Sdim
181359575Sdim        def __ne__(self, rhs):
182359575Sdim            if not isinstance(rhs, type(self)):
183359575Sdim                return True
184359575Sdim
185359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
186359575Sdim    %}
187359575Sdim}
188359575Sdim
189359575Sdim%extend lldb::SBTypeFilter {
190359575Sdim    %pythoncode %{
191359575Sdim        def __eq__(self, rhs):
192359575Sdim            if not isinstance(rhs, type(self)):
193359575Sdim                return False
194359575Sdim
195359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
196359575Sdim
197359575Sdim        def __ne__(self, rhs):
198359575Sdim            if not isinstance(rhs, type(self)):
199359575Sdim                return True
200359575Sdim
201359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
202359575Sdim    %}
203359575Sdim}
204359575Sdim
205359575Sdim%extend lldb::SBTypeNameSpecifier {
206359575Sdim    %pythoncode %{
207359575Sdim        def __eq__(self, rhs):
208359575Sdim            if not isinstance(rhs, type(self)):
209359575Sdim                return False
210359575Sdim
211359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
212359575Sdim
213359575Sdim        def __ne__(self, rhs):
214359575Sdim            if not isinstance(rhs, type(self)):
215359575Sdim                return True
216359575Sdim
217359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
218359575Sdim    %}
219359575Sdim}
220359575Sdim
221359575Sdim%extend lldb::SBTypeSummary {
222359575Sdim    %pythoncode %{
223359575Sdim        def __eq__(self, rhs):
224359575Sdim            if not isinstance(rhs, type(self)):
225359575Sdim                return False
226359575Sdim
227359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
228359575Sdim
229359575Sdim        def __ne__(self, rhs):
230359575Sdim            if not isinstance(rhs, type(self)):
231359575Sdim                return True
232359575Sdim
233359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
234359575Sdim    %}
235359575Sdim}
236359575Sdim
237359575Sdim%extend lldb::SBTypeSynthetic {
238359575Sdim    %pythoncode %{
239359575Sdim        def __eq__(self, rhs):
240359575Sdim            if not isinstance(rhs, type(self)):
241359575Sdim                return False
242359575Sdim
243359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
244359575Sdim
245359575Sdim        def __ne__(self, rhs):
246359575Sdim            if not isinstance(rhs, type(self)):
247359575Sdim                return True
248359575Sdim
249359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
250359575Sdim    %}
251359575Sdim}
252359575Sdim
253359575Sdim%extend lldb::SBThread {
254359575Sdim    %pythoncode %{
255359575Sdim        def __eq__(self, rhs):
256359575Sdim            if not isinstance(rhs, type(self)):
257359575Sdim                return False
258359575Sdim
259359575Sdim            return getattr(_lldb,self.__class__.__name__+"___eq__")(self, rhs)
260359575Sdim
261359575Sdim        def __ne__(self, rhs):
262359575Sdim            if not isinstance(rhs, type(self)):
263359575Sdim                return True
264359575Sdim
265359575Sdim            return getattr(_lldb,self.__class__.__name__+"___ne__")(self, rhs)
266359575Sdim    %}
267359575Sdim}
268359575Sdim
269359575Sdim%pythoncode %{
270359575Sdim
271359575Sdimdef command(command_name=None, doc=None):
272359575Sdim    import lldb
273359575Sdim    """A decorator function that registers an LLDB command line
274359575Sdim        command that is bound to the function it is attached to."""
275359575Sdim    def callable(function):
276359575Sdim        """Registers an lldb command for the decorated function."""
277359575Sdim        command = "command script add -f %s.%s %s" % (function.__module__, function.__name__, command_name or function.__name__)
278359575Sdim        lldb.debugger.HandleCommand(command)
279359575Sdim        if doc:
280359575Sdim            function.__doc__ = doc
281359575Sdim        return function
282359575Sdim
283359575Sdim    return callable
284359575Sdim
285359575Sdimclass declaration(object):
286359575Sdim    '''A class that represents a source declaration location with file, line and column.'''
287359575Sdim    def __init__(self, file, line, col):
288359575Sdim        self.file = file
289359575Sdim        self.line = line
290359575Sdim        self.col = col
291359575Sdim
292359575Sdimclass value_iter(object):
293359575Sdim    def __iter__(self):
294359575Sdim        return self
295359575Sdim
296359575Sdim    def __next__(self):
297359575Sdim        if self.index >= self.length:
298359575Sdim            raise StopIteration()
299359575Sdim        child_sbvalue = self.sbvalue.GetChildAtIndex(self.index)
300359575Sdim        self.index += 1
301359575Sdim        return value(child_sbvalue)
302359575Sdim
303359575Sdim    def next(self):
304359575Sdim        return self.__next__()
305359575Sdim
306359575Sdim    def __init__(self,value):
307359575Sdim        self.index = 0
308359575Sdim        self.sbvalue = value
309359575Sdim        if type(self.sbvalue) is value:
310359575Sdim            self.sbvalue = self.sbvalue.sbvalue
311359575Sdim        self.length = self.sbvalue.GetNumChildren()
312359575Sdim
313359575Sdimclass value(object):
314359575Sdim    '''A class designed to wrap lldb.SBValue() objects so the resulting object
315359575Sdim    can be used as a variable would be in code. So if you have a Point structure
316359575Sdim    variable in your code in the current frame named "pt", you can initialize an instance
317359575Sdim    of this class with it:
318359575Sdim
319359575Sdim    pt = lldb.value(lldb.frame.FindVariable("pt"))
320359575Sdim    print pt
321359575Sdim    print pt.x
322359575Sdim    print pt.y
323359575Sdim
324359575Sdim    pt = lldb.value(lldb.frame.FindVariable("rectangle_array"))
325359575Sdim    print rectangle_array[12]
326359575Sdim    print rectangle_array[5].origin.x'''
327359575Sdim    def __init__(self, sbvalue):
328359575Sdim        self.sbvalue = sbvalue
329359575Sdim
330359575Sdim    def __nonzero__(self):
331359575Sdim        return self.sbvalue.__nonzero__()
332359575Sdim
333359575Sdim    def __bool__(self):
334359575Sdim        return self.sbvalue.__bool__()
335359575Sdim
336359575Sdim    def __str__(self):
337359575Sdim        return self.sbvalue.__str__()
338359575Sdim
339359575Sdim    def __getitem__(self, key):
340359575Sdim        # Allow array access if this value has children...
341359575Sdim        if type(key) is value:
342359575Sdim            key = int(key)
343359575Sdim        if type(key) is int:
344359575Sdim            child_sbvalue = (self.sbvalue.GetValueForExpressionPath("[%i]" % key))
345359575Sdim            if child_sbvalue and child_sbvalue.IsValid():
346359575Sdim                return value(child_sbvalue)
347359575Sdim            raise IndexError("Index '%d' is out of range" % key)
348359575Sdim        raise TypeError("No array item of type %s" % str(type(key)))
349359575Sdim
350359575Sdim    def __iter__(self):
351359575Sdim        return value_iter(self.sbvalue)
352359575Sdim
353359575Sdim    def __getattr__(self, name):
354359575Sdim        child_sbvalue = self.sbvalue.GetChildMemberWithName (name)
355359575Sdim        if child_sbvalue and child_sbvalue.IsValid():
356359575Sdim            return value(child_sbvalue)
357359575Sdim        raise AttributeError("Attribute '%s' is not defined" % name)
358359575Sdim
359359575Sdim    def __add__(self, other):
360359575Sdim        return int(self) + int(other)
361359575Sdim
362359575Sdim    def __sub__(self, other):
363359575Sdim        return int(self) - int(other)
364359575Sdim
365359575Sdim    def __mul__(self, other):
366359575Sdim        return int(self) * int(other)
367359575Sdim
368359575Sdim    def __floordiv__(self, other):
369359575Sdim        return int(self) // int(other)
370359575Sdim
371359575Sdim    def __mod__(self, other):
372359575Sdim        return int(self) % int(other)
373359575Sdim
374359575Sdim    def __divmod__(self, other):
375359575Sdim        return int(self) % int(other)
376359575Sdim
377359575Sdim    def __pow__(self, other):
378359575Sdim        return int(self) ** int(other)
379359575Sdim
380359575Sdim    def __lshift__(self, other):
381359575Sdim        return int(self) << int(other)
382359575Sdim
383359575Sdim    def __rshift__(self, other):
384359575Sdim        return int(self) >> int(other)
385359575Sdim
386359575Sdim    def __and__(self, other):
387359575Sdim        return int(self) & int(other)
388359575Sdim
389359575Sdim    def __xor__(self, other):
390359575Sdim        return int(self) ^ int(other)
391359575Sdim
392359575Sdim    def __or__(self, other):
393359575Sdim        return int(self) | int(other)
394359575Sdim
395359575Sdim    def __div__(self, other):
396359575Sdim        return int(self) / int(other)
397359575Sdim
398359575Sdim    def __truediv__(self, other):
399359575Sdim        return int(self) / int(other)
400359575Sdim
401359575Sdim    def __iadd__(self, other):
402359575Sdim        result = self.__add__(other)
403359575Sdim        self.sbvalue.SetValueFromCString (str(result))
404359575Sdim        return result
405359575Sdim
406359575Sdim    def __isub__(self, other):
407359575Sdim        result = self.__sub__(other)
408359575Sdim        self.sbvalue.SetValueFromCString (str(result))
409359575Sdim        return result
410359575Sdim
411359575Sdim    def __imul__(self, other):
412359575Sdim        result = self.__mul__(other)
413359575Sdim        self.sbvalue.SetValueFromCString (str(result))
414359575Sdim        return result
415359575Sdim
416359575Sdim    def __idiv__(self, other):
417359575Sdim        result = self.__div__(other)
418359575Sdim        self.sbvalue.SetValueFromCString (str(result))
419359575Sdim        return result
420359575Sdim
421359575Sdim    def __itruediv__(self, other):
422359575Sdim        result = self.__truediv__(other)
423359575Sdim        self.sbvalue.SetValueFromCString (str(result))
424359575Sdim        return result
425359575Sdim
426359575Sdim    def __ifloordiv__(self, other):
427359575Sdim        result =  self.__floordiv__(self, other)
428359575Sdim        self.sbvalue.SetValueFromCString (str(result))
429359575Sdim        return result
430359575Sdim
431359575Sdim    def __imod__(self, other):
432359575Sdim        result =  self.__and__(self, other)
433359575Sdim        self.sbvalue.SetValueFromCString (str(result))
434359575Sdim        return result
435359575Sdim
436359575Sdim    def __ipow__(self, other):
437359575Sdim        result = self.__pow__(self, other)
438359575Sdim        self.sbvalue.SetValueFromCString (str(result))
439359575Sdim        return result
440359575Sdim
441359575Sdim    def __ipow__(self, other, modulo):
442359575Sdim        result = self.__pow__(self, other, modulo)
443359575Sdim        self.sbvalue.SetValueFromCString (str(result))
444359575Sdim        return result
445359575Sdim
446359575Sdim    def __ilshift__(self, other):
447359575Sdim        result = self.__lshift__(other)
448359575Sdim        self.sbvalue.SetValueFromCString (str(result))
449359575Sdim        return result
450359575Sdim
451359575Sdim    def __irshift__(self, other):
452359575Sdim        result =  self.__rshift__(other)
453359575Sdim        self.sbvalue.SetValueFromCString (str(result))
454359575Sdim        return result
455359575Sdim
456359575Sdim    def __iand__(self, other):
457359575Sdim        result =  self.__and__(self, other)
458359575Sdim        self.sbvalue.SetValueFromCString (str(result))
459359575Sdim        return result
460359575Sdim
461359575Sdim    def __ixor__(self, other):
462359575Sdim        result =  self.__xor__(self, other)
463359575Sdim        self.sbvalue.SetValueFromCString (str(result))
464359575Sdim        return result
465359575Sdim
466359575Sdim    def __ior__(self, other):
467359575Sdim        result =  self.__ior__(self, other)
468359575Sdim        self.sbvalue.SetValueFromCString (str(result))
469359575Sdim        return result
470359575Sdim
471359575Sdim    def __neg__(self):
472359575Sdim        return -int(self)
473359575Sdim
474359575Sdim    def __pos__(self):
475359575Sdim        return +int(self)
476359575Sdim
477359575Sdim    def __abs__(self):
478359575Sdim        return abs(int(self))
479359575Sdim
480359575Sdim    def __invert__(self):
481359575Sdim        return ~int(self)
482359575Sdim
483359575Sdim    def __complex__(self):
484359575Sdim        return complex (int(self))
485359575Sdim
486359575Sdim    def __int__(self):
487359575Sdim        is_num,is_sign = is_numeric_type(self.sbvalue.GetType().GetCanonicalType().GetBasicType())
488359575Sdim        if is_num and not is_sign: return self.sbvalue.GetValueAsUnsigned()
489359575Sdim        return self.sbvalue.GetValueAsSigned()
490359575Sdim
491359575Sdim    def __long__(self):
492359575Sdim        return self.__int__()
493359575Sdim
494359575Sdim    def __float__(self):
495359575Sdim        return float (self.sbvalue.GetValueAsSigned())
496359575Sdim
497359575Sdim    def __oct__(self):
498359575Sdim        return '0%o' % self.sbvalue.GetValueAsUnsigned()
499359575Sdim
500359575Sdim    def __hex__(self):
501359575Sdim        return '0x%x' % self.sbvalue.GetValueAsUnsigned()
502359575Sdim
503359575Sdim    def __len__(self):
504359575Sdim        return self.sbvalue.GetNumChildren()
505359575Sdim
506359575Sdim    def __eq__(self, other):
507359575Sdim        if type(other) is int:
508359575Sdim                return int(self) == other
509359575Sdim        elif type(other) is str:
510359575Sdim                return str(self) == other
511359575Sdim        elif type(other) is value:
512359575Sdim                self_err = SBError()
513359575Sdim                other_err = SBError()
514359575Sdim                self_val = self.sbvalue.GetValueAsUnsigned(self_err)
515359575Sdim                if self_err.fail:
516359575Sdim                        raise ValueError("unable to extract value of self")
517359575Sdim                other_val = other.sbvalue.GetValueAsUnsigned(other_err)
518359575Sdim                if other_err.fail:
519359575Sdim                        raise ValueError("unable to extract value of other")
520359575Sdim                return self_val == other_val
521359575Sdim        raise TypeError("Unknown type %s, No equality operation defined." % str(type(other)))
522359575Sdim
523359575Sdim    def __ne__(self, other):
524359575Sdim        return not self.__eq__(other)
525359575Sdim%}
526359575Sdim
527359575Sdim%pythoncode %{
528359575Sdim
529359575Sdimclass SBSyntheticValueProvider(object):
530359575Sdim    def __init__(self,valobj):
531359575Sdim        pass
532359575Sdim
533359575Sdim    def num_children(self):
534359575Sdim        return 0
535359575Sdim
536359575Sdim    def get_child_index(self,name):
537359575Sdim        return None
538359575Sdim
539359575Sdim    def get_child_at_index(self,idx):
540359575Sdim        return None
541359575Sdim
542359575Sdim    def update(self):
543359575Sdim        pass
544359575Sdim
545359575Sdim    def has_children(self):
546359575Sdim        return False
547359575Sdim
548359575Sdim
549359575Sdim%}
550359575Sdim
551359575Sdim%pythoncode %{
552359575Sdim
553359575Sdim# given an lldb.SBBasicType it returns a tuple
554359575Sdim# (is_numeric, is_signed)
555359575Sdim# the value of is_signed is undefined if is_numeric == false
556359575Sdimdef is_numeric_type(basic_type):
557359575Sdim    if basic_type == eBasicTypeInvalid: return (False,False)
558359575Sdim    if basic_type == eBasicTypeVoid: return (False,False)
559359575Sdim    if basic_type == eBasicTypeChar: return (True,False)
560359575Sdim    if basic_type == eBasicTypeSignedChar: return (True,True)
561359575Sdim    if basic_type == eBasicTypeUnsignedChar: return (True,False)
562359575Sdim    if basic_type == eBasicTypeWChar: return (True,False)
563359575Sdim    if basic_type == eBasicTypeSignedWChar: return (True,True)
564359575Sdim    if basic_type == eBasicTypeUnsignedWChar: return (True,False)
565359575Sdim    if basic_type == eBasicTypeChar16: return (True,False)
566359575Sdim    if basic_type == eBasicTypeChar32: return (True,False)
567359575Sdim    if basic_type == eBasicTypeShort: return (True,True)
568359575Sdim    if basic_type == eBasicTypeUnsignedShort: return (True,False)
569359575Sdim    if basic_type == eBasicTypeInt: return (True,True)
570359575Sdim    if basic_type == eBasicTypeUnsignedInt: return (True,False)
571359575Sdim    if basic_type == eBasicTypeLong: return (True,True)
572359575Sdim    if basic_type == eBasicTypeUnsignedLong: return (True,False)
573359575Sdim    if basic_type == eBasicTypeLongLong: return (True,True)
574359575Sdim    if basic_type == eBasicTypeUnsignedLongLong: return (True,False)
575359575Sdim    if basic_type == eBasicTypeInt128: return (True,True)
576359575Sdim    if basic_type == eBasicTypeUnsignedInt128: return (True,False)
577359575Sdim    if basic_type == eBasicTypeBool: return (False,False)
578359575Sdim    if basic_type == eBasicTypeHalf: return (True,True)
579359575Sdim    if basic_type == eBasicTypeFloat: return (True,True)
580359575Sdim    if basic_type == eBasicTypeDouble: return (True,True)
581359575Sdim    if basic_type == eBasicTypeLongDouble: return (True,True)
582359575Sdim    if basic_type == eBasicTypeFloatComplex: return (True,True)
583359575Sdim    if basic_type == eBasicTypeDoubleComplex: return (True,True)
584359575Sdim    if basic_type == eBasicTypeLongDoubleComplex: return (True,True)
585359575Sdim    if basic_type == eBasicTypeObjCID: return (False,False)
586359575Sdim    if basic_type == eBasicTypeObjCClass: return (False,False)
587359575Sdim    if basic_type == eBasicTypeObjCSel: return (False,False)
588359575Sdim    if basic_type == eBasicTypeNullPtr: return (False,False)
589359575Sdim    #if basic_type == eBasicTypeOther:
590359575Sdim    return (False,False)
591359575Sdim
592359575Sdim%}
593