Simplify file/directory name handling in DILexicalBlock

llvm-svn: 176993
This commit is contained in:
David Blaikie 2013-03-13 22:52:59 +00:00
parent d2ec7b04e9
commit 27dd933a64
2 changed files with 4 additions and 6 deletions

View File

@ -621,12 +621,10 @@ namespace llvm {
unsigned getLineNumber() const { return getUnsignedField(2); } unsigned getLineNumber() const { return getUnsignedField(2); }
unsigned getColumnNumber() const { return getUnsignedField(3); } unsigned getColumnNumber() const { return getUnsignedField(3); }
StringRef getDirectory() const { StringRef getDirectory() const {
StringRef dir = getFieldAs<DIFile>(4).getDirectory(); return getFieldAs<DIFile>(4).getDirectory();
return !dir.empty() ? dir : getContext().getDirectory();
} }
StringRef getFilename() const { StringRef getFilename() const {
StringRef filename = getFieldAs<DIFile>(4).getFilename(); return getFieldAs<DIFile>(4).getFilename();
return !filename.empty() ? filename : getContext().getFilename();
} }
bool Verify() const; bool Verify() const;
}; };

View File

@ -55,9 +55,9 @@ declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
!24 = metadata !{i32 786468, metadata !1, metadata !"char", metadata !1, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ] !24 = metadata !{i32 786468, metadata !1, metadata !"char", metadata !1, i32 0, i64 8, i64 8, i64 0, i32 0, i32 6} ; [ DW_TAG_base_type ]
!25 = metadata !{i32 786689, metadata !19, metadata !"argv", metadata !1, i32 22, metadata !22, i32 0, null} ; [ DW_TAG_arg_variable ] !25 = metadata !{i32 786689, metadata !19, metadata !"argv", metadata !1, i32 22, metadata !22, i32 0, null} ; [ DW_TAG_arg_variable ]
!26 = metadata !{i32 786688, metadata !27, metadata !"e", metadata !1, i32 23, metadata !14, i32 0, null} ; [ DW_TAG_auto_variable ] !26 = metadata !{i32 786688, metadata !27, metadata !"e", metadata !1, i32 23, metadata !14, i32 0, null} ; [ DW_TAG_auto_variable ]
!27 = metadata !{i32 786443, metadata !19, i32 22, i32 0} ; [ DW_TAG_lexical_block ] !27 = metadata !{i32 786443, metadata !19, i32 22, i32 0, metadata !1, i32 0} ; [ DW_TAG_lexical_block ]
!28 = metadata !{i32 18, i32 0, metadata !29, null} !28 = metadata !{i32 18, i32 0, metadata !29, null}
!29 = metadata !{i32 786443, metadata !9, i32 17, i32 0} ; [ DW_TAG_lexical_block ] !29 = metadata !{i32 786443, metadata !9, i32 17, i32 0, metadata !1, i32 1} ; [ DW_TAG_lexical_block ]
!30 = metadata !{i32 19, i32 0, metadata !29, null} !30 = metadata !{i32 19, i32 0, metadata !29, null}
; The variable bar:myvar changes registers after the first movq. ; The variable bar:myvar changes registers after the first movq.