forked from OSchip/llvm-project
IR: Always print MDLocation line
Print `MDLocation`'s `line` field even when it's 0. llvm-svn: 226046
This commit is contained in:
parent
e16d587515
commit
503cf3bff9
|
@ -1291,8 +1291,8 @@ static void writeMDLocation(raw_ostream &Out, const MDLocation *DL,
|
||||||
const Module *Context) {
|
const Module *Context) {
|
||||||
Out << "!MDLocation(";
|
Out << "!MDLocation(";
|
||||||
FieldSeparator FS;
|
FieldSeparator FS;
|
||||||
if (DL->getLine())
|
// Always output the line, since 0 is a relevant and important value for it.
|
||||||
Out << FS << "line: " << DL->getLine();
|
Out << FS << "line: " << DL->getLine();
|
||||||
if (DL->getColumn())
|
if (DL->getColumn())
|
||||||
Out << FS << "column: " << DL->getColumn();
|
Out << FS << "column: " << DL->getColumn();
|
||||||
Out << FS << "scope: ";
|
Out << FS << "scope: ";
|
||||||
|
|
|
@ -15,6 +15,6 @@
|
||||||
!3 = !MDLocation(scope: !0, inlinedAt: !1, column: 7, line: 3)
|
!3 = !MDLocation(scope: !0, inlinedAt: !1, column: 7, line: 3)
|
||||||
!4 = !MDLocation(column: 7, line: 3, scope: !0, inlinedAt: !1)
|
!4 = !MDLocation(column: 7, line: 3, scope: !0, inlinedAt: !1)
|
||||||
|
|
||||||
; CHECK-NEXT: !3 = !MDLocation(scope: !0)
|
; CHECK-NEXT: !3 = !MDLocation(line: 0, scope: !0)
|
||||||
!5 = !MDLocation(scope: !0)
|
!5 = !MDLocation(scope: !0)
|
||||||
!6 = !MDLocation(scope: !0, column: 0, line: 0)
|
!6 = !MDLocation(scope: !0, column: 0, line: 0)
|
||||||
|
|
Loading…
Reference in New Issue