mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Refactor the filename/directory information in DISubprogram to refer directly to the pair rather than the DIFile.
llvm-svn: 177677
This commit is contained in:
parent
05a454cd6d
commit
c9d598113b
@ -470,14 +470,6 @@ namespace llvm {
|
||||
|
||||
unsigned isOptimized() const;
|
||||
|
||||
StringRef getFilename() const {
|
||||
return getFieldAs<DIFile>(1).getFilename();
|
||||
}
|
||||
|
||||
StringRef getDirectory() const {
|
||||
return getFieldAs<DIFile>(1).getDirectory();
|
||||
}
|
||||
|
||||
/// getScopeLineNumber - Get the beginning of the scope of the
|
||||
/// function, not necessarily where the name of the program
|
||||
/// starts.
|
||||
|
@ -908,7 +908,7 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context,
|
||||
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
|
||||
File,
|
||||
File.getFileNode(),
|
||||
getNonCompileUnitScope(Context),
|
||||
MDString::get(VMContext, Name),
|
||||
MDString::get(VMContext, Name),
|
||||
@ -955,7 +955,7 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
|
||||
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
|
||||
Value *Elts[] = {
|
||||
GetTagConstant(VMContext, dwarf::DW_TAG_subprogram),
|
||||
F,
|
||||
F.getFileNode(),
|
||||
getNonCompileUnitScope(Context),
|
||||
MDString::get(VMContext, Name),
|
||||
MDString::get(VMContext, Name),
|
||||
|
@ -668,8 +668,6 @@ StringRef DIScope::getFilename() const {
|
||||
return DILexicalBlockFile(DbgNode).getFilename();
|
||||
if (isLexicalBlock())
|
||||
return DILexicalBlock(DbgNode).getFilename();
|
||||
if (isSubprogram())
|
||||
return DISubprogram(DbgNode).getFilename();
|
||||
return ::getStringField(getNodeField(DbgNode, 1), 0);
|
||||
}
|
||||
|
||||
@ -680,8 +678,6 @@ StringRef DIScope::getDirectory() const {
|
||||
return DILexicalBlockFile(DbgNode).getDirectory();
|
||||
if (isLexicalBlock())
|
||||
return DILexicalBlock(DbgNode).getDirectory();
|
||||
if (isSubprogram())
|
||||
return DISubprogram(DbgNode).getDirectory();
|
||||
return ::getStringField(getNodeField(DbgNode, 1), 1);
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
|
||||
!0 = metadata !{i32 786449, metadata !19, i32 12, metadata !"clang version 3.1 (trunk 153921) (llvm/trunk 153916)", i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !3, metadata !1, metadata !""} ; [ DW_TAG_compile_unit ]
|
||||
!1 = metadata !{i32 0}
|
||||
!3 = metadata !{metadata !5}
|
||||
!5 = metadata !{i32 786478, metadata !6, metadata !"callee", metadata !"callee", metadata !"", metadata !6, i32 4, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false, i32 (i32)* @callee, null, null, metadata !10, i32 7} ; [ DW_TAG_subprogram ]
|
||||
!5 = metadata !{i32 786478, metadata !19, metadata !"callee", metadata !"callee", metadata !"", metadata !6, i32 4, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 false, i32 (i32)* @callee, null, null, metadata !10, i32 7} ; [ DW_TAG_subprogram ]
|
||||
!6 = metadata !{i32 786473, metadata !19} ; [ DW_TAG_file_type ]
|
||||
!7 = metadata !{i32 786453, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
|
||||
!8 = metadata !{metadata !9, metadata !9}
|
||||
|
@ -46,14 +46,14 @@ entry:
|
||||
!1 = metadata !{metadata !2}
|
||||
!2 = metadata !{i32 0}
|
||||
!3 = metadata !{metadata !5}
|
||||
!5 = metadata !{i32 786478, metadata !6, metadata !"test", metadata !"test", metadata !"", metadata !6, i32 2, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @test, null, null, metadata !1, i32 3} ; [ DW_TAG_subprogram ] [line 2] [def] [scope 3] [test]
|
||||
!5 = metadata !{i32 786478, metadata !23, metadata !"test", metadata !"test", metadata !"", metadata !6, i32 2, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @test, null, null, metadata !1, i32 3} ; [ DW_TAG_subprogram ] [line 2] [def] [scope 3] [test]
|
||||
!6 = metadata !{i32 786473, metadata !23} ; [ DW_TAG_file_type ]
|
||||
!7 = metadata !{i32 786453, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
|
||||
!8 = metadata !{metadata !9, metadata !9}
|
||||
!9 = metadata !{i32 786468, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
|
||||
!10 = metadata !{i32 786449, metadata !24, i32 12, metadata !"clang version 3.3 (trunk 172862)", i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !11, metadata !1, metadata !""} ; [ DW_TAG_compile_unit ]
|
||||
!11 = metadata !{metadata !13}
|
||||
!13 = metadata !{i32 786478, metadata !14, metadata !"fn", metadata !"fn", metadata !"", metadata !14, i32 1, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @fn, null, null, metadata !1, i32 1} ; [ DW_TAG_subprogram ] [line 1] [def] [fn]
|
||||
!13 = metadata !{i32 786478, metadata !24, metadata !"fn", metadata !"fn", metadata !"", metadata !14, i32 1, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @fn, null, null, metadata !1, i32 1} ; [ DW_TAG_subprogram ] [line 1] [def] [fn]
|
||||
!14 = metadata !{i32 786473, metadata !24} ; [ DW_TAG_file_type ]
|
||||
!15 = metadata !{i32 786689, metadata !5, metadata !"a", metadata !6, i32 16777218, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [a] [line 2]
|
||||
!16 = metadata !{i32 2, i32 0, metadata !5, null}
|
||||
|
Loading…
Reference in New Issue
Block a user