[cfe-commits] r133112 - in /cfe/trunk/lib: Basic/Targets.cpp Frontend/InitPreprocessor.cpp
John McCall
rjmccall at apple.com
Wed Jun 15 17:03:19 PDT 2011
Author: rjmccall
Date: Wed Jun 15 19:03:19 2011
New Revision: 133112
URL: http://llvm.org/viewvc/llvm-project?rev=133112&view=rev
Log:
Unconditionally #define the ARC ownership qualifiers, instead of #defining
them only on Darwin tool chains.
Modified:
cfe/trunk/lib/Basic/Targets.cpp
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=133112&r1=133111&r2=133112&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jun 15 19:03:19 2011
@@ -84,14 +84,7 @@
Builder.defineMacro("__MACH__");
Builder.defineMacro("OBJC_NEW_PROPERTIES");
- if (Opts.ObjCAutoRefCount) {
- Builder.defineMacro("__weak", "__attribute__((objc_lifetime(weak)))");
- Builder.defineMacro("__strong", "__attribute__((objc_lifetime(strong)))");
- Builder.defineMacro("__autoreleasing",
- "__attribute__((objc_lifetime(autoreleasing)))");
- Builder.defineMacro("__unsafe_unretained",
- "__attribute__((objc_lifetime(none)))");
- } else {
+ if (!Opts.ObjCAutoRefCount) {
// __weak is always defined, for use in blocks and with objc pointers.
Builder.defineMacro("__weak", "__attribute__((objc_gc(weak)))");
Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=133112&r1=133111&r2=133112&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Wed Jun 15 19:03:19 2011
@@ -606,6 +606,15 @@
if (LangOpts.FastRelaxedMath)
Builder.defineMacro("__FAST_RELAXED_MATH__");
+ if (LangOpts.ObjCAutoRefCount) {
+ Builder.defineMacro("__weak", "__attribute__((objc_lifetime(weak)))");
+ Builder.defineMacro("__strong", "__attribute__((objc_lifetime(strong)))");
+ Builder.defineMacro("__autoreleasing",
+ "__attribute__((objc_lifetime(autoreleasing)))");
+ Builder.defineMacro("__unsafe_unretained",
+ "__attribute__((objc_lifetime(none)))");
+ }
+
// Get other target #defines.
TI.getTargetDefines(LangOpts, Builder);
}
More information about the cfe-commits
mailing list