Commit 606bf753 authored by Duncan P. N. Exon Smith's avatar Duncan P. N. Exon Smith
Browse files

Merging r226046:

------------------------------------------------------------------------
r226046 | dexonsmith | 2015-01-14 14:14:26 -0800 (Wed, 14 Jan 2015) | 3 lines

IR: Always print MDLocation line

Print `MDLocation`'s `line` field even when it's 0.
------------------------------------------------------------------------

llvm-svn: 226092
parent c65f9346
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1291,7 +1291,7 @@ static void writeMDLocation(raw_ostream &Out, const MDLocation *DL,
                            const Module *Context) {
  Out << "!MDLocation(";
  FieldSeparator FS;
  if (DL->getLine())
  // Always output the line, since 0 is a relevant and important value for it.
  Out << FS << "line: " << DL->getLine();
  if (DL->getColumn())
    Out << FS << "column: " << DL->getColumn();
+1 −1
Original line number Diff line number Diff line
@@ -15,6 +15,6 @@
!3 = !MDLocation(scope: !0, inlinedAt: !1, column: 7, line: 3)
!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)
!6 = !MDLocation(scope: !0, column: 0, line: 0)