Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
Show First 20 Lines • Show All 1,466 Lines • ▼ Show 20 Lines | void DwarfUnit::constructArrayTypeDIE(DIE &Buffer, const DICompositeType *CTy) { | ||||
} else if (DIExpression *Expr = CTy->getAllocatedExp()) { | } else if (DIExpression *Expr = CTy->getAllocatedExp()) { | ||||
DIELoc *Loc = new (DIEValueAllocator) DIELoc; | DIELoc *Loc = new (DIEValueAllocator) DIELoc; | ||||
DIEDwarfExpression DwarfExpr(*Asm, getCU(), *Loc); | DIEDwarfExpression DwarfExpr(*Asm, getCU(), *Loc); | ||||
DwarfExpr.setMemoryLocationKind(); | DwarfExpr.setMemoryLocationKind(); | ||||
DwarfExpr.addExpression(Expr); | DwarfExpr.addExpression(Expr); | ||||
addBlock(Buffer, dwarf::DW_AT_allocated, DwarfExpr.finalize()); | addBlock(Buffer, dwarf::DW_AT_allocated, DwarfExpr.finalize()); | ||||
} | } | ||||
if (auto *RankConst = CTy->getRankConst()) { | |||||
addSInt(Buffer, dwarf::DW_AT_rank, dwarf::DW_FORM_sdata, | |||||
RankConst->getSExtValue()); | |||||
} else if (auto *RankExpr = CTy->getRankExp()) { | |||||
DIELoc *Loc = new (DIEValueAllocator) DIELoc; | |||||
DIEDwarfExpression DwarfExpr(*Asm, getCU(), *Loc); | |||||
DwarfExpr.setMemoryLocationKind(); | |||||
DwarfExpr.addExpression(RankExpr); | |||||
addBlock(Buffer, dwarf::DW_AT_rank, DwarfExpr.finalize()); | |||||
} | |||||
// Emit the element type. | // Emit the element type. | ||||
addType(Buffer, CTy->getBaseType()); | addType(Buffer, CTy->getBaseType()); | ||||
// Get an anonymous type for index type. | // Get an anonymous type for index type. | ||||
// FIXME: This type should be passed down from the front end | // FIXME: This type should be passed down from the front end | ||||
// as different languages may have different sizes for indexes. | // as different languages may have different sizes for indexes. | ||||
DIE *IdxTy = getIndexTyDie(); | DIE *IdxTy = getIndexTyDie(); | ||||
▲ Show 20 Lines • Show All 324 Lines • Show Last 20 Lines |