[Debug Info] add DISubroutineType and its creation takes DITypeArray.

DITypeArray is an array of DITypeRef, at its creation, we will create
DITypeRef (i.e use the identifier if the type node has an identifier).

This is the last patch to unique the type array of a subroutine type.

rdar://17628609


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manman Ren
2014-07-28 22:24:06 +00:00
parent 0b783fc554
commit 807538b567
12 changed files with 283 additions and 23 deletions

View File

@@ -159,6 +159,10 @@ bool DIDescriptor::isTrivialType() const {
return DbgNode && getTag() == dwarf::DW_TAG_unspecified_parameters;
}
bool DIDescriptor::isSubroutineType() const {
return isCompositeType() && getTag() == dwarf::DW_TAG_subroutine_type;
}
/// isBasicType - Return true if the specified tag is legal for
/// DIBasicType.
bool DIDescriptor::isBasicType() const {
@@ -1055,6 +1059,12 @@ void DebugInfoFinder::processType(DIType DT) {
if (DT.isCompositeType()) {
DICompositeType DCT(DT);
processType(DCT.getTypeDerivedFrom().resolve(TypeIdentifierMap));
if (DT.isSubroutineType()) {
DITypeArray DTA = DISubroutineType(DT).getTypeArray();
for (unsigned i = 0, e = DTA.getNumElements(); i != e; ++i)
processType(DTA.getElement(i).resolve(TypeIdentifierMap));
return;
}
DIArray DA = DCT.getElements();
for (unsigned i = 0, e = DA.getNumElements(); i != e; ++i) {
DIDescriptor D = DA.getElement(i);