summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-05-13 01:16:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-05-13 01:16:13 +0000
commit4a971705bc6030dc2e4338b3cd5cffa2e0f88b7b (patch)
tree7fc9f941c0c4980917c7889ceba9daae147594cf /include
parentaa4f36407f51d827af834d05821c7466db32f147 (diff)
downloadllvm-4a971705bc6030dc2e4338b3cd5cffa2e0f88b7b.tar.gz
llvm-4a971705bc6030dc2e4338b3cd5cffa2e0f88b7b.tar.bz2
llvm-4a971705bc6030dc2e4338b3cd5cffa2e0f88b7b.tar.xz
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h7
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h16
-rw-r--r--include/llvm/MC/MCAsmInfo.h11
-rw-r--r--include/llvm/MC/MachineLocation.h29
-rw-r--r--include/llvm/Support/TargetRegistry.h10
-rw-r--r--include/llvm/Target/TargetMachine.h1
6 files changed, 24 insertions, 50 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index c2fd6ce367..5973255047 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -38,8 +38,8 @@ namespace llvm {
class MachineConstantPoolValue;
class MachineJumpTableInfo;
class MachineModuleInfo;
- class MachineMove;
class MCAsmInfo;
+ class MCCFIInstruction;
class MCContext;
class MCSection;
class MCStreamer;
@@ -417,9 +417,8 @@ namespace llvm {
// Dwarf Lowering Routines
//===------------------------------------------------------------------===//
- /// EmitCFIFrameMove - Emit frame instruction to describe the layout of the
- /// frame.
- void EmitCFIFrameMove(const MachineMove &Move) const;
+ /// \brief Emit frame instruction to describe the layout of the frame.
+ void emitCFIInstruction(const MCCFIInstruction &Inst) const;
//===------------------------------------------------------------------===//
// Inline Asm Support
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index b719757822..95eb1e40dc 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<MachineMove> FrameMoves;
+ /// List of moves done by a function's prolog. Used to construct frame maps
+ /// by debug and exception handling consumers.
+ std::vector<MCCFIInstruction> 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<MachineMove> &getFrameMoves() { return FrameMoves; }
+ const std::vector<MCCFIInstruction> &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
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index d020de3004..72d325f79c 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -17,6 +17,7 @@
#define LLVM_MC_MCASMINFO_H
#include "llvm/MC/MCDirectives.h"
+#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MachineLocation.h"
#include <cassert>
#include <vector>
@@ -332,7 +333,7 @@ namespace llvm {
//===--- Prologue State ----------------------------------------------===//
- std::vector<MachineMove> InitialFrameState;
+ std::vector<MCCFIInstruction> InitialFrameState;
public:
explicit MCAsmInfo();
@@ -567,11 +568,11 @@ namespace llvm {
return DwarfRegNumForCFI;
}
- void addInitialFrameState(MCSymbol *label, const MachineLocation &D,
- const MachineLocation &S) {
- InitialFrameState.push_back(MachineMove(label, D, S));
+ void addInitialFrameState(const MCCFIInstruction &Inst) {
+ InitialFrameState.push_back(Inst);
}
- const std::vector<MachineMove> &getInitialFrameState() const {
+
+ const std::vector<MCCFIInstruction> &getInitialFrameState() const {
return InitialFrameState;
}
};
diff --git a/include/llvm/MC/MachineLocation.h b/include/llvm/MC/MachineLocation.h
index 83c8b72ee4..c4a96606b1 100644
--- a/include/llvm/MC/MachineLocation.h
+++ b/include/llvm/MC/MachineLocation.h
@@ -10,11 +10,6 @@
// frame. Locations will be one of two forms; a register or an address formed
// from a base address plus an offset. Register indirection can be specified by
// explicitly passing an offset to the constructor.
-//
-// The MachineMove class is used to represent abstract move operations in the
-// prolog/epilog of a compiled function. A collection of these objects can be
-// used by a debug consumer to track the location of values when unwinding stack
-// frames.
//===----------------------------------------------------------------------===//
@@ -74,30 +69,6 @@ public:
void dump();
#endif
};
-
-/// MachineMove - This class represents the save or restore of a callee saved
-/// register that exception or debug info needs to know about.
-class MachineMove {
-private:
- /// Label - Symbol for post-instruction address when result of move takes
- /// effect.
- MCSymbol *Label;
-
- // Move to & from location.
- MachineLocation Destination, Source;
-public:
- MachineMove() : Label(0) {}
-
- MachineMove(MCSymbol *label, const MachineLocation &D,
- const MachineLocation &S)
- : Label(label), Destination(D), Source(S) {}
-
- // Accessors
- MCSymbol *getLabel() const { return Label; }
- const MachineLocation &getDestination() const { return Destination; }
- const MachineLocation &getSource() const { return Source; }
-};
-
} // End llvm namespace
#endif
diff --git a/include/llvm/Support/TargetRegistry.h b/include/llvm/Support/TargetRegistry.h
index 5bfb8ad41d..e1f6706618 100644
--- a/include/llvm/Support/TargetRegistry.h
+++ b/include/llvm/Support/TargetRegistry.h
@@ -70,7 +70,8 @@ namespace llvm {
typedef unsigned (*TripleMatchQualityFnTy)(const std::string &TT);
- typedef MCAsmInfo *(*MCAsmInfoCtorFnTy)(StringRef TT);
+ typedef MCAsmInfo *(*MCAsmInfoCtorFnTy)(const MCRegisterInfo &MRI,
+ StringRef TT);
typedef MCCodeGenInfo *(*MCCodeGenInfoCtorFnTy)(StringRef TT,
Reloc::Model RM,
CodeModel::Model CM,
@@ -265,10 +266,11 @@ namespace llvm {
/// feature set; it should always be provided. Generally this should be
/// either the target triple from the module, or the target triple of the
/// host if that does not exist.
- MCAsmInfo *createMCAsmInfo(StringRef Triple) const {
+ MCAsmInfo *createMCAsmInfo(const MCRegisterInfo &MRI,
+ StringRef Triple) const {
if (!MCAsmInfoCtorFn)
return 0;
- return MCAsmInfoCtorFn(Triple);
+ return MCAsmInfoCtorFn(MRI, Triple);
}
/// createMCCodeGenInfo - Create a MCCodeGenInfo implementation.
@@ -803,7 +805,7 @@ namespace llvm {
TargetRegistry::RegisterMCAsmInfo(T, &Allocator);
}
private:
- static MCAsmInfo *Allocator(StringRef TT) {
+ static MCAsmInfo *Allocator(const MCRegisterInfo &MRI, StringRef TT) {
return new MCAsmInfoImpl(TT);
}
diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h
index 37a79fe852..c5e4b278d9 100644
--- a/include/llvm/Target/TargetMachine.h
+++ b/include/llvm/Target/TargetMachine.h
@@ -292,6 +292,7 @@ protected: // Can only create subclasses.
Reloc::Model RM, CodeModel::Model CM,
CodeGenOpt::Level OL);
+ void initAsmInfo();
public:
/// \brief Register analysis passes for this target with a pass manager.
///