summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2014-04-22 17:27:29 +0000
committerKevin Enderby <enderby@apple.com>2014-04-22 17:27:29 +0000
commit96918bc40625f47f99316499d04ebab1f90b09c0 (patch)
tree8827600bbd5ed0d4756a6c4ca8de84e4d47429fb /llvm/lib/MC/MCStreamer.cpp
parent5f1a0010718216f8ffe7ac93e752e6af129335ef (diff)
downloadbcm5719-llvm-96918bc40625f47f99316499d04ebab1f90b09c0.tar.gz
bcm5719-llvm-96918bc40625f47f99316499d04ebab1f90b09c0.zip
Fix the assembler to print a better relocatable expression error
diagnostic that includes location information. Currently if one has this assembly: .quad (0x1234 + (4 * SOME_VALUE)) where SOME_VALUE is undefined ones gets the less than useful error message with no location information: % clang -c x.s clang -cc1as: fatal error: error in backend: expected relocatable expression With this fix one now gets a more useful error message with location information: % clang -c x.s x.s:5:8: error: expected relocatable expression .quad (0x1234 + (4 * SOME_VALUE)) ^ To do this I plumbed the SMLoc through the MCObjectStreamer EmitValue() and EmitValueImpl() interfaces so it could be used when creating the MCFixup. rdar://12391022 llvm-svn: 206906
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index f85f7d3210c..50b6576766c 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -147,8 +147,9 @@ void MCStreamer::EmitAbsValue(const MCExpr *Value, unsigned Size) {
}
-void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size) {
- EmitValueImpl(Value, Size);
+void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size,
+ const SMLoc &Loc) {
+ EmitValueImpl(Value, Size, Loc);
}
void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size) {
OpenPOWER on IntegriCloud