[Assembler] Make fatal assembler errors non-fatal
authorOliver Stannard <oliver.stannard@arm.com>
Tue, 17 Nov 2015 10:00:43 +0000 (10:00 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Tue, 17 Nov 2015 10:00:43 +0000 (10:00 +0000)
commit99ab11202f6fd4905def11e75f260d487a589f9c
tree84f7cc89beea88a0e649343b78114004dd889a14
parent43f1dd7a0084daba57a9f791cfad74d0667d2307
[Assembler] Make fatal assembler errors non-fatal

Currently, if the assembler encounters an error after parsing (such as an
out-of-range fixup), it reports this as a fatal error, and so stops after the
first error. However, for most of these there is an obvious way to recover
after emitting the error, such as emitting the fixup with a value of zero. This
means that we can report on all of the errors in a file, not just the first
one. MCContext::reportError records the fact that an error was encountered, so
we won't actually emit an object file with the incorrect contents.

Differential Revision: http://reviews.llvm.org/D14717

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253328 91177308-0d34-0410-b5e6-96231b3b80d8
41 files changed:
include/llvm/MC/MCWinCOFFStreamer.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MCAssembler.cpp
lib/MC/WinCOFFObjectWriter.cpp
lib/MC/WinCOFFStreamer.cpp
lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp
lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp
lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp
lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp
test/MC/AArch64/error-location.s
test/MC/ARM/arm-elf-relocation-diagnostics.s
test/MC/ARM/error-location.s
test/MC/ARM/thumb1-relax-adr-local.s [deleted file]
test/MC/ARM/thumb1-relax-bcc-local.s [deleted file]
test/MC/ARM/thumb1-relax-br-local.s [deleted file]
test/MC/ARM/thumb1-relax-ldrlit-local-behind.s [deleted file]
test/MC/ARM/thumb1-relax-ldrlit-local-misaligned.s [deleted file]
test/MC/ARM/thumb1-relax-ldrlit-local-range.s [deleted file]
test/MC/ARM/thumb1-relax.s [new file with mode: 0644]
test/MC/COFF/bad-expr.s
test/MC/COFF/invalid-def.s
test/MC/COFF/invalid-endef.s
test/MC/COFF/invalid-scl-range.s
test/MC/COFF/invalid-scl.s
test/MC/COFF/invalid-type.s
test/MC/COFF/label-undefined.s
test/MC/COFF/secidx-diagnostic.s
test/MC/ELF/common-error1.s
test/MC/ELF/common-error2.s
test/MC/MachO/AArch64/reloc-errors.s [new file with mode: 0644]
test/MC/MachO/ARM/bad-darwin-ARM-reloc.s
test/MC/MachO/bad-darwin-x86_64-diff-relocs.s
test/MC/MachO/bad-darwin-x86_64-reloc-expr1.s [deleted file]
test/MC/MachO/bad-darwin-x86_64-reloc-expr2.s [deleted file]
test/MC/Mips/micromips-diagnostic-fixup.s
test/MC/Mips/micromips-pc16-fixup.s
test/MC/Mips/mips-diagnostic-fixup.s
test/MC/Mips/mips-pc16-fixup.s