1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[Debug-Info] change Tag type to dwarf::Tag for createAndAddDIE; NFC

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D102207
This commit is contained in:
Chen Zheng 2021-05-10 21:31:27 -04:00
parent 6e23cf88e5
commit 4eed210a79
4 changed files with 16 additions and 10 deletions

View File

@ -153,7 +153,7 @@ protected:
void setTag(unsigned Tag) { SubclassData16 = Tag; }
public:
unsigned getTag() const { return SubclassData16; }
dwarf::Tag getTag() const { return (dwarf::Tag)SubclassData16; }
/// Debug info flags.
///
@ -262,7 +262,7 @@ public:
/// Return a (temporary) clone of this.
TempGenericDINode clone() const { return cloneImpl(); }
unsigned getTag() const { return SubclassData16; }
dwarf::Tag getTag() const { return (dwarf::Tag)SubclassData16; }
StringRef getHeader() const { return getStringOperand(0); }
MDString *getRawHeader() const { return getOperandAs<MDString>(0); }

View File

@ -273,9 +273,9 @@ static StringRef getPrettyScopeName(const DIScope *Scope) {
return "<unnamed-tag>";
case dwarf::DW_TAG_namespace:
return "`anonymous namespace'";
default:
return StringRef();
}
return StringRef();
}
const DISubprogram *CodeViewDebug::collectParentScopeNames(
@ -1487,6 +1487,9 @@ static bool shouldEmitUdt(const DIType *T) {
case dwarf::DW_TAG_class_type:
case dwarf::DW_TAG_union_type:
return false;
default:
// do nothing.
;
}
}
}
@ -2032,10 +2035,13 @@ static MethodKind translateMethodKindFlags(const DISubprogram *SP,
static TypeRecordKind getRecordKind(const DICompositeType *Ty) {
switch (Ty->getTag()) {
case dwarf::DW_TAG_class_type: return TypeRecordKind::Class;
case dwarf::DW_TAG_structure_type: return TypeRecordKind::Struct;
case dwarf::DW_TAG_class_type:
return TypeRecordKind::Class;
case dwarf::DW_TAG_structure_type:
return TypeRecordKind::Struct;
default:
llvm_unreachable("unexpected tag");
}
llvm_unreachable("unexpected tag");
}
/// Return ClassOptions that should be present on both the forward declaration

View File

@ -385,8 +385,8 @@ void DwarfUnit::addDIEEntry(DIE &Die, dwarf::Attribute Attribute,
Entry);
}
DIE &DwarfUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N) {
DIE &Die = Parent.addChild(DIE::get(DIEValueAllocator, (dwarf::Tag)Tag));
DIE &DwarfUnit::createAndAddDIE(dwarf::Tag Tag, DIE &Parent, const DINode *N) {
DIE &Die = Parent.addChild(DIE::get(DIEValueAllocator, Tag));
if (N)
insertDIE(N, &Die);
return Die;

View File

@ -257,7 +257,7 @@ public:
/// Create a DIE with the given Tag, add the DIE to its parent, and
/// call insertDIE if MD is not null.
DIE &createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N = nullptr);
DIE &createAndAddDIE(dwarf::Tag Tag, DIE &Parent, const DINode *N = nullptr);
bool useSegmentedStringOffsetsTable() const {
return DD->useSegmentedStringOffsetsTable();