Commit e22d0e82 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by hjk

Dumper: Add a dumper for CPlusPlus::PointerType

Change-Id: Ibc868a54326647184a30a796a487e218db7e968f
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 9b502276
......@@ -30,6 +30,21 @@
from dumper import *
def stripTypeName(value):
type = value.type
try:
type = type.target()
except:
pass
return str(type.unqualified())
def extractPointerType(d, value):
postfix = ""
while stripTypeName(value) == "CPlusPlus::PointerType":
postfix += "*"
value = d.downcast(value["_elementType"]["_type"])
return readLiteral(d, value["_name"]) + postfix
def readTemplateName(d, value):
name = readLiteral(d, value["_identifier"]) + "<"
args = value["_templateArguments"]
......@@ -39,12 +54,7 @@ def readTemplateName(d, value):
for i in range(size):
if i > 0:
name += ", "
typeVal = d.downcast(start[i]["_type"])
postfix = ""
while str(typeVal.type.target().unqualified()) == "CPlusPlus::PointerType":
postfix += "*"
typeVal = d.downcast(typeVal["_elementType"]["_type"])
name += readLiteral(d, typeVal["_name"]) + postfix
name += extractPointerType(d, d.downcast(start[i]["_type"]))
name += ">"
return name
......@@ -126,6 +136,10 @@ def qdump__CPlusPlus__NamedType(d, value):
d.putBetterType(value.type)
d.putPlainChildren(value)
def qdump__CPlusPlus__PointerType(d, value):
d.putValue(d.hexencode(extractPointerType(d, value)), Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__TemplateNameId(d, value):
dumpLiteral(d, value)
d.putBetterType(value.type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment