]> granicus.if.org Git - clang/commitdiff
Don't define __CONSTANT_CFSTRINGS__ with -fno-constant-cfstrings issue.
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 5 Jul 2011 16:00:59 +0000 (16:00 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 5 Jul 2011 16:00:59 +0000 (16:00 +0000)
Patch by Jean-Daniel Dupas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134414 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/InitPreprocessor.cpp

index 2276e16eb7c6fc026e03361d028eb4ef4ebde719..b07fb4395fab15279616163e0b9dd0a68d1e18ff 100644 (file)
@@ -438,7 +438,8 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
 
   // darwin_constant_cfstrings controls this. This is also dependent
   // on other things like the runtime I believe.  This is set even for C code.
-  Builder.defineMacro("__CONSTANT_CFSTRINGS__");
+  if (!LangOpts.NoConstantCFStrings)
+      Builder.defineMacro("__CONSTANT_CFSTRINGS__");
 
   if (LangOpts.ObjC2)
     Builder.defineMacro("OBJC_NEW_PROPERTIES");