Cleaning up static initializers in TimeValue.
[oota-llvm.git] / include / llvm / Support / ARMWinEH.h
index 6289f4f4299033ad99c2811ebd9f7814cfd90a93..4345d376e5b93e6d499aecb04090ba890ae4f2de 100644 (file)
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#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"
@@ -90,6 +90,14 @@ enum class ReturnType {
 ///     + 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;
@@ -185,7 +193,7 @@ inline bool EpilogueFolding(const RuntimeFunction &RF) {
 }
 /// 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)
@@ -342,7 +350,7 @@ struct ExceptionDataRecord {
   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 {
@@ -350,8 +358,7 @@ struct ExceptionDataRecord {
                         + (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 {