summaryrefslogtreecommitdiff
path: root/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-02-15 20:48:51 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-02-15 20:48:51 +0000
commit519e1985aef0136fe593e52b5404e2934b077115 (patch)
tree2ed0abe9c0ca3ad3309b537d91c64bc91c8f0176 /lib/MC/MCParser/AsmParser.cpp
parente79719ce607b6130e41e23dbdc90cc6b4e0401e6 (diff)
Notes
Diffstat (limited to 'lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index cf42a6f7075b..a0506715be37 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -3364,10 +3364,11 @@ bool AsmParser::parseDirectiveFile(SMLoc DirectiveLoc) {
}
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.