Start adding basic support for emitting the call frame instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122590 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 922a40c..048e886 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -157,7 +157,7 @@
report_fatal_error("Starting a frame before finishing the previous one!");
return true;
}
- MCDwarfFrameInfo Frame = {0, 0, 0, 0, 0, 0};
+ MCDwarfFrameInfo Frame;
Frame.Begin = getContext().CreateTempSymbol();
EmitLabel(Frame.Begin);
FrameInfos.push_back(Frame);
@@ -174,6 +174,13 @@
bool MCStreamer::EmitCFIDefCfaOffset(int64_t Offset) {
EnsureValidFrame();
+ MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
+ MCSymbol *Label = getContext().CreateTempSymbol();
+ EmitLabel(Label);
+ MachineLocation Dest(MachineLocation::VirtualFP);
+ MachineLocation Source(MachineLocation::VirtualFP, -Offset);
+ MachineMove Move(Label, Dest, Source);
+ CurFrame->Moves.push_back(Move);
return false;
}