[llvm-commits] [123994] Implement support for -fwritable-strings.

clattner at apple.com clattner at apple.com
Fri Feb 16 21:05:33 PST 2007


Revision: 123994
Author:   clattner
Date:     2007-02-16 21:05:31 -0800 (Fri, 16 Feb 2007)

Log Message:
-----------
Implement support for -fwritable-strings.  This implements
test/CFrontend/2007-02-16-WritableStrings.c

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/llvm-convert.cpp

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-02-17 02:56:31 UTC (rev 123993)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-02-17 05:05:31 UTC (rev 123994)
@@ -5292,8 +5292,11 @@
   GlobalVariable *&Slot = StringCSTCache[Init];
   if (Slot) return Slot;
     
+  // Support -fwritable-strings.
+  bool StringIsConstant = !flag_writable_strings;
+  
   // Create a new string global.
-  return Slot = new GlobalVariable(Init->getType(), true,
+  return Slot = new GlobalVariable(Init->getType(), StringIsConstant,
                                    GlobalVariable::InternalLinkage,
                                    Init, "str", TheModule);
 }





More information about the llvm-commits mailing list