diff options
| author | Brian Cain <bcain@codeaurora.org> | 2018-08-28 16:23:39 +0000 |
|---|---|---|
| committer | Brian Cain <bcain@codeaurora.org> | 2018-08-28 16:23:39 +0000 |
| commit | 3e0ca5708f917a5525e53be1270db71b089f8b71 (patch) | |
| tree | 43ffa4830241788b9799a7d0da526a542128cf66 /llvm/lib | |
| parent | 5167e2d1afc5a6c89cbbfea4243864b58a8ce37a (diff) | |
| download | bcm5719-llvm-3e0ca5708f917a5525e53be1270db71b089f8b71.tar.gz bcm5719-llvm-3e0ca5708f917a5525e53be1270db71b089f8b71.zip | |
[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
llvm-svn: 340839
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 0a4706ed104..38b6171ede9 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -3348,17 +3348,17 @@ bool AsmParser::parseDirectiveFile(SMLoc DirectiveLoc) { } } - // 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); |

