Lines Matching refs:DIE
16 #include "DIE.h"
314 /// createSubprogramDIE - Create new DIE using SP.
315 DIE *DwarfDebug::createSubprogramDIE(DISubprogram SP) {
317 DIE *SPDie = SPCU->getDIE(SP);
321 SPDie = new DIE(dwarf::DW_TAG_subprogram);
323 // DW_TAG_inlined_subroutine may refer to this DIE.
337 // If this DIE is going to refer declaration info using AT_specification
384 DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter);
449 /// updateSubprogramScopeDIE - Find DIE for the given subprogram and
453 DIE *DwarfDebug::updateSubprogramScopeDIE(const MDNode *SPNode) {
455 DIE *SPDie = SPCU->getDIE(SPNode);
457 assert(SPDie && "Unable to find subprogram DIE!");
466 // There is not any need to generate specification DIE for a function
469 DIE in parent function. So avoid creating
470 // specification DIE for a function defined inside a function.
482 DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter);
489 DIE *SPDeclDie = SPDie;
490 SPDie = new DIE(dwarf::DW_TAG_subprogram);
496 // Pick up abstract subprogram DIE.
497 if (DIE *AbsSPDIE = AbstractSPDies.lookup(SPNode)) {
498 SPDie = new DIE(dwarf::DW_TAG_subprogram);
517 DIE *DwarfDebug::constructLexicalScopeDIE(DbgScope *Scope) {
519 DIE *ScopeDIE = new DIE(dwarf::DW_TAG_lexical_block);
560 /// a function. Construct DIE to represent this concrete inlined copy
562 DIE *DwarfDebug::constructInlinedScopeDIE(DbgScope *Scope) {
590 DIE *OriginDIE = TheCU->getDIE(InlinedSP);
592 DEBUG(dbgs() << "Unable to find original DIE for inlined subprogram.");
595 DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine);
638 /// constructVariableDIE - Construct a DIE for the given DbgVariable.
639 DIE *DwarfDebug::constructVariableDIE(DbgVariable *DV, DbgScope *Scope) {
660 DIE *VariableDie = new DIE(Tag);
662 DIE *AbsDIE = NULL;
773 /// constructScopeDIE - Construct a DIE for this scope.
774 DIE *DwarfDebug::constructScopeDIE(DbgScope *Scope) {
778 SmallVector <DIE *, 8> Children;
784 if (DIE *Arg = constructVariableDIE(ArgDV, Scope))
790 if (DIE *Variable = constructVariableDIE(Variables[i], Scope))
794 if (DIE *Nested = constructScopeDIE(Scopes[j]))
797 DIE *ScopeDIE = NULL;
804 // Note down abstract DIE.
812 // There is no need to emit empty lexical block DIE.
821 for (SmallVector<DIE *, 8>::iterator I = Children.begin(),
871 DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
872 CompileUnit *NewCU = new CompileUnit(ID, Die, Asm, this);
873 NewCU->addString(Die, dwarf::DW_AT_producer, dwarf::DW_FORM_string,
875 NewCU->addUInt(Die, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
877 NewCU->addString(Die, dwarf::DW_AT_name, dwarf::DW_FORM_string, FN);
880 NewCU->addUInt(Die, dwarf::DW_AT_entry_pc, dwarf::DW_FORM_addr, 0);
884 NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,
887 NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
890 NewCU->addString(Die, dwarf::DW_AT_comp_dir, dwarf::DW_FORM_string, Dir);
892 NewCU->addUInt(Die, dwarf::DW_AT_APPLE_optimized, dwarf::DW_FORM_flag, 1);
896 NewCU->addString(Die, dwarf::DW_AT_APPLE_flags, dwarf::DW_FORM_string, Flags);
900 Die, dwarf::DW_AT_APPLE_major_runtime_vers,
908 /// getCompielUnit - Get CompileUnit DIE.
963 /// constructGlobalVariableDIE - Construct global variable DIE.
977 DIE *VariableDIE = new DIE(GV.getTag());
1011 // Do not create specification DIE if context is either compile unit
1015 // Create specification DIE.
1016 DIE *VariableSpecDIE = new DIE(dwarf::DW_TAG_variable);
1044 /// construct SubprogramDIE - Construct subprogram DIE.
1058 DIE *SubprogramDie = createSubprogramDIE(SP);
1187 // Construct subprogram DIE and add variables DIEs.
1189 DIE *ScopeDIE = getCompileUnit(SP)->getDIE(SP);
1192 DIE *VariableDIE = constructVariableDIE(Variables[i], Scope);
1200 for (SmallPtrSet<DIE *, 4>::iterator AI = InlinedSubprogramDIEs.begin(),
1202 DIE *ISP = *AI;
1206 for (DenseMap<DIE *, const MDNode *>::iterator CI = ContainingTypeMap.begin(),
1208 DIE *SPDie = CI->first;
1211 DIE *NDie = getCompileUnit(N)->getDIE(N);
1229 // Compute DIE offsets and sizes.
2033 DIE *CurFnDIE = constructScopeDIE(CurrentFnDbgScope);
2136 /// computeSizeAndOffset - Compute the size and offset of a DIE.
2139 DwarfDebug::computeSizeAndOffset(DIE *Die, unsigned Offset, bool Last) {
2141 const std::vector<DIE *> &Children = Die->getChildren();
2145 Die->addSiblingOffset(DIEValueAllocator);
2148 assignAbbrevNumber(Die->getAbbrev());
2150 // Get the abbreviation for this DIE.
2151 unsigned AbbrevNumber = Die->getAbbrevNumber();
2154 // Set DIE offset
2155 Die->setOffset(Offset);
2160 const SmallVector<DIEValue*, 32> &Values = Die->getValues();
2163 // Size the DIE attribute values.
2168 // Size the DIE children if any.
2180 Die->setSize(Offset - Die->getOffset());
2244 void DwarfDebug::emitDIE(DIE *Die) {
2245 // Get the abbreviation for this DIE.
2246 unsigned AbbrevNumber = Die->getAbbrevNumber();
2252 Twine::utohexstr(Die->getOffset()) + ":0x" +
2253 Twine::utohexstr(Die->getSize()) + " " +
2257 const SmallVector<DIEValue*, 32> &Values = Die->getValues();
2260 // Emit the DIE attribute values.
2264 assert(Form && "Too many attributes for DIE (check abbreviation)");
2271 Asm->EmitInt32(Die->getSiblingOffset());
2275 DIE *Origin = E->getEntry();
2297 if (UseDotDebugLocEntry.count(Die) != 0) {
2319 // Emit the DIE children if any.
2321 const std::vector<DIE *> &Children = Die->getChildren();
2341 DIE *Die = TheCU->getCUDie();
2348 unsigned ContentSize = Die->getSize() +
2363 emitDIE(Die);
2454 const StringMap<DIE*> &Globals = TheCU->getGlobals();
2455 for (StringMap<DIE*>::const_iterator
2458 DIE *Entity = GI->second;
2460 Asm->OutStreamer.AddComment("DIE offset");
2502 const StringMap<DIE*> &Globals = TheCU->getGlobalTypes();
2503 for (StringMap<DIE*>::const_iterator
2506 DIE * Entity = GI->second;
2508 if (Asm->isVerbose()) Asm->OutStreamer.AddComment("DIE offset");
2700 /// inlined instance; the die_offset points to the inlined_subroutine die in the
2749 if (Asm->isVerbose()) Asm->OutStreamer.AddComment("DIE offset");