[PATCH] [lld] enable mach-o and native yaml to be intermixed

kledzik at apple.com kledzik at apple.com
Fri Jan 10 17:05:42 PST 2014



================
Comment at: lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp:306-309
@@ -302,1 +305,6 @@
+      uint8_t *bytes = file->ownedAllocations.Allocate<uint8_t>(size);
+      uint8_t *p = bytes;
+      for (Hex8 &byte : _normalizedContent) {
+        *p++ = byte;
       }
+      return makeArrayRef(bytes, size);
----------------
David Majnemer wrote:
> kledzik at apple.com wrote:
> > Shankar Kalpathi Easwaran wrote:
> > > wouldnt memcpy work here ?
> > The source is a Hex8 array, the destination is uint8_t array.  Pragmatically, a memcpy() would  work, but some language lawyers would think it fragile. 
> The definition of `Hex8` would make it seem like `std::copy` would work here.
Cool.  std::copy() does work!


http://llvm-reviews.chandlerc.com/D2529

BRANCH
  svn

ARCANIST PROJECT
  lld



More information about the llvm-commits mailing list