diff options
author | Paul Robinson <paul.robinson@sony.com> | 2018-03-06 22:37:45 +0000 |
---|---|---|
committer | Paul Robinson <paul.robinson@sony.com> | 2018-03-06 22:37:45 +0000 |
commit | 4428e90efa31df7b288b170330dc7ec941ea72f8 (patch) | |
tree | f22c88ca283c4e5c7e19c2d1c52637d340b4612a /llvm/lib/MC/MCParser/AsmParser.cpp | |
parent | ca38c762e46c22566f09e41712c2ea3ea2e1240a (diff) | |
download | bcm5719-llvm-4428e90efa31df7b288b170330dc7ec941ea72f8.tar.gz bcm5719-llvm-4428e90efa31df7b288b170330dc7ec941ea72f8.zip |
Reapply "[DWARFv5] Emit file 0 to the line table."
Fixes the bug found by asan. Also XFAIL the new test for Darwin,
which is stuck on DWARF v2, and fix up other tests so they stop
failing on Windows.
llvm-svn: 326839
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 54a76732bbe..2df5251097c 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -3258,8 +3258,8 @@ bool AsmParser::parseDirectiveFile(SMLoc DirectiveLoc) { FileNumber = getTok().getIntVal(); Lex(); - if (FileNumber < 1) - return TokError("file number less than one"); + if (FileNumber < 0) + return TokError("negative file number"); } std::string Path = getTok().getString(); @@ -3338,6 +3338,8 @@ bool AsmParser::parseDirectiveFile(SMLoc DirectiveLoc) { // we turn off -g option, directly use the existing debug info instead. if (getContext().getGenDwarfForAssembly()) getContext().setGenDwarfForAssembly(false); + else if (FileNumber == 0) + getStreamer().emitDwarfFile0Directive(Directory, Filename, CKMem, Source); else { Expected<unsigned> FileNumOrErr = getStreamer().tryEmitDwarfFileDirective( FileNumber, Directory, Filename, CKMem, Source); |