[llvm-branch-commits] [llvm-branch] r353220 - Merging rr353218:
Reid Kleckner via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Feb 5 13:25:24 PST 2019
Author: rnk
Date: Tue Feb 5 13:25:23 2019
New Revision: 353220
URL: http://llvm.org/viewvc/llvm-project?rev=353220&view=rev
Log:
Merging rr353218:
------------------------------------------------------------------------
r353218 | rnk | 2019-02-05 13:14:09 -0800 (Tue, 05 Feb 2019) | 19 lines
[MC] Don't error on numberless .file directives on MachO
Summary:
Before r349976, MC ignored such directives when producing an object file
and asserted when re-producing textual assembly output. I turned this
assertion into a hard error in both cases in r349976, but this makes it
unnecessarily difficult to write a single assembly file that supports
both MachO and other object formats that support .file. A user reported
this as PR40578, and we decided to go back to ignoring the directive.
Fixes PR40578
Reviewers: mstorsjo
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57772
------------------------------------------------------------------------
Removed:
llvm/branches/release_80/test/MC/MachO/file-single.s
Modified:
llvm/branches/release_80/ (props changed)
llvm/branches/release_80/lib/MC/MCParser/AsmParser.cpp
llvm/branches/release_80/test/MC/MachO/file.s
Propchange: llvm/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Feb 5 13:25:23 2019
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,351325,351344-351345,351349,351351,351370,351381,351421,351426,351436,351475,351485,351753-351754,351910,351930,351932,352034,352204,352246,352374,352555,352770,352889,352945,353082
+/llvm/trunk:155241,351325,351344-351345,351349,351351,351370,351381,351421,351426,351436,351475,351485,351753-351754,351910,351930,351932,352034,352204,352246,352374,352555,352770,352889,352945,353082,353218
Modified: llvm/branches/release_80/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/lib/MC/MCParser/AsmParser.cpp?rev=353220&r1=353219&r2=353220&view=diff
==============================================================================
--- llvm/branches/release_80/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/branches/release_80/lib/MC/MCParser/AsmParser.cpp Tue Feb 5 13:25:23 2019
@@ -3364,10 +3364,11 @@ bool AsmParser::parseDirectiveFile(SMLoc
}
if (FileNumber == -1) {
- if (!getContext().getAsmInfo()->hasSingleParameterDotFile())
- return Error(DirectiveLoc,
- "target does not support '.file' without a number");
- getStreamer().EmitFileDirective(Filename);
+ // Ignore the directive if there is no number and the target doesn't support
+ // numberless .file directives. This allows some portability of assembler
+ // between different object file formats.
+ if (getContext().getAsmInfo()->hasSingleParameterDotFile())
+ 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.
Removed: llvm/branches/release_80/test/MC/MachO/file-single.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/MC/MachO/file-single.s?rev=353219&view=auto
==============================================================================
--- llvm/branches/release_80/test/MC/MachO/file-single.s (original)
+++ llvm/branches/release_80/test/MC/MachO/file-single.s (removed)
@@ -1,8 +0,0 @@
-// RUN: not llvm-mc -triple i386-apple-darwin9 %s -o /dev/null 2>&1 | FileCheck %s
-
-// Previously this crashed MC.
-
-// CHECK: error: target does not support '.file' without a number
-
- .file "dir/foo"
- nop
Modified: llvm/branches/release_80/test/MC/MachO/file.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/test/MC/MachO/file.s?rev=353220&r1=353219&r2=353220&view=diff
==============================================================================
--- llvm/branches/release_80/test/MC/MachO/file.s (original)
+++ llvm/branches/release_80/test/MC/MachO/file.s Tue Feb 5 13:25:23 2019
@@ -1,5 +1,8 @@
// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | llvm-readobj -s -section-data | FileCheck %s
+// This number-less file directive is ignored on MachO.
+ .file "bar/baz.s"
+
.file 1 "dir/foo"
nop
More information about the llvm-branch-commits
mailing list