Home | History | Annotate | Download | only in AsmPrinter

Lines Matching refs:DIE

16 #include "DIE.h"
332 DIE* Die) {
335 TheCU->addAccelName(SP.getName(), Die);
340 TheCU->addAccelName(SP.getLinkageName(), Die);
347 TheCU->addAccelObjC(Class, Die);
349 TheCU->addAccelObjC(Category, Die);
351 TheCU->addAccelName(getObjCMethodName(SP.getName()), Die);
355 // Find DIE for the given subprogram and attach appropriate DW_AT_low_pc
358 DIE *DwarfDebug::updateSubprogramScopeDIE(CompileUnit *SPCU,
360 DIE *SPDie = SPCU->getDIE(SPNode);
362 assert(SPDie && "Unable to find subprogram DIE!");
365 // If we're updating an abstract DIE, then we will be adding the children and
367 // concrete DIE twice.
368 DIE *AbsSPDIE = AbstractSPDies.lookup(SPNode);
371 // Pick up abstract subprogram DIE.
372 SPDie = new DIE(dwarf::DW_TAG_subprogram);
382 // There is not any need to generate specification DIE for a function
385 // expect specification DIE in parent function. So avoid creating
386 // specification DIE for a function defined inside a function.
398 DIE *Arg = new DIE(dwarf::DW_TAG_formal_parameter);
408 DIE *SPDeclDie = SPDie;
409 SPDie = new DIE(dwarf::DW_TAG_subprogram);
436 DIE *DwarfDebug::constructLexicalScopeDIE(CompileUnit *TheCU,
438 DIE *ScopeDIE = new DIE(dwarf::DW_TAG_lexical_block);
466 // Construct the address range for this DIE.
482 // This scope represents inlined body of a function. Construct DIE to
484 DIE *DwarfDebug::constructInlinedScopeDIE(CompileUnit *TheCU,
494 DIE *OriginDIE = TheCU->getDIE(InlinedSP);
496 DEBUG(dbgs() << "Unable to find original DIE for an inlined subprogram.");
500 DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine);
536 // Add the call site information to the DIE.
566 // Construct a DIE for this scope.
567 DIE *DwarfDebug::constructScopeDIE(CompileUnit *TheCU, LexicalScope *Scope) {
577 SmallVector<DIE *, 8> Children;
578 DIE *ObjectPointer = NULL;
584 if (DIE *Arg =
593 if (DIE *Variable =
600 if (DIE *Nested = constructScopeDIE(TheCU, Scopes[j]))
602 DIE *ScopeDIE = NULL;
609 // Note down abstract DIE.
617 // There is no need to emit empty lexical block DIE.
634 for (SmallVectorImpl<DIE *>::iterator I = Children.begin(),
697 DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
699 DIUnit.getLanguage(), Die, N, Asm,
707 NewCU->addString(Die, dwarf::DW_AT_producer, DIUnit.getProducer());
708 NewCU->addUInt(Die, dwarf::DW_AT_language, dwarf::DW_FORM_data2,
710 NewCU->addString(Die, dwarf::DW_AT_name, FN);
716 NewCU->addLabelAddress(Die, dwarf::DW_AT_low_pc, NULL);
737 NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,
741 NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
743 NewCU->addDelta(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,
750 NewCU->addString(Die, dwarf::DW_AT_comp_dir, CompilationDir);
752 NewCU->addFlag(Die, dwarf::DW_AT_APPLE_optimized);
756 NewCU->addString(Die, dwarf::DW_AT_APPLE_flags, Flags);
759 NewCU->addUInt(Die, dwarf::DW_AT_APPLE_major_runtime_vers,
771 // Construct subprogram DIE.
785 DIE *SubprogramDie = TheCU->getOrCreateSubprogramDIE(SP);
803 if (DIE *D = TheCU->getOrCreateContextDIE(Module.getContext()))
808 DIE *Context) {
817 DIE *Context) {
821 DIE *IMDie = new DIE(Module.getTag());
823 DIE *EntityDie;
911 for (SmallPtrSet<DIE *, 4>::iterator AI = InlinedSubprogramDIEs.begin(),
913 DIE *ISP = *AI;
916 for (DenseMap<const MDNode *, DIE *>::iterator AI = AbstractSPDies.begin(),
918 DIE *ISP = AI->second;
946 // Construct subprogram DIE and add variables DIEs.
950 DIE *ScopeDIE = SPCU->getDIE(SP);
955 if (DIE *VariableDIE =
970 static StringRef getDIEStringAttr(DIE *Die, unsigned Attr) {
971 DIEValue *V = Die->findAttribute(Attr);
1003 static void addParentContextToHash(MD5 &Hash, DIE *Parent) {
1009 SmallVector<DIE *, 1> Parents;
1017 for (SmallVectorImpl<DIE *>::reverse_iterator I = Parents.rbegin(),
1020 DIE *Die = *I;
1026 addULEB128ToHash(Hash, Die->getTag());
1029 StringRef Name = getDIEStringAttr(Die, dwarf::DW_AT_name);
1037 /// DWARF4 standard. It is the md5 hash of a flattened description of the DIE with
1039 static void addDIEODRSignature(MD5 &Hash, CompileUnit *CU, DIE *Die) {
1046 DIE *Parent = Die->getParent();
1050 // Add the current DIE information.
1052 // Add the DWARF tag of the DIE.
1053 addULEB128ToHash(Hash, Die->getTag());
1056 addStringToHash(Hash, getDIEStringAttr(Die, dwarf::DW_AT_name));
1069 CU->addUInt(Die, dwarf::DW_AT_GNU_odr_signature, dwarf::DW_FORM_data8,
1073 /// Return true if the current DIE is contained within an anonymous namespace.
1074 static bool isContainedInAnonNamespace(DIE *Die) {
1075 DIE *Parent = Die->getParent();
1089 static bool shouldAddODRHash(CompileUnit *CU, DIE *Die) {
1091 getDIEStringAttr(Die, dwarf::DW_AT_name) != "" &&
1092 !isContainedInAnonNamespace(Die);
1115 DIE *Die = TypeUnits[i];
1118 if (GenerateODRHash && shouldAddODRHash(CUMap.begin()->second, Die))
1119 addDIEODRSignature(Hash, CUMap.begin()->second, Die);
1122 // Compute DIE offsets and sizes.
1865 DIE *CurFnDIE = constructScopeDIE(TheCU, FnScope);
1927 // Compute the size and offset of a DIE.
1929 DwarfUnits::computeSizeAndOffset(DIE *Die, unsigned Offset) {
1931 const std::vector<DIE *> &Children = Die->getChildren();
1934 assignAbbrevNumber(Die->getAbbrev());
1936 // Get the abbreviation for this DIE.
1937 unsigned AbbrevNumber = Die->getAbbrevNumber();
1940 // Set DIE offset
1941 Die->setOffset(Offset);
1946 const SmallVectorImpl<DIEValue*> &Values = Die->getValues();
1949 // Size the DIE attribute values.
1954 // Size the DIE children if any.
1966 Die->setSize(Offset - Die->getOffset());
2031 void DwarfDebug::emitDIE(DIE *Die, std::vector<DIEAbbrev *> *Abbrevs) {
2032 // Get the abbreviation for this DIE.
2033 unsigned AbbrevNumber = Die->getAbbrevNumber();
2039 Twine::utohexstr(Die->getOffset()) + ":0x" +
2040 Twine::utohexstr(Die->getSize()) + " " +
2044 const SmallVectorImpl<DIEValue*> &Values = Die->getValues();
2047 // Emit the DIE attribute values.
2051 assert(Form && "Too many attributes for DIE (check abbreviation)");
2059 DIE *Origin = E->getEntry();
2114 // Emit the DIE children if any.
2116 const std::vector<DIE *> &Children = Die->getChildren();
2137 DIE *Die = TheCU->getCUDie();
2145 unsigned ContentSize = Die->getSize() +
2160 DD->emitDIE(Die, Abbreviations);
2166 /// For a given compile unit DIE, returns offset from beginning of debug info.
2167 unsigned DwarfUnits::getCUOffset(DIE *Die) {
2168 assert(Die->getTag() == dwarf::DW_TAG_compile_unit &&
2169 "Input DIE should be compile unit in getCUOffset.");
2173 if (TheCU->getCUDie() == Die)
2176 llvm_unreachable("The compile unit DIE should belong to CUs in DwarfUnits.");
2257 const StringMap<std::vector<DIE*> > &Names = TheCU->getAccelNames();
2258 for (StringMap<std::vector<DIE*> >::const_iterator
2261 const std::vector<DIE *> &Entities = GI->second;
2262 for (std::vector<DIE *>::const_iterator DI = Entities.begin(),
2286 const StringMap<std::vector<DIE*> > &Names = TheCU->getAccelObjC();
2287 for (StringMap<std::vector<DIE*> >::const_iterator
2290 const std::vector<DIE *> &Entities = GI->second;
2291 for (std::vector<DIE *>::const_iterator DI = Entities.begin(),
2314 const StringMap<std::vector<DIE*> > &Names = TheCU->getAccelNamespace();
2315 for (StringMap<std::vector<DIE*> >::const_iterator
2318 const std::vector<DIE *> &Entities = GI->second;
2319 for (std::vector<DIE *>::const_iterator DI = Entities.begin(),
2348 const StringMap<std::vector<std::pair<DIE*, unsigned > > > &Names
2350 for (StringMap<std::vector<std::pair<DIE*, unsigned> > >::const_iterator
2353 const std::vector<std::pair<DIE *, unsigned> > &Entities = GI->second;
2354 for (std::vector<std::pair<DIE *, unsigned> >::const_iterator DI
2405 const StringMap<DIE*> &Globals = TheCU->getGlobalNames();
2406 for (StringMap<DIE*>::const_iterator
2409 const DIE *Entity = GI->second;
2411 Asm->OutStreamer.AddComment("DIE offset");
2456 const StringMap<DIE*> &Globals = TheCU->getGlobalTypes();
2457 for (StringMap<DIE*>::const_iterator
2460 DIE *Entity = GI->second;
2462 if (Asm->isVerbose()) Asm->OutStreamer.AddComment("DIE offset");
2699 // inlined instance; the die_offset points to the inlined_subroutine die in the
2749 if (Asm->isVerbose()) Asm->OutStreamer.AddComment("DIE offset");
2763 // This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,
2771 DIE *Die = new DIE(dwarf::DW_TAG_compile_unit);
2773 DIUnit.getLanguage(), Die, N, Asm,
2776 NewCU->addLocalString(Die, dwarf::DW_AT_GNU_dwo_name,
2780 NewCU->addUInt(Die, dwarf::DW_AT_GNU_dwo_id, dwarf::DW_FORM_data8, 0);
2785 NewCU->addLabel(Die, dwarf::DW_AT_GNU_addr_base, dwarf::DW_FORM_sec_offset,
2788 NewCU->addUInt(Die, dwarf::DW_AT_GNU_addr_base,
2793 NewCU->addUInt(Die, dwarf::DW_AT_low_pc, dwarf::DW_FORM_addr, 0);
2799 NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_sec_offset,
2802 NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_sec_offset, 0);
2805 NewCU->addLocalString(Die, dwarf::DW_AT_comp_dir, CompilationDir);