From 2c6430fe3c2005a60680b72a52bfb4e81ca841ee Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 25 Apr 2018 23:34:15 +0000 Subject: [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 --- llvm/lib/MC/MCObjectStreamer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/MC/MCObjectStreamer.cpp') 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); -- cgit v1.2.3