From d84ccfaf50c7843f31ffc74a8a8e33f779453d6e Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 11 May 2013 02:38:11 +0000 Subject: Change getFrameMoves to return a const reference. To add a frame now there is a dedicated addFrameMove which also takes care of constructing the move itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181657 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineModuleInfo.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/llvm/CodeGen/MachineModuleInfo.h') diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index a3acec8..b719757 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -234,7 +234,12 @@ public: /// getFrameMoves - Returns a reference to a list of moves done in the current /// function's prologue. Used to construct frame maps for debug and exception /// handling comsumers. - std::vector &getFrameMoves() { return FrameMoves; } + const std::vector &getFrameMoves() { return FrameMoves; } + + void addFrameMove(MCSymbol *Label, const MachineLocation &Dst, + const MachineLocation &Src) { + FrameMoves.push_back(MachineMove(Label, Dst, Src)); + } /// getCompactUnwindEncoding - Returns the compact unwind encoding for a /// function if the target supports the encoding. This encoding replaces a -- cgit v1.1 From 4a971705bc6030dc2e4338b3cd5cffa2e0f88b7b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 13 May 2013 01:16:13 +0000 Subject: Remove the MachineMove class. It was just a less powerful and more confusing version of MCCFIInstruction. A side effect is that, since MCCFIInstruction uses dwarf register numbers, calls to getDwarfRegNum are pushed out, which should allow further simplifications. I left the MachineModuleInfo::addFrameMove interface unchanged since this patch was already fairly big. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181680 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineModuleInfo.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include/llvm/CodeGen/MachineModuleInfo.h') diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index b719757..95eb1e4 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -106,9 +106,9 @@ class MachineModuleInfo : public ImmutablePass { /// want. MachineModuleInfoImpl *ObjFileMMI; - /// FrameMoves - List of moves done by a function's prolog. Used to construct - /// frame maps by debug and exception handling consumers. - std::vector FrameMoves; + /// List of moves done by a function's prolog. Used to construct frame maps + /// by debug and exception handling consumers. + std::vector FrameInstructions; /// CompactUnwindEncoding - If the target supports it, this is the compact /// unwind encoding. It replaces a function's CIE and FDE. @@ -231,15 +231,15 @@ public: UsesVAFloatArgument = b; } - /// getFrameMoves - Returns a reference to a list of moves done in the current + /// \brief Returns a reference to a list of cfi instructions in the current /// function's prologue. Used to construct frame maps for debug and exception /// handling comsumers. - const std::vector &getFrameMoves() { return FrameMoves; } + const std::vector &getFrameInstructions() { + return FrameInstructions; + } void addFrameMove(MCSymbol *Label, const MachineLocation &Dst, - const MachineLocation &Src) { - FrameMoves.push_back(MachineMove(Label, Dst, Src)); - } + const MachineLocation &Src); /// getCompactUnwindEncoding - Returns the compact unwind encoding for a /// function if the target supports the encoding. This encoding replaces a -- cgit v1.1 From 6b67ffd68bb2e555b1b512a809f3c82c68f3debe Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 16 May 2013 21:02:15 +0000 Subject: Remove addFrameMove. Now that we have good testing, remove addFrameMove and create cfi instructions directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182052 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/CodeGen/MachineModuleInfo.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/llvm/CodeGen/MachineModuleInfo.h') diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h index 95eb1e4..186017c 100644 --- a/include/llvm/CodeGen/MachineModuleInfo.h +++ b/include/llvm/CodeGen/MachineModuleInfo.h @@ -238,8 +238,9 @@ public: return FrameInstructions; } - void addFrameMove(MCSymbol *Label, const MachineLocation &Dst, - const MachineLocation &Src); + void addFrameInst(const MCCFIInstruction &Inst) { + FrameInstructions.push_back(Inst); + } /// getCompactUnwindEncoding - Returns the compact unwind encoding for a /// function if the target supports the encoding. This encoding replaces a -- cgit v1.1