diff options
author | Steve Naroff <snaroff@apple.com> | 2008-05-07 21:23:49 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-05-07 21:23:49 +0000 |
commit | 5df5b76594f7112c3bf4a07fe9c9d224c1b9c86f (patch) | |
tree | 284ffe73cbf94fb6987f2b225d01a7e3f5134fd0 | |
parent | 299e8158d63d69830cca0187f4003cba1e66081f (diff) |
Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof' macro
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50832 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Driver/RewriteObjC.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp index 791726ece0..d12ecbb995 100644 --- a/Driver/RewriteObjC.cpp +++ b/Driver/RewriteObjC.cpp @@ -2685,7 +2685,7 @@ void RewriteObjC::RewriteObjCCategoryImplDecl(ObjCCategoryImplDecl *IDecl, 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 @@ void RewriteObjC::RewriteImplementations(std::string &Result) { 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); |