summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-11-24 03:10:54 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-11-24 03:10:54 +0000
commit7f74d2c2c197eec76ae2b41fed9c227c0dcc04cb (patch)
treec1be80df9ffb618cbbe5ff5dc7b3b56d3606dcb3 /include
parent529a01df02ad221e8e55097a8ee36b85234eb078 (diff)
downloadllvm-7f74d2c2c197eec76ae2b41fed9c227c0dcc04cb.tar.gz
llvm-7f74d2c2c197eec76ae2b41fed9c227c0dcc04cb.tar.bz2
llvm-7f74d2c2c197eec76ae2b41fed9c227c0dcc04cb.tar.xz
Give each MCCFIInstruction its own opcode.
This untangles the switch cases of the old Move and RelMove opcodes a bit and makes it clear how to add new instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCDwarf.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/include/llvm/MC/MCDwarf.h b/include/llvm/MC/MCDwarf.h
index 77b5f1c8a3..34cc8e77f9 100644
--- a/include/llvm/MC/MCDwarf.h
+++ b/include/llvm/MC/MCDwarf.h
@@ -266,8 +266,9 @@ namespace llvm {
class MCCFIInstruction {
public:
- enum OpType { SameValue, RememberState, RestoreState, Move, RelMove, Escape,
- Restore, Undefined };
+ enum OpType { OpSameValue, OpRememberState, OpRestoreState, OpOffset,
+ OpDefCfaRegister, OpDefCfaOffset, OpDefCfa, OpRelOffset,
+ OpAdjustCfaOffset, OpEscape, OpRestore, OpUndefined };
private:
OpType Operation;
MCSymbol *Label;
@@ -283,11 +284,10 @@ namespace llvm {
public:
static MCCFIInstruction
- createCFIOffset(MCSymbol *L, unsigned Register, int Offset) {
+ createOffset(MCSymbol *L, unsigned Register, int Offset) {
MachineLocation Dest(Register, Offset);
MachineLocation Source(Register, Offset);
-
- MCCFIInstruction Ret(Move, L, Dest, Source, "");
+ MCCFIInstruction Ret(OpOffset, L, Dest, Source, "");
return Ret;
}
@@ -295,14 +295,14 @@ namespace llvm {
createDefCfaRegister(MCSymbol *L, unsigned Register) {
MachineLocation Dest(Register);
MachineLocation Source(MachineLocation::VirtualFP);
- MCCFIInstruction Ret(Move, L, Dest, Source, "");
+ MCCFIInstruction Ret(OpDefCfaRegister, L, Dest, Source, "");
return Ret;
}
static MCCFIInstruction createDefCfaOffset(MCSymbol *L, int Offset) {
MachineLocation Dest(MachineLocation::VirtualFP);
MachineLocation Source(MachineLocation::VirtualFP, -Offset);
- MCCFIInstruction Ret(Move, L, Dest, Source, "");
+ MCCFIInstruction Ret(OpDefCfaOffset, L, Dest, Source, "");
return Ret;
}
@@ -310,40 +310,40 @@ namespace llvm {
createDefCfa(MCSymbol *L, unsigned Register, int Offset) {
MachineLocation Dest(MachineLocation::VirtualFP);
MachineLocation Source(Register, -Offset);
- MCCFIInstruction Ret(Move, L, Dest, Source, "");
+ MCCFIInstruction Ret(OpDefCfa, L, Dest, Source, "");
return Ret;
}
static MCCFIInstruction createUndefined(MCSymbol *L, unsigned Register) {
MachineLocation Dummy;
MachineLocation Dest(Register);
- MCCFIInstruction Ret(Undefined, L, Dest, Dummy, "");
+ MCCFIInstruction Ret(OpUndefined, L, Dest, Dummy, "");
return Ret;
}
static MCCFIInstruction createRestore(MCSymbol *L, unsigned Register) {
MachineLocation Dummy;
MachineLocation Dest(Register);
- MCCFIInstruction Ret(Restore, L, Dest, Dummy, "");
+ MCCFIInstruction Ret(OpRestore, L, Dest, Dummy, "");
return Ret;
}
static MCCFIInstruction createSameValue(MCSymbol *L, unsigned Register) {
MachineLocation Dummy;
MachineLocation Dest(Register);
- MCCFIInstruction Ret(SameValue, L, Dest, Dummy, "");
+ MCCFIInstruction Ret(OpSameValue, L, Dest, Dummy, "");
return Ret;
}
static MCCFIInstruction createRestoreState(MCSymbol *L) {
MachineLocation Dummy;
- MCCFIInstruction Ret(RestoreState, L, Dummy, Dummy, "");
+ MCCFIInstruction Ret(OpRestoreState, L, Dummy, Dummy, "");
return Ret;
}
static MCCFIInstruction createRememberState(MCSymbol *L) {
MachineLocation Dummy;
- MCCFIInstruction Ret(RememberState, L, Dummy, Dummy, "");
+ MCCFIInstruction Ret(OpRememberState, L, Dummy, Dummy, "");
return Ret;
}
@@ -351,7 +351,7 @@ namespace llvm {
createRelOffset(MCSymbol *L, unsigned Register, int Offset) {
MachineLocation Dest(Register, Offset);
MachineLocation Source(Register, Offset);
- MCCFIInstruction Ret(RelMove, L, Dest, Source, "");
+ MCCFIInstruction Ret(OpRelOffset, L, Dest, Source, "");
return Ret;
}
@@ -359,13 +359,13 @@ namespace llvm {
createAdjustCfaOffset(MCSymbol *L, int Adjustment) {
MachineLocation Dest(MachineLocation::VirtualFP);
MachineLocation Source(MachineLocation::VirtualFP, Adjustment);
- MCCFIInstruction Ret(RelMove, L, Dest, Source, "");
+ MCCFIInstruction Ret(OpAdjustCfaOffset, L, Dest, Source, "");
return Ret;
}
static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals) {
MachineLocation Dummy;
- MCCFIInstruction Ret(Escape, L, Dummy, Dummy, Vals);
+ MCCFIInstruction Ret(OpEscape, L, Dummy, Dummy, Vals);
return Ret;
}