[llvm-branch-commits] [llvm-branch] r341036 - Merging r340839:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 30 01:30:33 PDT 2018


Author: hans
Date: Thu Aug 30 01:30:33 2018
New Revision: 341036

URL: http://llvm.org/viewvc/llvm-project?rev=341036&view=rev
Log:
Merging r340839:
------------------------------------------------------------------------
r340839 | bcain | 2018-08-28 18:23:39 +0200 (Tue, 28 Aug 2018) | 14 lines

[debuginfo] generate debug info with asm+.file

Summary:
For assembly input files, generate debug info even when the .file
directive is present, provided it does not include a file-number
argument.  Fixes PR38695.

Reviewers: probinson, sidneym

Subscribers: aprantl, hiraditya, JDevlieghere, llvm-commits

Differential Revision: https://reviews.llvm.org/D51315


------------------------------------------------------------------------

Added:
    llvm/branches/release_70/test/MC/AsmParser/directive_file-3.s
      - copied unchanged from r340839, llvm/trunk/test/MC/AsmParser/directive_file-3.s
Modified:
    llvm/branches/release_70/   (props changed)
    llvm/branches/release_70/lib/MC/MCParser/AsmParser.cpp

Propchange: llvm/branches/release_70/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 30 01:30:33 2018
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,338552,338554,338569,338599,338610,338658,338665,338682,338703,338709,338716,338751,338762,338817,338841,338902,338915,338968,339073,339091,339166,339179,339184,339190,339225,339316,339319,339411,339492,339515,339533,339535-339536,339600,339636,339674,339769,339822,339883,339895-339896,339945,340158,340303,340641,340691
+/llvm/trunk:155241,338552,338554,338569,338599,338610,338658,338665,338682,338703,338709,338716,338751,338762,338817,338841,338902,338915,338968,339073,339091,339166,339179,339184,339190,339225,339316,339319,339411,339492,339515,339533,339535-339536,339600,339636,339674,339769,339822,339883,339895-339896,339945,340158,340303,340641,340691,340839

Modified: llvm/branches/release_70/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_70/lib/MC/MCParser/AsmParser.cpp?rev=341036&r1=341035&r2=341036&view=diff
==============================================================================
--- llvm/branches/release_70/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/branches/release_70/lib/MC/MCParser/AsmParser.cpp Thu Aug 30 01:30:33 2018
@@ -3348,17 +3348,17 @@ bool AsmParser::parseDirectiveFile(SMLoc
     }
   }
 
-  // In case there is a -g option as well as debug info from directive .file,
-  // we turn off the -g option, directly use the existing debug info instead.
-  // Also reset any implicit ".file 0" for the assembler source.
-  if (Ctx.getGenDwarfForAssembly()) {
-    Ctx.getMCDwarfLineTable(0).resetRootFile();
-    Ctx.setGenDwarfForAssembly(false);
-  }
-
   if (FileNumber == -1)
     getStreamer().EmitFileDirective(Filename);
   else {
+    // In case there is a -g option as well as debug info from directive .file,
+    // we turn off the -g option, directly use the existing debug info instead.
+    // Also reset any implicit ".file 0" for the assembler source.
+    if (Ctx.getGenDwarfForAssembly()) {
+      Ctx.getMCDwarfLineTable(0).resetRootFile();
+      Ctx.setGenDwarfForAssembly(false);
+    }
+
     MD5::MD5Result *CKMem = nullptr;
     if (HasMD5) {
       CKMem = (MD5::MD5Result *)Ctx.allocate(sizeof(MD5::MD5Result), 1);




More information about the llvm-branch-commits mailing list