Skip to content

Commit dd1c289

Browse files
author
Devang Patel
committed
Line number 0 indicates there is no source line/file name info available for this construct.
llvm-svn: 116061
1 parent 5e8ee2b commit dd1c289

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ void DwarfDebug::addSourceLine(DIE *Die, DIVariable V) {
507507
return;
508508

509509
unsigned Line = V.getLineNumber();
510+
if (Line == 0)
511+
return;
510512
unsigned FileID = GetOrCreateSourceID(V.getContext().getDirectory(),
511513
V.getContext().getFilename());
512514
assert(FileID && "Invalid file id");
@@ -522,6 +524,8 @@ void DwarfDebug::addSourceLine(DIE *Die, DIGlobalVariable G) {
522524
return;
523525

524526
unsigned Line = G.getLineNumber();
527+
if (Line == 0)
528+
return;
525529
unsigned FileID = GetOrCreateSourceID(G.getContext().getDirectory(),
526530
G.getContext().getFilename());
527531
assert(FileID && "Invalid file id");
@@ -557,7 +561,7 @@ void DwarfDebug::addSourceLine(DIE *Die, DIType Ty) {
557561
return;
558562

559563
unsigned Line = Ty.getLineNumber();
560-
if (!Ty.getContext().Verify())
564+
if (Line == 0 || !Ty.getContext().Verify())
561565
return;
562566
unsigned FileID = GetOrCreateSourceID(Ty.getContext().getDirectory(),
563567
Ty.getContext().getFilename());
@@ -574,6 +578,8 @@ void DwarfDebug::addSourceLine(DIE *Die, DINameSpace NS) {
574578
return;
575579

576580
unsigned Line = NS.getLineNumber();
581+
if (Line == 0)
582+
return;
577583
StringRef FN = NS.getFilename();
578584
StringRef Dir = NS.getDirectory();
579585

0 commit comments

Comments
 (0)