[PATCH] D27411: [Assembler] Better error messages for .org directive

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 06:08:13 PST 2016


olista01 created this revision.
olista01 added reviewers: rengolin, t.p.northover.
olista01 added a subscriber: llvm-commits.
olista01 set the repository for this revision to rL LLVM.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D27411

Files:
  include/llvm/MC/MCFragment.h
  include/llvm/MC/MCObjectStreamer.h
  include/llvm/MC/MCStreamer.h
  lib/MC/MCAsmStreamer.cpp
  lib/MC/MCAssembler.cpp
  lib/MC/MCObjectStreamer.cpp
  lib/MC/MCParser/AsmParser.cpp
  lib/MC/MCStreamer.cpp
  test/MC/AArch64/error-location-during-layout.s
  test/MC/AArch64/error-location-post-layout.s
  test/MC/AArch64/error-location.s
  test/MC/ARM/error-location-post-layout.s
  test/MC/ARM/error-location.s
  test/MC/AsmParser/dot-symbol-assignment-backwards.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27411.80261.patch
Type: text/x-patch
Size: 12088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161205/58d47f61/attachment-0001.bin>


More information about the llvm-commits mailing list