/// addSourceLine - Add location information to specified debug information
/// entry.
-void DwarfUnit::addSourceLine(DIE &Die, DIType Ty) {
+void DwarfUnit::addSourceLine(DIE &Die, const MDType *Ty) {
assert(Ty);
addSourceLine(Die, Ty->getLine(), Ty->getFilename(), Ty->getDirectory());
void DwarfUnit::addBlockByrefAddress(const DbgVariable &DV, DIE &Die,
dwarf::Attribute Attribute,
const MachineLocation &Location) {
- DIType Ty = DV.getType();
- DIType TmpTy = Ty;
+ const MDType *Ty = DV.getType();
+ const MDType *TmpTy = Ty;
uint16_t Tag = Ty->getTag();
bool isPointer = false;
}
/// Return true if type encoding is unsigned.
-static bool isUnsignedDIType(DwarfDebug *DD, DIType Ty) {
+static bool isUnsignedDIType(DwarfDebug *DD, const MDType *Ty) {
if (DIDerivedType DTy = dyn_cast<MDDerivedTypeBase>(Ty)) {
dwarf::Tag T = (dwarf::Tag)Ty->getTag();
// Encode pointer constants as unsigned bytes. This is used at least for
}
/// addConstantValue - Add constant value entry in variable DIE.
-void DwarfUnit::addConstantValue(DIE &Die, const ConstantInt *CI, DIType Ty) {
+void DwarfUnit::addConstantValue(DIE &Die, const ConstantInt *CI,
+ const MDType *Ty) {
addConstantValue(Die, CI->getValue(), Ty);
}
/// addConstantValue - Add constant value entry in variable DIE.
void DwarfUnit::addConstantValue(DIE &Die, const MachineOperand &MO,
- DIType Ty) {
+ const MDType *Ty) {
assert(MO.isImm() && "Invalid machine operand!");
addConstantValue(Die, isUnsignedDIType(DD, Ty), MO.getImm());
Unsigned ? dwarf::DW_FORM_udata : dwarf::DW_FORM_sdata, Val);
}
-void DwarfUnit::addConstantValue(DIE &Die, const APInt &Val, DIType Ty) {
+void DwarfUnit::addConstantValue(DIE &Die, const APInt &Val, const MDType *Ty) {
addConstantValue(Die, Val, isUnsignedDIType(DD, Ty));
}
}
/// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
-/// given DIType.
+/// given type.
DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
if (!TyNode)
return nullptr;
}
/// addType - Add a new type attribute to the specified entity.
-void DwarfUnit::addType(DIE &Entity, DIType Ty, dwarf::Attribute Attribute) {
+void DwarfUnit::addType(DIE &Entity, const MDType *Ty,
+ dwarf::Attribute Attribute) {
assert(Ty && "Trying to add a type that doesn't exist?");
// Check for pre-existence.
uint16_t Tag = Buffer.getTag();
// Map to main type, void will not have a type.
- DIType FromTy = resolve(DTy->getBaseType());
+ const MDType *FromTy = resolve(DTy->getBaseType());
if (FromTy)
addType(Buffer, FromTy);
/// constructSubprogramArguments - Construct function argument DIEs.
void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeArray Args) {
for (unsigned i = 1, N = Args.size(); i < N; ++i) {
- DIType Ty = resolve(Args[i]);
+ const MDType *Ty = resolve(Args[i]);
if (!Ty) {
assert(i == N-1 && "Unspecified parameter must be the last argument");
createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer);
Value);
}
}
- DIType DTy = resolve(CTy->getBaseType());
+ const MDType *DTy = resolve(CTy->getBaseType());
if (DTy) {
addType(Buffer, DTy);
addFlag(Buffer, dwarf::DW_AT_enum_class);
DIE &StaticMemberDIE = createAndAddDIE(DT->getTag(), *ContextDIE, DT);
- DIType Ty = resolve(DT->getBaseType());
+ const MDType *Ty = resolve(DT->getBaseType());
addString(StaticMemberDIE, dwarf::DW_AT_name, DT->getName());
addType(StaticMemberDIE, Ty);