[PATCH] [lld] [MachO] Begin to flesh out normalizedToAtoms
kledzik at apple.com
kledzik at apple.com
Mon Dec 23 16:38:47 PST 2013
================
Comment at: unittests/MachOTests/MachONormalizedFileToAtomsTests.cpp:71
@@ +70,3 @@
+ };
+ std::unique_ptr<NormalizedFile> f = fromBinary(fileBytes, sizeof(fileBytes));
+ ErrorOr<std::unique_ptr<const lld::File>> atom_f = normalizedToAtoms(*f, "");
----------------
This test case is supposed to test "normalized -> atoms". There is no need for binary here. Use code to stuff fields in a NormalizedMachOFile and then call normalizedObjectToAtoms() on it.
================
Comment at: lib/ReaderWriter/MachO/MachONormalizedFile.h:126
@@ -119,1 +125,3 @@
+ return X;
+ }
};
----------------
We really don't want to be copying around section content. This should just return an ArrayRef to the section content.
================
Comment at: lib/ReaderWriter/MachO/Atoms.h:25
@@ +24,3 @@
+
+ virtual ContentType contentType() const { return DefinedAtom::typeCode; }
+
----------------
All symbol based atoms will not be typeCode. There are DefinedAtoms without content (zero fill). There are content atoms without symbols (c-string literals). So, we are going to need a bunch of atom classes.
http://llvm-reviews.chandlerc.com/D2464
More information about the llvm-commits
mailing list