diff --git a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp index 9586d053c0bc..be68d42affa1 100644 --- a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -4843,7 +4843,7 @@ void RewriteModernObjC::RewriteImplicitCastObjCExpr(CastExpr *IC) { std::string Str = "("; Str += TypeString; Str += ")"; - InsertText(IC->getSubExpr()->getLocStart(), &Str[0], Str.size()); + InsertText(IC->getSubExpr()->getLocStart(), Str); return; } @@ -5622,7 +5622,7 @@ Stmt *RewriteModernObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { // FIXME: Missing definition of // InsertText(clang::SourceLocation, char const*, unsigned int). - // InsertText(startLoc, messString.c_str(), messString.size()); + // InsertText(startLoc, messString); // Tried this, but it didn't work either... // ReplaceText(startLoc, 0, messString.c_str(), messString.size()); #endif @@ -5748,7 +5748,7 @@ Stmt *RewriteModernObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { const std::string &Str = Buf.str(); printf("CAST = %s\n", &Str[0]); - InsertText(ICE->getSubExpr()->getLocStart(), &Str[0], Str.size()); + InsertText(ICE->getSubExpr()->getLocStart(), Str); delete S; return Replacement; } diff --git a/clang/lib/Frontend/Rewrite/RewriteObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteObjC.cpp index 86efdccab908..e0ddadb12306 100644 --- a/clang/lib/Frontend/Rewrite/RewriteObjC.cpp +++ b/clang/lib/Frontend/Rewrite/RewriteObjC.cpp @@ -4664,7 +4664,7 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { // FIXME: Missing definition of // InsertText(clang::SourceLocation, char const*, unsigned int). - // InsertText(startLoc, messString.c_str(), messString.size()); + // InsertText(startLoc, messString); // Tried this, but it didn't work either... // ReplaceText(startLoc, 0, messString.c_str(), messString.size()); #endif @@ -4779,7 +4779,7 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) { const std::string &Str = Buf.str(); printf("CAST = %s\n", &Str[0]); - InsertText(ICE->getSubExpr()->getLocStart(), &Str[0], Str.size()); + InsertText(ICE->getSubExpr()->getLocStart(), Str); delete S; return Replacement; }