@@ -446,20 +446,6 @@ void CompileUnit::addSourceLine(DIE* Die, DIScope* S, unsigned Line)
446446 addUInt (Die, dwarf::DW_AT_decl_line, None, Line);
447447}
448448
449- // / addSourceLine - Add location information to specified debug information
450- // / entry.
451- void CompileUnit::addSourceLine (DIE* Die, DIImportedEntity* IE, unsigned Line)
452- {
453- // If the line number is 0, don't add it.
454- if (Line == 0 )
455- return ;
456-
457- unsigned FileID = DD->getOrCreateSourceID (IE->getFile ()->getFilename (), IE->getFile ()->getDirectory (), getUniqueID ());
458- IGC_ASSERT_MESSAGE (FileID, " Invalid file id" );
459- addUInt (Die, dwarf::DW_AT_decl_file, None, FileID);
460- addUInt (Die, dwarf::DW_AT_decl_line, None, Line);
461- }
462-
463449// / addSourceLine - Add location information to specified debug information
464450// / entry.
465451void CompileUnit::addSourceLine (DIE* Die, DIVariable* V)
@@ -756,6 +742,7 @@ IGC::DIE* CompileUnit::getOrCreateContextDIE(DIScope* Context)
756742 return getOrCreateModuleDIE (MD);
757743
758744 return getDIE (Context);
745+
759746}
760747
761748// / getOrCreateTypeDIE - Find existing DIE or create new DIE for the
@@ -2030,36 +2017,6 @@ void CompileUnit::constructTemplateValueParameterDIE(
20302017 }
20312018}
20322019
2033- // / constructImportedEntityDIE - Create a DIE for DIImportedEntity.
2034- IGC::DIE* CompileUnit::constructImportedEntityDIE (
2035- DIImportedEntity* Module)
2036- {
2037- DIE* IMDie = new (DIEValueAllocator) DIE ((dwarf::Tag)Module->getTag ());
2038- insertDIE (Module, IMDie);
2039- DIE* EntityDie;
2040- auto * Entity = Module->getEntity ();
2041- if (auto * NS = dyn_cast<DINamespace>(Entity))
2042- EntityDie = getOrCreateNameSpace (NS);
2043- else if (auto * M = dyn_cast<DIModule>(Entity))
2044- EntityDie = getOrCreateModuleDIE (M);
2045- else if (auto * SP = dyn_cast<DISubprogram>(Entity))
2046- EntityDie = getOrCreateSubprogramDIE (SP);
2047- else if (auto * T = dyn_cast<DIType>(Entity))
2048- EntityDie = getOrCreateTypeDIE (T);
2049- // else if (auto* GV = dyn_cast<DIGlobalVariable>(Entity)) // TODO missing support
2050- // EntityDie = getOrCreateGlobalVariableDIE(GV, {});
2051- else
2052- EntityDie = getDIE (Entity);
2053- assert (EntityDie);
2054-
2055- addSourceLine (IMDie, Module, Module->getLine ());
2056- addDIEEntry (IMDie, dwarf::DW_AT_import, EntityDie);
2057- StringRef Name = Module->getName ();
2058- if (!Name.empty ())
2059- addString (IMDie, dwarf::DW_AT_name, Name);
2060-
2061- return IMDie;
2062- }
20632020
20642021// / getOrCreateNameSpace - Create a DIE for DINameSpace.
20652022IGC::DIE* CompileUnit::getOrCreateNameSpace (DINamespace* NS)
@@ -2224,33 +2181,10 @@ IGC::DIE* CompileUnit::getOrCreateModuleDIE(DIModule* MD)
22242181 // Construct the context before querying for the existence of the DIE in case
22252182 // such construction creates the DIE (as is the case for member function
22262183 // declarations).
2227- DIE* ContextDIE = getOrCreateContextDIE (MD->getScope ());
22282184
22292185 IGC_ASSERT_MESSAGE (false , " Missing implementation for DIModule!" );
2230- DIE* MDDie = getDIE (MD);
2231- if (MDDie)
2232- return MDDie;
2233-
2234- MDDie = createAndAddDIE (dwarf::DW_TAG_module, *ContextDIE, MD);
2235-
2236- if (!MD->getName ().empty ())
2237- {
2238- addString (MDDie, dwarf::DW_AT_name, MD->getName ());
2239- }
2240-
2241- #if LLVM_VERSION_MAJOR >= 12
2242- if (!MD->getIsDecl ())
2243- {
2244- addSourceLine (MDDie, MD, MD->getLineNo ());
2245- }
2246- else
2247- {
2248- addFlag (MDDie, dwarf::DW_AT_declaration);
2249- }
2250- #endif // LLVM_VERSION_MAJOR >= 12.
22512186
22522187 return nullptr ;
2253- return MDDie;
22542188}
22552189
22562190// / constructSubrangeDIE - Construct subrange DIE from DISubrange.
0 commit comments