summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-08-28 23:25:59 +0000
committerReid Kleckner <rnk@google.com>2018-08-28 23:25:59 +0000
commit689f7733173c4a7757f10bc7442905c18274f288 (patch)
tree7525f8a1cd9fea7b4f9e41b69ce027e4c4535240 /llvm/lib/MC/MCStreamer.cpp
parent35818e27894db154a9c884cb4d203dc84684ef59 (diff)
downloadbcm5719-llvm-689f7733173c4a7757f10bc7442905c18274f288.tar.gz
bcm5719-llvm-689f7733173c4a7757f10bc7442905c18274f288.zip
[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
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCStreamer.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index 21a9c3604cf..372bb2c6731 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -270,22 +270,28 @@ bool MCStreamer::EmitCVInlineSiteIdDirective(unsigned FunctionId,
void MCStreamer::EmitCVLocDirective(unsigned FunctionId, unsigned FileNo,
unsigned Line, unsigned Column,
bool PrologueEnd, bool IsStmt,
- StringRef FileName, SMLoc Loc) {
+ StringRef FileName, SMLoc Loc) {}
+
+bool MCStreamer::checkCVLocSection(unsigned FunctionId, unsigned FileNo,
+ SMLoc Loc) {
CodeViewContext &CVC = getContext().getCVContext();
MCCVFunctionInfo *FI = CVC.getCVFunctionInfo(FunctionId);
- if (!FI)
- return getContext().reportError(
+ if (!FI) {
+ getContext().reportError(
Loc, "function id not introduced by .cv_func_id or .cv_inline_site_id");
+ return false;
+ }
// Track the section
if (FI->Section == nullptr)
FI->Section = getCurrentSectionOnly();
- else if (FI->Section != getCurrentSectionOnly())
- return getContext().reportError(
+ else if (FI->Section != getCurrentSectionOnly()) {
+ getContext().reportError(
Loc,
"all .cv_loc directives for a function must be in the same section");
-
- CVC.setCurrentCVLoc(FunctionId, FileNo, Line, Column, PrologueEnd, IsStmt);
+ return false;
+ }
+ return true;
}
void MCStreamer::EmitCVLinetableDirective(unsigned FunctionId,
OpenPOWER on IntegriCloud