[PATCH] D28669: [ARM] Remove ubig32_t cast from ARMAttributeParser

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 06:05:03 PST 2017


samparker updated this revision to Diff 84290.
samparker added a comment.

Now using read32le and read32be to access memory. Also included a small fix for attribute printing.


https://reviews.llvm.org/D28669

Files:
  lib/Support/ARMAttributeParser.cpp


Index: lib/Support/ARMAttributeParser.cpp
===================================================================
--- lib/Support/ARMAttributeParser.cpp
+++ lib/Support/ARMAttributeParser.cpp
@@ -674,9 +674,10 @@
       DictScope ASS(*SW, ScopeName);
       if (!Indicies.empty())
         SW->printList(IndexName, Indicies);
+      ParseAttributeList(Data, Offset, Length);
+    } else {
+      ParseAttributeList(Data, Offset, Length);
     }
-
-    ParseAttributeList(Data, Offset, Length);
   }
 }
 
@@ -686,8 +687,8 @@
 
   while (Offset < Section.size()) {
     uint32_t SectionLength = isLittle ?
-      *reinterpret_cast<const support::ulittle32_t*>(Section.data() + Offset) :
-      *reinterpret_cast<const support::ubig32_t*>(Section.data() + Offset);
+      support::endian::read32le(Section.data() + Offset) :
+      support::endian::read32be(Section.data() + Offset);
 
     if (SW) {
       SW->startLine() << "Section " << ++SectionNumber << " {\n";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28669.84290.patch
Type: text/x-patch
Size: 961 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/72463aff/attachment.bin>


More information about the llvm-commits mailing list