mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Revert "Revert "PR14606: debug info imported_module support""
This reverts commit r179840 with a fix to test/DebugInfo/two-cus-from-same-file.ll I'm not sure why that test only failed on ARM & MIPS and not X86 Linux, even though the debug info was clearly invalid on all of them, but this ought to fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179996 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -61,6 +61,9 @@ void DIBuilder::finalize() {
|
||||
|
||||
DIArray GVs = getOrCreateArray(AllGVs);
|
||||
DIType(TempGVs).replaceAllUsesWith(GVs);
|
||||
|
||||
DIArray IMs = getOrCreateArray(AllImportedModules);
|
||||
DIType(TempImportedModules).replaceAllUsesWith(IMs);
|
||||
}
|
||||
|
||||
/// getNonCompileUnitScope - If N is compile unit return NULL otherwise return
|
||||
@ -101,6 +104,8 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
|
||||
|
||||
TempGVs = MDNode::getTemporary(VMContext, TElts);
|
||||
|
||||
TempImportedModules = MDNode::getTemporary(VMContext, TElts);
|
||||
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, dwarf::DW_TAG_compile_unit),
|
||||
createFilePathPair(VMContext, Filename, Directory),
|
||||
@ -113,6 +118,7 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
|
||||
TempRetainTypes,
|
||||
TempSubprograms,
|
||||
TempGVs,
|
||||
TempImportedModules,
|
||||
MDString::get(VMContext, SplitName)
|
||||
};
|
||||
TheCU = DICompileUnit(MDNode::get(VMContext, Elts));
|
||||
@ -122,6 +128,21 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
|
||||
NMD->addOperand(TheCU);
|
||||
}
|
||||
|
||||
DIImportedModule DIBuilder::createImportedModule(DIScope Context,
|
||||
DINameSpace NS,
|
||||
unsigned Line) {
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, dwarf::DW_TAG_imported_module),
|
||||
Context,
|
||||
NS,
|
||||
ConstantInt::get(Type::getInt32Ty(VMContext), Line),
|
||||
};
|
||||
DIImportedModule M(MDNode::get(VMContext, Elts));
|
||||
assert(M.Verify() && "Imported module should be valid");
|
||||
AllImportedModules.push_back(M);
|
||||
return M;
|
||||
}
|
||||
|
||||
/// createFile - Create a file descriptor to hold debugging information
|
||||
/// for a file.
|
||||
DIFile DIBuilder::createFile(StringRef Filename, StringRef Directory) {
|
||||
|
Reference in New Issue
Block a user