[Debug Info] remove DITrivialType and use null to represent unspecified param.

Per feedback on r214111, we are going to use null to represent unspecified
parameter. If the type array is {null}, it means a function that returns void;
If the type array is {null, null}, it means a variadic function that returns
void. In summary if we have more than one element in the type array and the last
element is null, it is a variadic function.

rdar://17628609


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manman Ren
2014-07-29 18:20:39 +00:00
parent 52f23be080
commit 23ab342d96
7 changed files with 22 additions and 71 deletions
+3 -21
View File
@@ -39,7 +39,6 @@ bool DIDescriptor::Verify() const {
return DbgNode &&
(DIDerivedType(DbgNode).Verify() ||
DICompositeType(DbgNode).Verify() || DIBasicType(DbgNode).Verify() ||
DITrivialType(DbgNode).Verify() ||
DIVariable(DbgNode).Verify() || DISubprogram(DbgNode).Verify() ||
DIGlobalVariable(DbgNode).Verify() || DIFile(DbgNode).Verify() ||
DICompileUnit(DbgNode).Verify() || DINameSpace(DbgNode).Verify() ||
@@ -155,10 +154,6 @@ MDNode *DIVariable::getInlinedAt() const { return getNodeField(DbgNode, 7); }
// Predicates
//===----------------------------------------------------------------------===//
bool DIDescriptor::isTrivialType() const {
return DbgNode && getTag() == dwarf::DW_TAG_unspecified_parameters;
}
bool DIDescriptor::isSubroutineType() const {
return isCompositeType() && getTag() == dwarf::DW_TAG_subroutine_type;
}
@@ -233,8 +228,7 @@ bool DIDescriptor::isVariable() const {
/// isType - Return true if the specified tag is legal for DIType.
bool DIDescriptor::isType() const {
return isBasicType() || isCompositeType() || isDerivedType() ||
isTrivialType();
return isBasicType() || isCompositeType() || isDerivedType();
}
/// isSubprogram - Return true if the specified tag is legal for
@@ -250,12 +244,6 @@ bool DIDescriptor::isGlobalVariable() const {
getTag() == dwarf::DW_TAG_constant);
}
/// isUnspecifiedParmeter - Return true if the specified tag is
/// DW_TAG_unspecified_parameters.
bool DIDescriptor::isUnspecifiedParameter() const {
return DbgNode && getTag() == dwarf::DW_TAG_unspecified_parameters;
}
/// isScope - Return true if the specified tag is one of the scope
/// related tag.
bool DIDescriptor::isScope() const {
@@ -459,7 +447,7 @@ bool DIType::Verify() const {
// FIXME: Sink this into the various subclass verifies.
uint16_t Tag = getTag();
if (!isBasicType() && !isTrivialType() && Tag != dwarf::DW_TAG_const_type &&
if (!isBasicType() && Tag != dwarf::DW_TAG_const_type &&
Tag != dwarf::DW_TAG_volatile_type && Tag != dwarf::DW_TAG_pointer_type &&
Tag != dwarf::DW_TAG_ptr_to_member_type &&
Tag != dwarf::DW_TAG_reference_type &&
@@ -474,8 +462,6 @@ bool DIType::Verify() const {
// a CompositeType.
if (isBasicType())
return DIBasicType(DbgNode).Verify();
else if (isTrivialType())
return DITrivialType(DbgNode).Verify();
else if (isCompositeType())
return DICompositeType(DbgNode).Verify();
else if (isDerivedType())
@@ -489,10 +475,6 @@ bool DIBasicType::Verify() const {
return isBasicType() && DbgNode->getNumOperands() == 10;
}
bool DITrivialType::Verify() const {
return isTrivialType() && DbgNode->getNumOperands() == 1;
}
/// Verify - Verify that a derived type descriptor is well formed.
bool DIDerivedType::Verify() const {
// Make sure DerivedFrom @ field 9 is TypeRef.
@@ -1297,7 +1279,7 @@ void DIEnumerator::printInternal(raw_ostream &OS) const {
}
void DIType::printInternal(raw_ostream &OS) const {
if (!DbgNode || isTrivialType())
if (!DbgNode)
return;
StringRef Res = getName();