aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2007-10-24 20:54:23 +0000
committerFariborz Jahanian <fjahanian@apple.com>2007-10-24 20:54:23 +0000
commit454cb012a948ab3dfef5e80ee32b470689c42ba5 (patch)
tree98800485ed23232a3424668c0907e60e2b26be78 /Driver/RewriteTest.cpp
parent057afddf0fab91d979d6a750667d56a345225c96 (diff)
Couple of minor changes. 1) Metaclass metadata also has a reference to
protocol meta-data (unlike what documentation says). 2) Include objc.h so, we can compile the generated metadata with both gcc and clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r--Driver/RewriteTest.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index 1cf5895721..3904d86be7 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -686,7 +686,11 @@ void RewriteTest::RewriteObjcClassMetaData(ObjcImplementationDecl *IDecl) {
CDecl->getName());
else
printf(", 0\n");
- printf("\t,0,0,0,0\n");
+ if (CDecl->getNumIntfRefProtocols() > 0)
+ printf("\t,0,(struct _objc_protocol_list*)&_OBJC_CLASS_PROTOCOLS_%s,0,0\n",
+ CDecl->getName());
+ else
+ printf("\t,0,0,0,0\n");
printf("};\n");
// class metadata generation.
@@ -724,6 +728,10 @@ void RewriteTest::WriteObjcMetaData() {
if (ClsDefCount == 0 && CatDefCount == 0)
return;
+ // TODO: This is temporary until we decide how to access objc types in a
+ // c program
+ printf("\n#include <Objc/objc.h>\n");
+
// For each implemented class, write out all its meta data.
for (int i = 0; i < ClsDefCount; i++)
RewriteObjcClassMetaData(ClassImplementation[i]);