[DebugInfo] Remove unneeded struct member and hide struct definition. No functionalit...
authorAlexey Samsonov <samsonov@google.com>
Fri, 18 Oct 2013 07:13:32 +0000 (07:13 +0000)
committerAlexey Samsonov <samsonov@google.com>
Fri, 18 Oct 2013 07:13:32 +0000 (07:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192954 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DebugInfo/DWARFFormValue.h
lib/DebugInfo/DWARFFormValue.cpp

index c88e42a9c9b8fa77f996afcfbb7e77c8183aec3a..c8d600839a1cef5dd47abb64e565f4691f195575 100644 (file)
@@ -18,9 +18,8 @@ class DWARFUnit;
 class raw_ostream;
 
 class DWARFFormValue {
-public:
   struct ValueType {
-    ValueType() : data(NULL), IsDWOIndex(false) {
+    ValueType() : data(NULL) {
       uval = 0;
     }
 
@@ -30,10 +29,8 @@ public:
       const char* cstr;
     };
     const uint8_t* data;
-    bool IsDWOIndex;
   };
 
-private:
   uint16_t Form;   // Form for this value.
   ValueType Value; // Contains all data for the form.
 
index 3867249d29fa0536fc52dba9d8d428ad97ba7abe..0dddb7eb4a7de743e79cca79c9d7f2685697a260 100644 (file)
@@ -184,7 +184,6 @@ bool DWARFFormValue::extractValue(DataExtractor data, uint32_t *offset_ptr,
     case DW_FORM_GNU_addr_index:
     case DW_FORM_GNU_str_index:
       Value.uval = data.getULEB128(offset_ptr);
-      Value.IsDWOIndex = true;
       break;
     default:
       return false;
@@ -441,7 +440,7 @@ const char *DWARFFormValue::getAsCString(const DWARFUnit *CU) const {
   if (!CU)
     return NULL;
   uint32_t Offset = Value.uval;
-  if (Value.IsDWOIndex) {
+  if (Form == DW_FORM_GNU_str_index) {
     uint32_t StrOffset;
     if (!CU->getStringOffsetSectionItem(Offset, StrOffset))
       return NULL;
@@ -453,7 +452,7 @@ const char *DWARFFormValue::getAsCString(const DWARFUnit *CU) const {
 uint64_t DWARFFormValue::getAsAddress(const DWARFUnit *CU) const {
   if (!CU)
     return 0;
-  if (Value.IsDWOIndex) {
+  if (Form == DW_FORM_GNU_addr_index) {
     uint32_t Index = Value.uval;
     uint64_t Address;
     if (!CU->getAddrOffsetSectionItem(Index, Address))