[PATCH] D48568: objdump: Support newer ObjC image info flags
Dave Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 25 14:11:53 PDT 2018
kastiglione created this revision.
kastiglione added reviewers: enderby, compnerd.
Add support for two additional ObjC image info flags: `IS_SIMULATED` and
`HAS_CATEGORY_CLASS_PROPERTIES`.
`IS_SIMULATED` indicates a Mach-O binary built for iOS simulator.
`HAS_CATEGORY_CLASS_PROPERTIES` indicates a Mach-O binary built by a compiler
that supports class properties in categories.
Repository:
rL LLVM
https://reviews.llvm.org/D48568
Files:
test/tools/llvm-objdump/Inputs/macho-image-info-ios-simulator
test/tools/llvm-objdump/Inputs/macho-image-info-macosx
test/tools/llvm-objdump/macho-image-info.test
tools/llvm-objdump/MachODump.cpp
Index: tools/llvm-objdump/MachODump.cpp
===================================================================
--- tools/llvm-objdump/MachODump.cpp
+++ tools/llvm-objdump/MachODump.cpp
@@ -3234,6 +3234,8 @@
/* masks for objc_image_info.flags */
#define OBJC_IMAGE_IS_REPLACEMENT (1 << 0)
#define OBJC_IMAGE_SUPPORTS_GC (1 << 1)
+#define OBJC_IMAGE_IS_SIMULATED (1 << 5)
+#define OBJC_IMAGE_HAS_CATEGORY_CLASS_PROPERTIES (1 << 6)
struct message_ref64 {
uint64_t imp; /* IMP (64-bit pointer) */
@@ -5595,6 +5597,10 @@
outs() << " OBJC_IMAGE_IS_REPLACEMENT";
if (o.flags & OBJC_IMAGE_SUPPORTS_GC)
outs() << " OBJC_IMAGE_SUPPORTS_GC";
+ if (o.flags & OBJC_IMAGE_IS_SIMULATED)
+ outs() << " OBJC_IMAGE_IS_SIMULATED";
+ if (o.flags & OBJC_IMAGE_HAS_CATEGORY_CLASS_PROPERTIES)
+ outs() << " OBJC_IMAGE_HAS_CATEGORY_CLASS_PROPERTIES";
swift_version = (o.flags >> 8) & 0xff;
if (swift_version != 0) {
if (swift_version == 1)
Index: test/tools/llvm-objdump/macho-image-info.test
===================================================================
--- /dev/null
+++ test/tools/llvm-objdump/macho-image-info.test
@@ -0,0 +1,5 @@
+# RUN: llvm-objdump -macho -objc-meta-data %p/Inputs/macho-image-info-macosx | FileCheck %s -check-prefix=CHECK-OSX
+# RUN: llvm-objdump -macho -objc-meta-data %p/Inputs/macho-image-info-ios-simulator | FileCheck %s -check-prefix=CHECK-SIM
+
+# CHECK-OSX: HAS_CATEGORY_CLASS_PROPERTIES
+# CHECK-SIM: IS_SIMULATED
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48568.152772.patch
Type: text/x-patch
Size: 1470 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180625/e95434f5/attachment.bin>
More information about the llvm-commits
mailing list