@@ -446,20 +446,6 @@ void CompileUnit::addSourceLine(DIE* Die, DIScope* S, unsigned Line)
446
446
addUInt (Die, dwarf::DW_AT_decl_line, None, Line);
447
447
}
448
448
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
-
463
449
// / addSourceLine - Add location information to specified debug information
464
450
// / entry.
465
451
void CompileUnit::addSourceLine (DIE* Die, DIVariable* V)
@@ -756,6 +742,7 @@ IGC::DIE* CompileUnit::getOrCreateContextDIE(DIScope* Context)
756
742
return getOrCreateModuleDIE (MD);
757
743
758
744
return getDIE (Context);
745
+
759
746
}
760
747
761
748
// / getOrCreateTypeDIE - Find existing DIE or create new DIE for the
@@ -2030,36 +2017,6 @@ void CompileUnit::constructTemplateValueParameterDIE(
2030
2017
}
2031
2018
}
2032
2019
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
- }
2063
2020
2064
2021
// / getOrCreateNameSpace - Create a DIE for DINameSpace.
2065
2022
IGC::DIE* CompileUnit::getOrCreateNameSpace (DINamespace* NS)
@@ -2224,33 +2181,10 @@ IGC::DIE* CompileUnit::getOrCreateModuleDIE(DIModule* MD)
2224
2181
// Construct the context before querying for the existence of the DIE in case
2225
2182
// such construction creates the DIE (as is the case for member function
2226
2183
// declarations).
2227
- DIE* ContextDIE = getOrCreateContextDIE (MD->getScope ());
2228
2184
2229
2185
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.
2251
2186
2252
2187
return nullptr ;
2253
- return MDDie;
2254
2188
}
2255
2189
2256
2190
// / constructSubrangeDIE - Construct subrange DIE from DISubrange.
0 commit comments