Implement .cfi_remember_state and .cfi_restore_state.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2010-12-28 18:36:23 +00:00
parent 19f14dcf6a
commit fe024d0a62
6 changed files with 197 additions and 58 deletions

View File

@ -179,8 +179,8 @@ bool MCStreamer::EmitCFIDefCfaOffset(int64_t Offset) {
EmitLabel(Label);
MachineLocation Dest(MachineLocation::VirtualFP);
MachineLocation Source(MachineLocation::VirtualFP, -Offset);
MachineMove Move(Label, Dest, Source);
CurFrame->Moves.push_back(Move);
MCCFIInstruction Instruction(Label, Dest, Source);
CurFrame->Instructions.push_back(Instruction);
return false;
}
@ -211,6 +211,27 @@ bool MCStreamer::EmitCFILsda(const MCSymbol *Sym, unsigned Encoding) {
return false;
}
bool MCStreamer::EmitCFIRememberState() {
EnsureValidFrame();
MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
MCSymbol *Label = getContext().CreateTempSymbol();
EmitLabel(Label);
MCCFIInstruction Instruction(MCCFIInstruction::Remember, Label);
CurFrame->Instructions.push_back(Instruction);
return false;
}
bool MCStreamer::EmitCFIRestoreState() {
// FIXME: Error if there is no matching cfi_remember_state.
EnsureValidFrame();
MCDwarfFrameInfo *CurFrame = getCurrentFrameInfo();
MCSymbol *Label = getContext().CreateTempSymbol();
EmitLabel(Label);
MCCFIInstruction Instruction(MCCFIInstruction::Restore, Label);
CurFrame->Instructions.push_back(Instruction);
return false;
}
/// EmitRawText - If this file is backed by an assembly streamer, this dumps
/// the specified string in the output .s file. This capability is
/// indicated by the hasRawTextSupport() predicate.