[cfe-commits] r50832 - /cfe/trunk/Driver/RewriteObjC.cpp
Steve Naroff
snaroff at apple.com
Wed May 7 14:23:49 PDT 2008
Author: snaroff
Date: Wed May 7 16:23:49 2008
New Revision: 50832
URL: http://llvm.org/viewvc/llvm-project?rev=50832&view=rev
Log:
Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof' macro
Modified:
cfe/trunk/Driver/RewriteObjC.cpp
Modified: cfe/trunk/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteObjC.cpp?rev=50832&r1=50831&r2=50832&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteObjC.cpp (original)
+++ cfe/trunk/Driver/RewriteObjC.cpp Wed May 7 16:23:49 2008
@@ -2685,7 +2685,7 @@
void RewriteObjC::SynthesizeIvarOffsetComputation(ObjCImplementationDecl *IDecl,
ObjCIvarDecl *ivar,
std::string &Result) {
- Result += "offsetof(struct ";
+ Result += "__OFFSETOFIVAR__(struct ";
Result += IDecl->getName();
if (LangOpts.Microsoft)
Result += "_IMPL";
@@ -2947,8 +2947,8 @@
for (int i = 0; i < CatDefCount; i++)
RewriteImplementationDecl(CategoryImplementation[i]);
- // This is needed for use of offsetof
- Result += "#define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)\n";
+ // This is needed for determining instance variable offsets.
+ Result += "#define __OFFSETOFIVAR__(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)\n";
// For each implemented class, write out all its meta data.
for (int i = 0; i < ClsDefCount; i++)
RewriteObjCClassMetaData(ClassImplementation[i], Result);
More information about the cfe-commits
mailing list