BumpPtrAllocator: use uintptr_t when aligning addresses to avoid undefined behaviour
[oota-llvm.git] / include / llvm / DebugInfo / DWARFFormValue.h
index a9d1ec0b325140d7696342ce907e385bc840d4c0..d517a72d62e002c12500de43402ee971598be2bb 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef LLVM_DEBUGINFO_DWARFFORMVALUE_H
 #define LLVM_DEBUGINFO_DWARFFORMVALUE_H
 
+#include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/Support/DataExtractor.h"
 
@@ -35,7 +36,7 @@ public:
 
 private:
   struct ValueType {
-    ValueType() : data(NULL) {
+    ValueType() : data(nullptr) {
       uval = 0;
     }
 
@@ -59,7 +60,7 @@ public:
   bool extractValue(DataExtractor data, uint32_t *offset_ptr,
                     const DWARFUnit *u);
   bool isInlinedCStr() const {
-    return Value.data != NULL && Value.data == (const uint8_t*)Value.cstr;
+    return Value.data != nullptr && Value.data == (const uint8_t*)Value.cstr;
   }
 
   /// getAsFoo functions below return the extracted value as Foo if only
@@ -75,7 +76,8 @@ public:
   static bool skipValue(uint16_t form, DataExtractor debug_info_data,
                         uint32_t *offset_ptr, const DWARFUnit *u);
 
-  static const uint8_t *getFixedFormSizes(uint8_t AddrSize, uint16_t Version);
+  static ArrayRef<uint8_t> getFixedFormSizes(uint8_t AddrSize,
+                                             uint16_t Version);
 };
 
 }