[PATCH] Initial support for Mach-O universal binaries in LLVMObject

Alexey Samsonov samsonov at google.com
Tue Jun 18 08:06:08 PDT 2013


  r184191, thanks!


================
Comment at: include/llvm/Object/Error.h:27
@@ -26,2 +26,3 @@
   success = 0,
+  arch_not_found,
   invalid_file_type,
----------------
Rafael Ávila de Espíndola wrote:
> You have to handle this in Error.cpp. I just made a change that should make this easier to notice.
Done. Thanks!

================
Comment at: lib/Object/MachOObjectFile.cpp:1300
@@ -1299,3 +1299,3 @@
 
-unsigned MachOObjectFile::getArch() const {
-  switch (getCPUType(this)) {
+/* static */
+Triple::ArchType MachOObjectFile::getArch(uint32_t CPUType) {
----------------
Rafael Ávila de Espíndola wrote:
> I don't think we normally have comments like this.
Removed

================
Comment at: tools/llvm-nm/llvm-nm.cpp:412
@@ +411,3 @@
+    if (object::MachOUniversalBinary *UB =
+            dyn_cast<object::MachOUniversalBinary>(Bin.get())) {
+      for (object::MachOUniversalBinary::object_iterator
----------------
Rafael Ávila de Espíndola wrote:
> I think you can use just cast in here.
Done

================
Comment at: lib/Object/MachOUniversal.cpp:99
@@ +98,3 @@
+    NumberOfObjects(0) {
+  if (!source || source->getBufferSize() < macho::FatHeaderSize) {
+    ec = object_error::invalid_file_type;
----------------
Rafael Ávila de Espíndola wrote:
> No other object format checks if the buffer is null. The interface should probably take a reference, but for now just remove the check.
> 
> Please start variable names with uppercase letters.
> 
Done


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



More information about the llvm-commits mailing list