[llvm-branch-commits] [cfe-branch] r82174 - /cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp

Steve Naroff snaroff at apple.com
Thu Sep 17 15:26:45 PDT 2009


Author: snaroff
Date: Thu Sep 17 17:26:45 2009
New Revision: 82174

URL: http://llvm.org/viewvc/llvm-project?rev=82174&view=rev
Log:
Fix <rdar://problem/7229394> clang ObjC rewriter: incorrect constant strings generated if they contain escaped characters.

Modified:
    cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp

Modified: cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp?rev=82174&r1=82173&r2=82174&view=diff

==============================================================================
--- cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp (original)
+++ cfe/branches/Apple/objective-rewrite/tools/clang/Driver/RewriteObjC.cpp Thu Sep 17 17:26:45 2009
@@ -2240,8 +2240,7 @@
   Exp->getString()->printPretty(prettyBuf);
   Preamble += prettyBuf.str();
   Preamble += ",";
-  // The minus 2 removes the begin/end double quotes.
-  Preamble += utostr(prettyBuf.str().size()-2) + "};\n";
+  Preamble += utostr(Exp->getString()->getByteLength()) + "};\n";
   
   VarDecl *NewVD = VarDecl::Create(*Context, TUDecl, SourceLocation(), 
                                     &Context->Idents.get(S.c_str()), strType, 





More information about the llvm-branch-commits mailing list