diff options
author | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2020-11-11 14:27:01 +0000 |
---|---|---|
committer | Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> | 2020-11-11 17:00:07 +0000 |
commit | fb9942f87628101e1d72da1942416189b8f43825 (patch) | |
tree | da99ef80897c3201243f2f98ac7bc4205694b5db /llvm/lib/MC/MCStreamer.cpp | |
parent | 3df3b62018c0015b0786b124827c276e8ee57117 (diff) | |
download | llvm-fb9942f87628101e1d72da1942416189b8f43825.zip llvm-fb9942f87628101e1d72da1942416189b8f43825.tar.gz llvm-fb9942f87628101e1d72da1942416189b8f43825.tar.bz2 |
[AsmParser] Add source location to all errors related to .cfi directives
I was trying to add .cfi_ annotations to assembly code in the FreeBSD
kernel and changed a macro that then resulted in incorrectly nested
directives. However, clang's diagnostics said the error was happening at
<unknown>:0. This addresses one of the TODOs added in D51695.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D89787
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCStreamer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp index 46aa0b8..e4216c4 100644 --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -273,9 +273,9 @@ bool MCStreamer::hasUnfinishedDwarfFrameInfo() { MCDwarfFrameInfo *MCStreamer::getCurrentDwarfFrameInfo() { if (!hasUnfinishedDwarfFrameInfo()) { - getContext().reportError(SMLoc(), "this directive must appear between " - ".cfi_startproc and .cfi_endproc " - "directives"); + getContext().reportError(getStartTokLoc(), + "this directive must appear between " + ".cfi_startproc and .cfi_endproc directives"); return nullptr; } return &DwarfFrameInfos.back(); @@ -967,10 +967,10 @@ void MCStreamer::emitRawText(const Twine &T) { void MCStreamer::EmitWindowsUnwindTables() { } -void MCStreamer::Finish() { +void MCStreamer::Finish(SMLoc EndLoc) { if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) || (!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) { - getContext().reportError(SMLoc(), "Unfinished frame!"); + getContext().reportError(EndLoc, "Unfinished frame!"); return; } |