aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-07 16:50:40 +0000
committerChris Lattner <sabre@nondot.org>2009-04-07 16:50:40 +0000
commit10d2427386124b69c150bef0163b525404bbb545 (patch)
tree0ee2a9b9c2dc166bc345d7029e6e76cebe742d31
parent1a31ad817149d57053dafcdcf18326363a8e79f5 (diff)
Fariborz points out that weak is now defined to the attribute even
in C mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68520 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Basic/Targets.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp
index 5fa2967e59..2197b42eb7 100644
--- a/lib/Basic/Targets.cpp
+++ b/lib/Basic/Targets.cpp
@@ -144,14 +144,14 @@ static void getDarwinDefines(std::vector<char> &Defs, const LangOptions &Opts,
Define(Defs, "__MACH__");
Define(Defs, "OBJC_NEW_PROPERTIES");
- // Darwin defines __weak and __strong even in C mode.
- if (!Opts.ObjC1 || Opts.getGCMode() == LangOptions::NonGC) {
- Define(Defs, "__weak", "");
+ // __weak is always defined, for use in blocks and with objc pointers.
+ Define(Defs, "__weak", "__attribute__((objc_gc(weak)))");
+
+ // Darwin defines __strong even in C mode (just to nothing).
+ if (!Opts.ObjC1 || Opts.getGCMode() == LangOptions::NonGC)
Define(Defs, "__strong", "");
- } else {
- Define(Defs, "__weak", "__attribute__((objc_gc(weak)))");
+ else
Define(Defs, "__strong", "__attribute__((objc_gc(strong)))");
- }
// FIXME: OBJC_ZEROCOST_EXCEPTIONS when using zero cost eh.