summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-08-28 22:29:12 +0000
committerReid Kleckner <rnk@google.com>2018-08-28 22:29:12 +0000
commitc8074aa654da982e1169e889da08bc1d93536754 (patch)
treec7a4139b7b2bff3b07577a9bcb714f1cf00d5e0b /llvm/lib/MC/MCObjectStreamer.cpp
parentf04833f9eed2dc6fbac10a00b96aba24ce557de9 (diff)
downloadbcm5719-llvm-c8074aa654da982e1169e889da08bc1d93536754.tar.gz
bcm5719-llvm-c8074aa654da982e1169e889da08bc1d93536754.zip
[codeview] Emit labels for .cv_loc immediately
Previously we followed the DWARF implementation, which waits until the next instruction or data to emit the label to use in the .debug_loc section. We might want to consider re-evaluating that design choice as well, since it means the .loc skips alignment padding, for better or worse. This was the most minimal fix I could come up with, but we should be able to do a lot of cleanups now that we don't need to save a pending CV location on the CodeViewContext. I plan to do those next, but this immediately fixes an assertion for some of our users. llvm-svn: 340878
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index 102aa4d4513..9a55ac0a84a 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -446,12 +446,12 @@ void MCObjectStreamer::EmitCVLocDirective(unsigned FunctionId, unsigned FileNo,
unsigned Line, unsigned Column,
bool PrologueEnd, bool IsStmt,
StringRef FileName, SMLoc Loc) {
- // In case we see two .cv_loc directives in a row, make sure the
- // first one gets a line entry.
- MCCVLineEntry::Make(this);
-
+ // Unlike dwarf locations, we don't save the MCCVLineEntry until the next
+ // instruction. We create the label exactly where the directive appears in the
+ // assembly.
this->MCStreamer::EmitCVLocDirective(FunctionId, FileNo, Line, Column,
PrologueEnd, IsStmt, FileName, Loc);
+ MCCVLineEntry::Make(this);
}
void MCObjectStreamer::EmitCVLinetableDirective(unsigned FunctionId,
OpenPOWER on IntegriCloud