diff options
author | Reid Kleckner <rnk@google.com> | 2018-04-25 23:34:15 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-04-25 23:34:15 +0000 |
commit | 2c6430fe3c2005a60680b72a52bfb4e81ca841ee (patch) | |
tree | 28e62f54a215254efc9790922a5cfed6861e7890 /llvm/lib/MC/MCObjectStreamer.cpp | |
parent | 947647d0c1fd9557f2dd8ddda3a15622da2c7f77 (diff) | |
download | bcm5719-llvm-2c6430fe3c2005a60680b72a52bfb4e81ca841ee.tar.gz bcm5719-llvm-2c6430fe3c2005a60680b72a52bfb4e81ca841ee.zip |
[codeview] Ignore .cv_loc directives at the end of a function
If no data or instructions are emitted after a location directive, we
should clear the cv_loc when we change sections, or it will be emitted
at the beginning of the next section. This violates our invariant that
all .cv_loc directives belong to the same section. Add clearer
assertions for this.
llvm-svn: 330884
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCObjectStreamer.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index 0a684588110..316a3be8d89 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -247,6 +247,7 @@ bool MCObjectStreamer::changeSectionImpl(MCSection *Section, const MCExpr *Subsection) { assert(Section && "Cannot switch to a null section!"); flushPendingLabels(nullptr); + getContext().clearCVLocSeen(); getContext().clearDwarfLocSeen(); bool Created = getAssembler().registerSection(*Section); |