Add some more code modification hints

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68261 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 7a25404..1540f0a 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -3402,11 +3402,25 @@
     // operand is null), the user probably wants strcmp.
     if ((isa<StringLiteral>(LHSStripped) || isa<ObjCEncodeExpr>(LHSStripped)) &&
         !RHSStripped->isNullPointerConstant(Context))
-      Diag(Loc, diag::warn_stringcompare) << lex->getSourceRange();
+      Diag(Loc, diag::warn_stringcompare) 
+        << lex->getSourceRange()
+        << CodeModificationHint::CreateReplacement(SourceRange(Loc), ", ")
+        << CodeModificationHint::CreateInsertion(lex->getLocStart(),
+                                                 "strcmp(")
+        << CodeModificationHint::CreateInsertion(
+                                       PP.getLocForEndOfToken(rex->getLocEnd()),
+                                       ") == 0");
     else if ((isa<StringLiteral>(RHSStripped) ||
               isa<ObjCEncodeExpr>(RHSStripped)) &&
              !LHSStripped->isNullPointerConstant(Context))
-      Diag(Loc, diag::warn_stringcompare) << rex->getSourceRange();
+      Diag(Loc, diag::warn_stringcompare) 
+        << rex->getSourceRange()
+        << CodeModificationHint::CreateReplacement(SourceRange(Loc), ", ")
+        << CodeModificationHint::CreateInsertion(lex->getLocStart(),
+                                                 "strcmp(")
+        << CodeModificationHint::CreateInsertion(
+                                       PP.getLocForEndOfToken(rex->getLocEnd()),
+                                       ") == 0");
   }
 
   // The result of comparisons is 'bool' in C++, 'int' in C.