[PATCH] Support native mach-o names in MachOFormat.h
Nick Kledzik
kledzik at apple.com
Mon Aug 19 14:41:29 PDT 2013
include/llvm/Object/MachOFormat.h is odd in that it makes up new names for the public mach-o format structs and constants (e.g. it defines LCT_Segment instead of LC_SEGMENT). LLVM does not handle ELF this way. LLVM defines SHT_PROGBITS just like the standard ELF header (although llvm puts them into a namespace). This current set up makes it hard to reconcile the public mach-o documentation with llvm source code.
This patch adds all the standard mach-o names for structs and constants in the llvm::object::mach_o namespace. All the existing names remain, but I put them inside #ifndef LLVM_NO_OLD_MACH_O_NAMES, so that if someone wanted to switch to the standard names they could define LLVM_NO_OLD_MACH_O_NAMES, do a full build, and update whatever failures are seen.
This issue came up during a code review of lld, as to why lld was defining it own mach-o constants instead of using the ones in llvm.
-Nick
More information about the llvm-commits
mailing list