mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-10 13:48:44 +00:00
Do not work too hard to find type's file info. There is a special field to record file info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -271,8 +271,14 @@ namespace llvm {
|
|||||||
bool isValid() const {
|
bool isValid() const {
|
||||||
return DbgNode && (isBasicType() || isDerivedType() || isCompositeType());
|
return DbgNode && (isBasicType() || isDerivedType() || isCompositeType());
|
||||||
}
|
}
|
||||||
StringRef getFilename() const { return getCompileUnit().getFilename();}
|
StringRef getDirectory() const {
|
||||||
StringRef getDirectory() const { return getCompileUnit().getDirectory();}
|
DIFile F = getFieldAs<DIFile>(3);
|
||||||
|
return F.getDirectory();
|
||||||
|
}
|
||||||
|
StringRef getFilename() const {
|
||||||
|
DIFile F = getFieldAs<DIFile>(3);
|
||||||
|
return F.getFilename();
|
||||||
|
}
|
||||||
|
|
||||||
/// replaceAllUsesWith - Replace all uses of debug info referenced by
|
/// replaceAllUsesWith - Replace all uses of debug info referenced by
|
||||||
/// this descriptor.
|
/// this descriptor.
|
||||||
|
@ -568,8 +568,8 @@ void DwarfDebug::addSourceLine(DIE *Die, DIType Ty) {
|
|||||||
unsigned Line = Ty.getLineNumber();
|
unsigned Line = Ty.getLineNumber();
|
||||||
if (Line == 0 || !Ty.getContext().Verify())
|
if (Line == 0 || !Ty.getContext().Verify())
|
||||||
return;
|
return;
|
||||||
unsigned FileID = GetOrCreateSourceID(Ty.getContext().getDirectory(),
|
unsigned FileID = GetOrCreateSourceID(Ty.getDirectory(),
|
||||||
Ty.getContext().getFilename());
|
Ty.getFilename());
|
||||||
assert(FileID && "Invalid file id");
|
assert(FileID && "Invalid file id");
|
||||||
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
addUInt(Die, dwarf::DW_AT_decl_file, 0, FileID);
|
||||||
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
addUInt(Die, dwarf::DW_AT_decl_line, 0, Line);
|
||||||
|
Reference in New Issue
Block a user