//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_SUPPORT_WINARMEH_H
-#define LLVM_SUPPORT_WINARMEH_H
+#ifndef LLVM_SUPPORT_ARMWINEH_H
+#define LLVM_SUPPORT_ARMWINEH_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/Endian.h"
/// + r11 must NOT be included in the set of registers described by Reg
/// - IF Ret is 0:
/// + L flag must be set
+
+// NOTE: RuntimeFunction is meant to be a simple class that provides raw access
+// to all fields in the structure. The accessor methods reflect the names of
+// the bitfields that they correspond to. Although some obvious simplifications
+// are possible via merging of methods, it would prevent the use of this class
+// to fully inspect the contents of the data structure which is particularly
+// useful for scenarios such as llvm-readobj to aid in testing.
+
class RuntimeFunction {
public:
const support::ulittle32_t BeginAddress;
}
/// StackAdjustment - calculated stack adjustment in words. The stack
/// adjustment should be determined via this function to account for the special
-/// handling the special encoding when the value is ≥ 0x3f4.
+/// handling the special encoding when the value is >= 0x3f4.
inline uint16_t StackAdjustment(const RuntimeFunction &RF) {
uint16_t Adjustment = RF.StackAdjust();
if (Adjustment >= 0x3f4)
ArrayRef<support::ulittle32_t> EpilogueScopes() const {
assert(E() == 0 && "epilogue scopes are only present when the E bit is 0");
size_t Offset = HeaderWords(*this);
- return ArrayRef<support::ulittle32_t>(&Data[Offset], EpilogueCount());
+ return makeArrayRef(&Data[Offset], EpilogueCount());
}
ArrayRef<support::ulittle8_t> UnwindByteCode() const {
+ (E() ? 0 : EpilogueCount());
const support::ulittle8_t *ByteCode =
reinterpret_cast<const support::ulittle8_t *>(&Data[Offset]);
- return ArrayRef<support::ulittle8_t>(ByteCode,
- CodeWords() * sizeof(uint32_t));
+ return makeArrayRef(ByteCode, CodeWords() * sizeof(uint32_t));
}
uint32_t ExceptionHandlerRVA() const {