From 689f7733173c4a7757f10bc7442905c18274f288 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 28 Aug 2018 23:25:59 +0000 Subject: [codeview] Clean up machinery for deferring .cv_loc emission Now that we create the label at the point of the directive, we don't need to set the "current CV location", and then later when we emit the next instruction, create a label for it and emit it. DWARF still defers the labels used in .debug_loc until the next instruction or value, for reasons unknown. llvm-svn: 340883 --- llvm/lib/MC/MCAsmStreamer.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'llvm/lib/MC/MCAsmStreamer.cpp') diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index ae02f50bf8b..c4744ac5d51 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -1298,20 +1298,17 @@ void MCAsmStreamer::EmitCVLocDirective(unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc) { + // Validate the directive. + if (!checkCVLocSection(FunctionId, FileNo, Loc)) + return; + OS << "\t.cv_loc\t" << FunctionId << " " << FileNo << " " << Line << " " << Column; if (PrologueEnd) OS << " prologue_end"; - unsigned OldIsStmt = getContext().getCVContext().getCurrentCVLoc().isStmt(); - if (IsStmt != OldIsStmt) { - OS << " is_stmt "; - - if (IsStmt) - OS << "1"; - else - OS << "0"; - } + if (IsStmt) + OS << " is_stmt 1"; if (IsVerboseAsm) { OS.PadToColumn(MAI->getCommentColumn()); @@ -1319,8 +1316,6 @@ void MCAsmStreamer::EmitCVLocDirective(unsigned FunctionId, unsigned FileNo, << Column; } EmitEOL(); - this->MCStreamer::EmitCVLocDirective(FunctionId, FileNo, Line, Column, - PrologueEnd, IsStmt, FileName, Loc); } void MCAsmStreamer::EmitCVLinetableDirective(unsigned FunctionId, -- cgit v1.2.3