Lines Matching refs:Die
36 CompileUnit::CompileUnit(unsigned UID, unsigned L, DIE *D, const MDNode *N,
52 DIEEntry *CompileUnit::createDIEEntry(DIE *Entry) {
102 void CompileUnit::addFlag(DIE *Die, unsigned Attribute) {
104 Die->addValue(Attribute, dwarf::DW_FORM_flag_present,
107 addUInt(Die, Attribute, dwarf::DW_FORM_flag, 1);
112 void CompileUnit::addUInt(DIE *Die, unsigned Attribute,
117 Die->addValue(Attribute, Form, Value);
122 void CompileUnit::addSInt(DIE *Die, unsigned Attribute,
126 Die->addValue(Attribute, Form, Value);
134 void CompileUnit::addString(DIE *Die, unsigned Attribute, StringRef String) {
152 Die->addValue(Attribute, Form, Str);
157 void CompileUnit::addLocalString(DIE *Die, unsigned Attribute,
167 Die->addValue(Attribute, dwarf::DW_FORM_strp, Value);
172 void CompileUnit::addExpr(DIE *Die, unsigned Attribute, unsigned Form,
175 Die->addValue(Attribute, Form, Value);
180 void CompileUnit::addLabel(DIE *Die, unsigned Attribute, unsigned Form,
183 Die->addValue(Attribute, Form, Value);
189 void CompileUnit::addLabelAddress(DIE *Die, unsigned Attribute,
194 Die->addValue(Attribute, dwarf::DW_FORM_addr, Value);
197 Die->addValue(Attribute, dwarf::DW_FORM_addr, Value);
202 Die->addValue(Attribute, dwarf::DW_FORM_GNU_addr_index, Value);
209 void CompileUnit::addOpAddress(DIE *Die, const MCSymbol *Sym) {
211 addUInt(Die, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_addr);
212 addLabel(Die, 0, dwarf::DW_FORM_udata, Sym);
214 addUInt(Die, 0, dwarf::DW_FORM_data1, dwarf::DW_OP_GNU_addr_index);
215 addUInt(Die, 0, dwarf::DW_FORM_GNU_addr_index, DU->getAddrPoolIndex(Sym));
221 void CompileUnit::addDelta(DIE *Die, unsigned Attribute, unsigned Form,
224 Die->addValue(Attribute, Form, Value);
227 /// addDIEEntry - Add a DIE attribute data and value.
229 void CompileUnit::addDIEEntry(DIE *Die, unsigned Attribute, unsigned Form,
230 DIE *Entry) {
231 Die->addValue(Attribute, Form, createDIEEntry(Entry));
236 void CompileUnit::addBlock(DIE *Die, unsigned Attribute, unsigned Form,
240 Die->addValue(Attribute, Block->BestForm(), Block);
245 void CompileUnit::addSourceLine(DIE *Die, DIVariable V) {
257 addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
258 addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
263 void CompileUnit::addSourceLine(DIE *Die, DIGlobalVariable G) {
274 addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
275 addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
280 void CompileUnit::addSourceLine(DIE *Die, DISubprogram SP) {
293 addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
294 addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
299 void CompileUnit::addSourceLine(DIE *Die, DIType Ty) {
310 addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
311 addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
316 void CompileUnit::addSourceLine(DIE *Die, DIObjCProperty Ty) {
328 addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
329 addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
334 void CompileUnit::addSourceLine(DIE *Die, DINameSpace NS) {
347 addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
348 addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
353 void CompileUnit::addVariableAddress(const DbgVariable &DV, DIE *Die,
356 addComplexAddress(DV, Die, dwarf::DW_AT_location, Location);
358 addBlockByrefAddress(DV, Die, dwarf::DW_AT_location, Location);
360 addAddress(Die, dwarf::DW_AT_location, Location,
365 void CompileUnit::addRegisterOp(DIE *TheDie, unsigned Reg) {
377 void CompileUnit::addRegisterOffset(DIE *TheDie, unsigned Reg,
394 /// addAddress - Add an address attribute to a die based on the location
396 void CompileUnit::addAddress(DIE *Die, unsigned Attribute,
409 // Now attach the location information to the DIE.
410 addBlock(Die, Attribute, 0, Block);
416 /// the starting location. Add the DWARF information to the die.
418 void CompileUnit::addComplexAddress(const DbgVariable &DV, DIE *Die,
447 // Now attach the location information to the DIE.
448 addBlock(Die, Attribute, 0, Block);
508 /// starting location. Add the DWARF information to the die. For
511 void CompileUnit::addBlockByrefAddress(const DbgVariable &DV, DIE *Die,
585 // Now attach the location information to the DIE.
586 addBlock(Die, Attribute, 0, Block);
602 /// addConstantValue - Add constant value entry in variable DIE.
603 void CompileUnit::addConstantValue(DIE *Die, const MachineOperand &MO,
623 addBlock(Die, dwarf::DW_AT_const_value, 0, Block);
626 /// addConstantFPValue - Add constant value entry in variable DIE.
627 void CompileUnit::addConstantFPValue(DIE *Die, const MachineOperand &MO) {
647 addBlock(Die, dwarf::DW_AT_const_value, 0, Block);
650 /// addConstantFPValue - Add constant value entry in variable DIE.
651 void CompileUnit::addConstantFPValue(DIE *Die, const ConstantFP *CFP) {
652 addConstantValue(Die, CFP->getValueAPF().bitcastToAPInt(), false);
655 /// addConstantValue - Add constant value entry in variable DIE.
656 void CompileUnit::addConstantValue(DIE *Die, const ConstantInt *CI,
658 addConstantValue(Die, CI->getValue(), Unsigned);
661 // addConstantValue - Add constant value entry in variable DIE.
662 void CompileUnit::addConstantValue(DIE *Die, const APInt &Val, bool Unsigned) {
675 addUInt(Die, dwarf::DW_AT_const_value, form, Val.getZExtValue());
677 addSInt(Die, dwarf::DW_AT_const_value, form, Val.getSExtValue());
699 addBlock(Die, dwarf::DW_AT_const_value, 0, Block);
703 void CompileUnit::addTemplateParams(DIE &Buffer, DIArray TParams) {
716 /// getOrCreateContextDIE - Get context owner's DIE.
717 DIE *CompileUnit::getOrCreateContextDIE(DIDescriptor Context) {
728 /// addToContextOwner - Add Die into the list of its context owner's children.
729 void CompileUnit::addToContextOwner(DIE *Die, DIDescriptor Context) {
730 if (DIE *ContextDIE = getOrCreateContextDIE(Context))
731 ContextDIE->addChild(Die);
733 addDie(Die);
736 /// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
738 DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
742 DIE *TyDIE = getDIE(Ty);
747 TyDIE = new DIE(dwarf::DW_TAG_base_type);
778 void CompileUnit::addType(DIE *Entity, DIType Ty, unsigned Attribute) {
791 DIE *Buffer = getOrCreateTypeDIE(Ty);
830 /// constructTypeDIE - Construct basic type die from DIBasicType.
831 void CompileUnit::constructTypeDIE(DIE &Buffer, DIBasicType BTy) {
852 /// constructTypeDIE - Construct derived type die from DIDerivedType.
853 void CompileUnit::constructTypeDIE(DIE &Buffer, DIDerivedType DTy) {
917 /// constructTypeDIE - Construct type DIE from DICompositeType.
918 void CompileUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
935 DIE *ElemDie = NULL;
960 DIE *Arg = new DIE(dwarf::DW_TAG_unspecified_parameters);
964 DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter);
990 DIE *ElemDie = NULL;
1008 ElemDie = new DIE(dwarf::DW_TAG_friend);
1016 ElemDie = new DIE(Property.getTag());
1116 /// getOrCreateTemplateTypeParameterDIE - Find existing DIE or create new DIE
1118 DIE *
1120 DIE *ParamDIE = getDIE(TP);
1124 ParamDIE = new DIE(dwarf::DW_TAG_template_type_parameter);
1131 /// getOrCreateTemplateValueParameterDIE - Find existing DIE or create new DIE
1133 DIE *
1135 DIE *ParamDIE = getDIE(TPV);
1139 ParamDIE = new DIE(TPV.getTag());
1169 /// getOrCreateNameSpace - Create a DIE for DINameSpace.
1170 DIE *CompileUnit::getOrCreateNameSpace(DINameSpace NS) {
1171 DIE *NDie = getDIE(NS);
1174 NDie = new DIE(dwarf::DW_TAG_namespace);
1186 /// getOrCreateSubprogramDIE - Create new DIE using SP.
1187 DIE *CompileUnit::getOrCreateSubprogramDIE(DISubprogram SP) {
1188 DIE *SPDie = getDIE(SP);
1192 SPDie = new DIE(dwarf::DW_TAG_subprogram);
1194 // DW_TAG_inlined_subroutine may refer to this DIE.
1198 DIE *DeclDie = NULL;
1220 // If this DIE is going to refer declaration info using AT_specification
1274 DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter);
1326 /// createGlobalVariableDIE - create global variable DIE.
1340 // to the declaration DIE.
1341 DIE *VariableDIE = NULL;
1346 // We need the declaration DIE that is in the static member's class.
1348 // Creating the class will create the static member decl DIE.
1356 // DIE and add the initial set of attributes to it.
1358 VariableDIE = new DIE(GV.getTag());
1380 DIE *VariableSpecDIE = NULL;
1408 // Do not create specification DIE if context is either compile unit
1412 // Create specification DIE.
1413 VariableSpecDIE = new DIE(dwarf::DW_TAG_variable);
1434 // the TAG_variable DIE and on the TAG_member DIE.
1461 DIE *AddrDIE = VariableSpecDIE ? VariableSpecDIE : VariableDIE;
1471 /// constructSubrangeDIE - Construct subrange DIE from DISubrange.
1472 void CompileUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR,
1473 DIE *IndexTy) {
1474 DIE *DW_Subrange = new DIE(dwarf::DW_TAG_subrange_type);
1498 /// constructArrayTypeDIE - Construct array type DIE from DICompositeType.
1499 void CompileUnit::constructArrayTypeDIE(DIE &Buffer,
1512 DIE *IdxTy = getIndexTyDie();
1515 IdxTy = new DIE(dwarf::DW_TAG_base_type);
1532 /// constructEnumTypeDIE - Construct enum type DIE from DIEnumerator.
1533 DIE *CompileUnit::constructEnumTypeDIE(DIEnumerator ETy) {
1534 DIE *Enumerator = new DIE(dwarf::DW_TAG_enumerator);
1545 for (DenseMap<DIE *, const MDNode *>::iterator CI = ContainingTypeMap.begin(),
1547 DIE *SPDie = CI->first;
1550 DIE *NDie = getDIE(N);
1556 /// constructVariableDIE - Construct a DIE for the given DbgVariable.
1557 DIE *CompileUnit::constructVariableDIE(DbgVariable *DV,
1565 DIE *VariableDie = new DIE(Tag);
1567 DIE *AbsDIE = AbsVar ? AbsVar->getDIE() : NULL;
1633 /// createMemberDIE - Create new member DIE.
1634 DIE *CompileUnit::createMemberDIE(DIDerivedType DT) {
1635 DIE *MemberDie = new DIE(DT.getTag());
1721 /// createStaticMemberDIE - Create new DIE for C++ static member.
1722 DIE *CompileUnit::createStaticMemberDIE(const DIDerivedType DT) {
1726 DIE *StaticMemberDIE = new DIE(DT.getTag());