summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-02-10 00:04:22 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-02-10 00:04:22 +0000
commit591b7de0306df1d06eaa9d7cab5ff43d663482ed (patch)
tree4fedf666f20a428e53d56d15325e91d015824858 /clang/lib/Rewrite
parent4d04c6ad07646d806278af25256b5ab15631815e (diff)
downloadbcm5719-llvm-591b7de0306df1d06eaa9d7cab5ff43d663482ed.tar.gz
bcm5719-llvm-591b7de0306df1d06eaa9d7cab5ff43d663482ed.zip
objc translator: mode modern abi stuff.
llvm-svn: 150212
Diffstat (limited to 'clang/lib/Rewrite')
-rw-r--r--clang/lib/Rewrite/RewriteModernObjC.cpp96
1 files changed, 96 insertions, 0 deletions
diff --git a/clang/lib/Rewrite/RewriteModernObjC.cpp b/clang/lib/Rewrite/RewriteModernObjC.cpp
index c0e5f0e41b9..55ba210e137 100644
--- a/clang/lib/Rewrite/RewriteModernObjC.cpp
+++ b/clang/lib/Rewrite/RewriteModernObjC.cpp
@@ -5213,6 +5213,63 @@ void RewriteModernObjC::RewriteIvarOffsetComputation(ObjCIvarDecl *ivar,
/// const char ** extendedMethodTypes;
/// }
+/// struct _ivar_t {
+/// unsigned long int *offset; // pointer to ivar offset location
+/// char *name;
+/// char *type;
+/// uint32_t alignment;
+/// uint32_t size;
+/// }
+
+/// struct _ivar_list_t {
+/// uint32 entsize; // sizeof(struct _ivar_t)
+/// uint32 count;
+/// struct _iver_t list[count];
+/// }
+
+/// struct _class_ro_t {
+/// uint32_t const flags;
+/// uint32_t const instanceStart;
+/// uint32_t const instanceSize;
+/// uint32_t const reserved; // only when building for 64bit targets
+/// const uint8_t * const ivarLayout;
+/// const char *const name;
+/// const struct _method_list_t * const baseMethods;
+/// const struct _objc_protocol_list *const baseProtocols;
+/// const struct _ivar_list_t *const ivars;
+/// const uint8_t * const weakIvarLayout;
+/// const struct _prop_list_t * const properties;
+/// }
+
+/// struct _class_t {
+/// struct _class_t *isa;
+/// struct _class_t * const superclass;
+/// void *cache;
+/// IMP *vtable;
+/// struct class_ro_t *ro;
+/// }
+
+/// struct _category_t {
+/// const char * const name;
+/// struct _class_t *const cls;
+/// const struct _method_list_t * const instance_methods;
+/// const struct _method_list_t * const class_methods;
+/// const struct _protocol_list_t * const protocols;
+/// const struct _prop_list_t * const properties;
+/// }
+
+/// MessageRefTy - LLVM for:
+/// struct _message_ref_t {
+/// IMP messenger;
+/// SEL name;
+/// };
+
+/// SuperMessageRefTy - LLVM for:
+/// struct _super_message_ref_t {
+/// SUPER_IMP messenger;
+/// SEL name;
+/// };
+
static void WriteModernMetadataDeclarations(std::string &Result) {
static bool meta_data_declared = false;
if (meta_data_declared)
@@ -5245,6 +5302,45 @@ static void WriteModernMetadataDeclarations(std::string &Result) {
Result += "\tconst char ** extendedMethodTypes;\n";
Result += "};\n";
+ Result += "\nstruct _ivar_t {\n";
+ Result += "\tunsigned long int *offset; // pointer to ivar offset location\n";
+ Result += "\tchar *name;\n";
+ Result += "\tchar *type;\n";
+ Result += "\tunsigned int alignment;\n";
+ Result += "\tunsigned int size;\n";
+ Result += "};\n";
+
+ Result += "\nstruct _class_ro_t {\n";
+ Result += "\tunsigned int const flags;\n";
+ Result += "\tunsigned int instanceStart;\n";
+ Result += "\tunsigned int const instanceSize;\n";
+ Result += "\tunsigned int const reserved; // only when building for 64bit targets\n";
+ Result += "\tconst unsigned char * const ivarLayout;\n";
+ Result += "\tconst char *const name;\n";
+ Result += "\tconst struct _method_list_t * const baseMethods;\n";
+ Result += "\tconst struct _objc_protocol_list *const baseProtocols;\n";
+ Result += "\tconst struct _ivar_list_t *const ivars;\n";
+ Result += "\tconst unsigned char *const weakIvarLayout;\n";
+ Result += "\tconst struct _prop_list_t *const properties;\n";
+ Result += "};\n";
+
+ Result += "\nstruct _class_t {\n";
+ Result += "\tstruct _class_t *isa;\n";
+ Result += "\tstruct _class_t *const superclass;\n";
+ Result += "\tvoid *cache;\n";
+ Result += "\tvoid *vtable;\n";
+ Result += "\tstruct class_ro_t *ro;\n";
+ Result += "};\n";
+
+ Result += "\nstruct _category_t {\n";
+ Result += "\tconst char * const name;\n";
+ Result += "\tstruct _class_t *const cls;\n";
+ Result += "\tconst struct _method_list_t *const instance_methods;\n";
+ Result += "\tconst struct _method_list_t *const class_methods;\n";
+ Result += "\tconst struct _protocol_list_t *const protocols;\n";
+ Result += "\tconst struct _prop_list_t *const properties;\n";
+ Result += "};\n";
+
meta_data_declared = true;
}
OpenPOWER on IntegriCloud