summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorOliver Stannard <oliver.stannard@arm.com>2016-12-14 10:43:58 +0000
committerOliver Stannard <oliver.stannard@arm.com>2016-12-14 10:43:58 +0000
commit268f42f1cee049b37fe4f601c34d740384dbe88a (patch)
treeeb9b3efc8beff9826b857e7b2531d9b314fd7ded /llvm/lib/MC/MCStreamer.cpp
parent532bc984f58ed66e7fe7b9c6493d6ad808a89772 (diff)
downloadbcm5719-llvm-268f42f1cee049b37fe4f601c34d740384dbe88a.tar.gz
bcm5719-llvm-268f42f1cee049b37fe4f601c34d740384dbe88a.zip
[Assembler] Better error messages for .org directive
Currently, the error messages we emit for the .org directive when the expression is not absolute or is out of range do not include the line number of the directive, so it can be hard to track down the problem if a file contains many .org directives. This patch stores the source location in the MCOrgFragment, so that it can be used for diagnostics emitted during layout. Since layout is an iterative process, and the errors are detected during each iteration, it would have been possible for errors to be reported multiple times. To prevent this, I've made the assembler bail out after each iteration if any errors have been reported. This will still allow multiple unrelated errors to be reported in the common case where they are all detected in the first round of layout. Differential Revision: https://reviews.llvm.org/D27411 llvm-svn: 289643
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index ebbf8116fa3..5cfa3ae80ce 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -820,7 +820,8 @@ void MCStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
unsigned MaxBytesToEmit) {}
void MCStreamer::EmitCodeAlignment(unsigned ByteAlignment,
unsigned MaxBytesToEmit) {}
-void MCStreamer::emitValueToOffset(const MCExpr *Offset, unsigned char Value) {}
+void MCStreamer::emitValueToOffset(const MCExpr *Offset, unsigned char Value,
+ SMLoc Loc) {}
void MCStreamer::EmitBundleAlignMode(unsigned AlignPow2) {}
void MCStreamer::EmitBundleLock(bool AlignToEnd) {}
void MCStreamer::FinishImpl() {}
OpenPOWER on IntegriCloud