using namespace llvm;
-static cl::opt<bool> GenerateTypeUnits("generate-type-units", cl::Hidden,
- cl::desc("Generate DWARF4 type units."),
- cl::init(false));
+static cl::opt<bool>
+GenerateDwarfTypeUnits("generate-type-units", cl::Hidden,
+ cl::desc("Generate DWARF4 type units."),
+ cl::init(false));
/// Unit - Unit constructor.
DwarfUnit::DwarfUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A,
DIEIntegerOne = new (DIEValueAllocator) DIEInteger(1);
}
-CompileUnit::CompileUnit(unsigned UID, DIE *D, DICompileUnit Node,
- AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
+DwarfCompileUnit::DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node,
+ AsmPrinter *A, DwarfDebug *DW,
+ DwarfFile *DWU)
: DwarfUnit(UID, D, Node, A, DW, DWU) {
insertDIE(Node, D);
}
-TypeUnit::TypeUnit(unsigned UID, DIE *D, uint16_t Language, AsmPrinter *A,
- DwarfDebug *DW, DwarfFile *DWU)
+DwarfTypeUnit::DwarfTypeUnit(unsigned UID, DIE *D, uint16_t Language,
+ AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
: DwarfUnit(UID, D, DICompileUnit(), A, DW, DWU), Language(Language) {}
/// ~Unit - Destructor for compile unit.
// together.
return (D.isType() ||
(D.isSubprogram() && !DISubprogram(D).isDefinition())) &&
- !GenerateTypeUnits;
+ !GenerateDwarfTypeUnits;
}
/// getDIE - Returns the debug information entry map slot for the
/// addLabelAddress - Add a dwarf label attribute data and value using
/// DW_FORM_addr or DW_FORM_GNU_addr_index.
///
-void CompileUnit::addLabelAddress(DIE *Die, dwarf::Attribute Attribute,
- MCSymbol *Label) {
+void DwarfCompileUnit::addLabelAddress(DIE *Die, dwarf::Attribute Attribute,
+ MCSymbol *Label) {
if (Label)
DD->addArangeLabel(SymbolCU(this, Label));
/// Return true if the type is appropriately scoped to be contained inside
/// its own type unit.
-static bool isTypeUnitScoped(DIType Ty, const DwarfDebug *DD) {
+static bool isDwarfTypeUnitScoped(DIType Ty, const DwarfDebug *DD) {
DIScope Parent = DD->resolve(Ty.getContext());
while (Parent) {
// Don't generate a hash for anything scoped inside a function.
}
/// Return true if the type should be split out into a type unit.
-static bool shouldCreateTypeUnit(DICompositeType CTy, const DwarfDebug *DD) {
- if (!GenerateTypeUnits)
+static bool shouldCreateDwarfTypeUnit(DICompositeType CTy,
+ const DwarfDebug *DD) {
+ if (!GenerateDwarfTypeUnits)
return false;
uint16_t Tag = CTy.getTag();
// If this is a class, structure, union, or enumeration type
// that is a definition (not a declaration), and not scoped
// inside a function then separate this out as a type unit.
- return !CTy.isForwardDecl() && isTypeUnitScoped(CTy, DD);
+ return !CTy.isForwardDecl() && isDwarfTypeUnitScoped(CTy, DD);
default:
return false;
}
constructTypeDIE(*TyDIE, DIBasicType(Ty));
else if (Ty.isCompositeType()) {
DICompositeType CTy(Ty);
- if (shouldCreateTypeUnit(CTy, DD)) {
- DD->addTypeUnitType(getLanguage(), TyDIE, CTy);
+ if (shouldCreateDwarfTypeUnit(CTy, DD)) {
+ DD->addDwarfTypeUnitType(getLanguage(), TyDIE, CTy);
// Skip updating the accellerator tables since this is not the full type
return TyDIE;
}
}
/// createGlobalVariableDIE - create global variable DIE.
-void CompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
+void DwarfCompileUnit::createGlobalVariableDIE(DIGlobalVariable GV) {
// Check for pre-existence.
if (getDIE(GV))
return;