summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Win64EH.h
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2011-05-19 02:47:23 +0000
committerCharles Davis <cdavis@mines.edu>2011-05-19 02:47:23 +0000
commitfa89218a438c0fcafb40775bdc04dbe95c59fba3 (patch)
treed45cdfa059248e99da848e0b54b580078341b1a4 /include/llvm/Support/Win64EH.h
parentcf227d5ad963d1b4049ef492a5970e6a6c11e8f3 (diff)
downloadllvm-fa89218a438c0fcafb40775bdc04dbe95c59fba3.tar.gz
llvm-fa89218a438c0fcafb40775bdc04dbe95c59fba3.tar.bz2
llvm-fa89218a438c0fcafb40775bdc04dbe95c59fba3.tar.xz
Fix build issues with headers, which I discovered by actually using them.
Also, convert all the inline functions on UnwindInfo into methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131622 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Win64EH.h')
-rw-r--r--include/llvm/Support/Win64EH.h48
1 files changed, 25 insertions, 23 deletions
diff --git a/include/llvm/Support/Win64EH.h b/include/llvm/Support/Win64EH.h
index f989364e06..17d416fe0e 100644
--- a/include/llvm/Support/Win64EH.h
+++ b/include/llvm/Support/Win64EH.h
@@ -40,7 +40,7 @@ union UnwindCode {
uint8_t codeOffset;
uint8_t unwindOp:4,
opInfo:4;
- };
+ } u;
uint16_t frameOffset;
};
@@ -56,6 +56,13 @@ enum {
UNW_ChainInfo = 0x04
};
+/// RuntimeFunction - An entry in the table of functions with unwind info.
+struct RuntimeFunction {
+ uint64_t startAddress;
+ uint64_t endAddress;
+ uint64_t unwindInfoOffset;
+};
+
/// UnwindInfo - An entry in the exception table.
struct UnwindInfo {
uint8_t version:3,
@@ -65,30 +72,25 @@ struct UnwindInfo {
uint8_t frameRegister:4,
frameOffset:4;
UnwindCode unwindCodes[1];
+
+ void *getLanguageSpecificData() {
+ return reinterpret_cast<void *>(&unwindCodes[(numCodes+1) & ~1]);
+ }
+ uint64_t getLanguageSpecificHandlerOffset() {
+ return *reinterpret_cast<uint64_t *>(getLanguageSpecificData());
+ }
+ void setLanguageSpecificHandlerOffset(uint64_t offset) {
+ *reinterpret_cast<uint64_t *>(getLanguageSpecificData()) = offset;
+ }
+ RuntimeFunction *getChainedFunctionEntry() {
+ return reinterpret_cast<RuntimeFunction *>(getLanguageSpecificData());
+ }
+ void *getExceptionData() {
+ return reinterpret_cast<void *>(reinterpret_cast<uint64_t *>(
+ getLanguageSpecificData())+1);
+ }
};
-inline UnwindCode &getUnwindCodeEntry(UnwindInfo &info, uint32_t index) {
- return info.unwindCodes[index];
-}
-inline void *getLanguageSpecificData(UnwindInfo &info) {
- return reinterpret_cast<void *>(&getUnwindCodeEntry(info,info.numCodes+1)&~1);
-}
-inline uint64_t getLanguageSpecificHandlerOffset(UnwindInfo &info) {
- return *reinterpret_cast<uint64_t *>(getLangaugeSpecificData(info));
-}
-inline void setLanguageSpecificHandlerOffset(UnwindInfo &info, uint64_t offset){
- *reinterpret_cast<uint64_t *>(getLanguageSpecificData(info)) = offset;
-}
-inline uint64_t getChainedFunctionEntryOffset(UnwindInfo &info) {
- return *reinterpret_cast<uint64_t *>(getLanguageSpecificData(info));
-}
-inline void setChainedFunctionEntryOffset(UnwindInfo &info, uint64_t offset) {
- *reinterpret_cast<uint64_t *>(getLanguageSpecificData(info)) = offset;
-}
-inline void *getExceptionData(UnwindInfo &info) {
- return reinterpret_cast<void *>(reinterpret_cast<uint64_t *>(
- getLanguageSpecificData(info))+1);
-}
} // End of namespace Win64EH
} // End of namespace llvm