From 369f4d64a2ab939b872d601c92f66cc6c9837cd5 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 29 Jul 2016 19:15:51 +0000 Subject: CodeGen: try harder to make the CFString structure RW The previous change was insufficient to mark the content as read-write as the structure itself was marked constant. Adjust this and add tests to ensure that the section is marked appropriately as being read-write. llvm-svn: 277200 --- clang/lib/CodeGen/CodeGenModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 2affa57..888af29 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3209,7 +3209,7 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { // The struct. C = llvm::ConstantStruct::get(STy, Fields); - GV = new llvm::GlobalVariable(getModule(), C->getType(), true, + GV = new llvm::GlobalVariable(getModule(), C->getType(), /*isConstant=*/false, llvm::GlobalVariable::PrivateLinkage, C, "_unnamed_cfstring_"); GV->setAlignment(Alignment.getQuantity()); -- cgit v1.1