[PATCH] [lld] enable mach-o and native yaml to be intermixed
Shankar Kalpathi Easwaran
shankarke at gmail.com
Thu Jan 9 15:35:12 PST 2014
LGTM except for below comments.
================
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);
----------------
wouldnt memcpy work here ?
================
Comment at: lib/ReaderWriter/YAML/ReaderWriterYAML.cpp:1307
@@ -1286,2 +1306,3 @@
+ new ArchiveYamlIOTaggedDocumentHandler()));
}
----------------
We would require the yaml reader to parse macho yaml tags too right ?
================
Comment at: include/lld/ReaderWriter/Reader.h:82
@@ +81,3 @@
+ /// YAML I/O, then convert the result into an lld::File* and return it.
+ virtual bool handledDocTag(llvm::yaml::IO &io, const lld::File *&f) const = 0;
+};
----------------
Does this need to be handleDocTag ?
================
Comment at: lib/ReaderWriter/YAML/ReaderWriterYAML.cpp:670-671
@@ +669,4 @@
+ // Let any register tag handler process this.
+ if (info->_registry && info->_registry->handleTaggedDoc(io, file))
+ return;
+ // If no registered handler claims this tag and there is no tag,
----------------
If there is an error while parsing the document we may want to return the error, possibly mapping should return an error_code ?
http://llvm-reviews.chandlerc.com/D2529
BRANCH
svn
ARCANIST PROJECT
lld
More information about the llvm-commits
mailing list