[llvm] r261796 - Add capability to push/pop DFI in MCStreamer. NFC
Amaury Sechet via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 14:25:19 PST 2016
Author: deadalnix
Date: Wed Feb 24 16:25:18 2016
New Revision: 261796
URL: http://llvm.org/viewvc/llvm-project?rev=261796&view=rev
Log:
Add capability to push/pop DFI in MCStreamer. NFC
Summary: This is extracted from D17555
Reviewers: davidxl, reames, sanjoy, MatzeB, pete
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17579
Modified:
llvm/trunk/include/llvm/MC/MCStreamer.h
llvm/trunk/lib/MC/MCStreamer.cpp
Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=261796&r1=261795&r2=261796&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Wed Feb 24 16:25:18 2016
@@ -222,6 +222,8 @@ public:
return DwarfFrameInfos;
}
+ bool hasUnfinishedDwarfFrameInfo();
+
unsigned getNumWinFrameInfos() { return WinFrameInfos.size(); }
ArrayRef<WinEH::FrameInfo *> getWinFrameInfos() const {
return WinFrameInfos;
Modified: llvm/trunk/lib/MC/MCStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCStreamer.cpp?rev=261796&r1=261795&r2=261796&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCStreamer.cpp Wed Feb 24 16:25:18 2016
@@ -174,6 +174,11 @@ MCDwarfFrameInfo *MCStreamer::getCurrent
return &DwarfFrameInfos.back();
}
+bool MCStreamer::hasUnfinishedDwarfFrameInfo() {
+ MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
+ return CurFrame && !CurFrame->End;
+}
+
void MCStreamer::EnsureValidDwarfFrame() {
MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
if (!CurFrame || CurFrame->End)
@@ -238,8 +243,7 @@ void MCStreamer::EmitCFISections(bool EH
}
void MCStreamer::EmitCFIStartProc(bool IsSimple) {
- MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
- if (CurFrame && !CurFrame->End)
+ if (hasUnfinishedDwarfFrameInfo())
report_fatal_error("Starting a frame before finishing the previous one!");
MCDwarfFrameInfo Frame;
More information about the llvm-commits
mailing list