[codeview] Ignore .cv_loc directives at the end of a function
authorReid Kleckner <rnk@google.com>
Wed, 25 Apr 2018 23:34:15 +0000 (23:34 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 25 Apr 2018 23:34:15 +0000 (23:34 +0000)
commit2c6430fe3c2005a60680b72a52bfb4e81ca841ee
tree28e62f54a215254efc9790922a5cfed6861e7890
parent947647d0c1fd9557f2dd8ddda3a15622da2c7f77
[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/include/llvm/MC/MCContext.h
llvm/lib/MC/MCCodeView.cpp
llvm/lib/MC/MCContext.cpp
llvm/lib/MC/MCObjectStreamer.cpp
llvm/test/MC/COFF/cv-loc-unreachable.s [new file with mode: 0644]