[Prev][Next][Index]
Re: Problems with SgType::baseType()
- Date: Mon, 10 Oct 94 15:51:27 -0600
- From: Beata Winnicka <bfatyga@slab.cica.indiana.edu>
- To: Diego Novillo <diego@cs.ualberta.ca>
- Subject: Re: Problems with SgType::baseType()
- Cc: Sage bug reports <sage-bugs@cica.indiana.edu>
>Well, I hope the explanation is sufficiently clear. Am I doing
anything
>wrong?
Not really wrong, but...
You are missing one important "bit" of information. An SgPointerType
object has so-called indirection level. (Should be accessible via
SgPointerType::indirection() method) Indirection levels of -1 and 1
in a type chain "cancel" each other. In your example you have (you
may want to look at the output of dumpdep to verify that):
T_POINTER(ind_level 1) -> T_POINTER(ind_level -1) ->
T_POINTER(ind_level 1), so the net result should be one "*".
You would need to rewrite EntTypeName function to account for the
indirection level. Or you might, instead, try using the getTrueType
method; it figures out this "cancellation" of indirection levels for
you (see documentation in libSage++.C).
--Beata
PS: Did the fix for following typedefs in getTrueType work for you?