summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2015-11-17 10:00:43 +0000
committerOliver Stannard <oliver.stannard@arm.com>2015-11-17 10:00:43 +0000
commit9be59af3abe0b3bbee54e46720a75c96723da6cb (patch)
treed7b87d3a7144c56e73294288efcbd24109e3426e /llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
parent07b43d39a8ef5be442210c5ca21c780c19db0683 (diff)
downloadbcm5719-llvm-9be59af3abe0b3bbee54e46720a75c96723da6cb.tar.gz
bcm5719-llvm-9be59af3abe0b3bbee54e46720a75c96723da6cb.zip
[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 llvm-svn: 253328
Diffstat (limited to 'llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
index 9d7289658f0..b54a0e1b86b 100644
--- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
+++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp
@@ -241,12 +241,12 @@ bool PPCMachObjectWriter::recordScatteredRelocation(
if (FixupOffset > 0xffffff) {
char Buffer[32];
format("0x%x", FixupOffset).print(Buffer, sizeof(Buffer));
- Asm.getContext().reportFatalError(Fixup.getLoc(),
+ Asm.getContext().reportError(Fixup.getLoc(),
Twine("Section too large, can't encode "
"r_address (") +
Buffer + ") into 24 bits of scattered "
"relocation entry.");
- llvm_unreachable("fatal error returned?!");
+ return false;
}
// Is this supposed to follow MCTarget/PPCAsmBackend.cpp:adjustFixupValue()?
OpenPOWER on IntegriCloud