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 | 30ac2225ee1df5e80ae5054c85d9edbab8497fd1 (patch) | |
tree | 1d71b7df489746738643e7da163df6c40312e720 /clang | |
parent | bcdb46830b3e303a02af185bef036a23c850eebb (diff) | |
download | bcm5719-llvm-30ac2225ee1df5e80ae5054c85d9edbab8497fd1.tar.gz bcm5719-llvm-30ac2225ee1df5e80ae5054c85d9edbab8497fd1.zip |
Fix <rdar://problem/5887874> clang ObjC rewriter: Use a different name for 'offsetof' macro
llvm-svn: 50832
Diffstat (limited to 'clang')
-rw-r--r-- | clang/Driver/RewriteObjC.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/Driver/RewriteObjC.cpp b/clang/Driver/RewriteObjC.cpp index 791726ece0e..d12ecbb9955 100644 --- a/clang/Driver/RewriteObjC.cpp +++ b/clang/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); |