summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-07-07 00:54:13 +0000
committerBill Wendling <isanbard@gmail.com>2011-07-07 00:54:13 +0000
commit6a6b8c3e96b9e1ca7092eafd0cfb219cbbfbdfc4 (patch)
treec470be4a79bc008e076adbdb415a5f250f0a99c7 /include
parente727d67c585ae8d4779ddd29490d9009cfc8e845 (diff)
downloadllvm-6a6b8c3e96b9e1ca7092eafd0cfb219cbbfbdfc4.tar.gz
llvm-6a6b8c3e96b9e1ca7092eafd0cfb219cbbfbdfc4.tar.bz2
llvm-6a6b8c3e96b9e1ca7092eafd0cfb219cbbfbdfc4.tar.xz
Add a target hook to encode the compact unwind information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetAsmInfo.h12
-rw-r--r--include/llvm/Target/TargetFrameLowering.h9
2 files changed, 16 insertions, 5 deletions
diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h
index 9beff25bcf..cdd1672be6 100644
--- a/include/llvm/Target/TargetAsmInfo.h
+++ b/include/llvm/Target/TargetAsmInfo.h
@@ -30,8 +30,9 @@ class TargetAsmInfo {
unsigned PointerSize;
bool IsLittleEndian;
TargetFrameLowering::StackDirection StackDir;
- const TargetRegisterInfo *TRI;
std::vector<MachineMove> InitialFrameState;
+ const TargetRegisterInfo *TRI;
+ const TargetFrameLowering *TFI;
const TargetLoweringObjectFile *TLOF;
public:
@@ -83,6 +84,11 @@ public:
return TLOF->isFunctionEHFrameSymbolPrivate();
}
+ int getCompactUnwindEncoding(const std::vector<MCCFIInstruction> &Instrs,
+ int DataAlignmentFactor, bool IsEH) const {
+ return TFI->getCompactUnwindEncoding(Instrs, DataAlignmentFactor, IsEH);
+ }
+
const unsigned *getCalleeSavedRegs(MachineFunction *MF = 0) const {
return TRI->getCalleeSavedRegs(MF);
}
@@ -106,10 +112,6 @@ public:
int getSEHRegNum(unsigned RegNum) const {
return TRI->getSEHRegNum(RegNum);
}
-
- int getCompactUnwindRegNum(unsigned RegNum, bool isEH) const {
- return TRI->getCompactUnwindRegNum(RegNum, isEH);
- }
};
}
diff --git a/include/llvm/Target/TargetFrameLowering.h b/include/llvm/Target/TargetFrameLowering.h
index e104b1663f..70cecbd37f 100644
--- a/include/llvm/Target/TargetFrameLowering.h
+++ b/include/llvm/Target/TargetFrameLowering.h
@@ -14,6 +14,7 @@
#ifndef LLVM_TARGET_TARGETFRAMELOWERING_H
#define LLVM_TARGET_TARGETFRAMELOWERING_H
+#include "llvm/MC/MCDwarf.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include <utility>
@@ -189,6 +190,14 @@ public:
///
virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
}
+
+ /// getCompactUnwindEncoding - Get the compact unwind encoding for the
+ /// function. Return 0 if the compact unwind isn't available.
+ virtual uint32_t getCompactUnwindEncoding(const std::vector<MCCFIInstruction>&,
+ int /*DataAlignmentFactor*/,
+ bool /*IsEH*/) const {
+ return 0;
+ }
};
} // End llvm namespace