[MC] Error on a .zerofill directive in a non-virtual section
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>
Mon, 2 Jul 2018 17:29:43 +0000 (17:29 +0000)
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>
Mon, 2 Jul 2018 17:29:43 +0000 (17:29 +0000)
commit4d5b1073ba87f6709112d0d9b5270ee51d3abd54
tree7092adab58fd58dc72a6580d86337d58dd13a92f
parentd4f77a523bb99d3ac7132dfb5783b85835312cce
[MC] Error on a .zerofill directive in a non-virtual section

On darwin, all virtual sections have zerofill type, and having a
.zerofill directive in a non-virtual section is not allowed. Instead of
asserting, show a nicer error.

In order to use the equivalent of .zerofill in a non-virtual section,
the usage of .zero of .space is required.

This patch replaces the assert with an error.

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

llvm-svn: 336127
16 files changed:
llvm/include/llvm/MC/MCELFStreamer.h
llvm/include/llvm/MC/MCStreamer.h
llvm/include/llvm/MC/MCWasmStreamer.h
llvm/include/llvm/MC/MCWinCOFFStreamer.h
llvm/lib/MC/MCAsmStreamer.cpp
llvm/lib/MC/MCELFStreamer.cpp
llvm/lib/MC/MCMachOStreamer.cpp
llvm/lib/MC/MCNullStreamer.cpp
llvm/lib/MC/MCParser/DarwinAsmParser.cpp
llvm/lib/MC/MCWasmStreamer.cpp
llvm/lib/MC/MCWinCOFFStreamer.cpp
llvm/lib/Object/RecordStreamer.cpp
llvm/lib/Object/RecordStreamer.h
llvm/test/MC/MachO/zero-space.s [new file with mode: 0644]
llvm/test/MC/MachO/zerofill-text.s [new file with mode: 0644]
llvm/tools/llvm-mca/llvm-mca.cpp