remove one more Preprocessor::Diag method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59512 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index f67b1b2..a8dcc53 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -59,7 +59,7 @@
     if (isCXXNamedOperator(Spelling))
       // C++ 2.5p2: Alternative tokens behave the same as its primary token
       // except for their spellings.
-      Diag(MacroNameTok, diag::err_pp_operator_used_as_macro_name, Spelling);
+      Diag(MacroNameTok, diag::err_pp_operator_used_as_macro_name) << Spelling;
     else
       Diag(MacroNameTok, diag::err_pp_macro_not_identifier);
     // Fall through on error.
@@ -98,7 +98,7 @@
     LexUnexpandedToken(Tmp);
   
   if (Tmp.isNot(tok::eom)) {
-    Diag(Tmp, diag::ext_pp_extra_tokens_at_eol, DirType);
+    Diag(Tmp, diag::ext_pp_extra_tokens_at_eol) << DirType;
     DiscardUntilEndOfDirective();
   }
 }
@@ -476,7 +476,7 @@
   std::string Message = CurLexer->ReadToEndOfLine();
 
   unsigned DiagID = isWarning ? diag::pp_hash_warning : diag::err_pp_hash_error;
-  return Diag(Tok, DiagID, Message);
+  Diag(Tok, DiagID) << Message;
 }
 
 /// HandleIdentSCCSDirective - Handle a #ident/#sccs directive.
@@ -692,9 +692,11 @@
   // Look up the file, create a File ID for it.
   unsigned FileID = SourceMgr.createFileID(File, FilenameTok.getLocation(),
                                            FileCharacter);
-  if (FileID == 0)
-    return Diag(FilenameTok, diag::err_pp_file_not_found,
-                std::string(FilenameStart, FilenameEnd));
+  if (FileID == 0) {
+    Diag(FilenameTok, diag::err_pp_file_not_found)
+      << std::string(FilenameStart, FilenameEnd);
+    return;
+  }
 
   // Finally, if all is good, enter the new file!
   EnterSourceFile(FileID, CurDir);
@@ -786,7 +788,7 @@
       // #define X(A,A.
       if (std::find(Arguments.begin(), Arguments.end(), II) != 
           Arguments.end()) {  // C99 6.10.3p6
-        Diag(Tok, diag::err_pp_duplicate_name_in_arg_list, II->getName());
+        Diag(Tok, diag::err_pp_duplicate_name_in_arg_list) << II->getName();
         return true;
       }
         
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp
index 4042604..b3ae9d9 100644
--- a/lib/Lex/PPExpressions.cpp
+++ b/lib/Lex/PPExpressions.cpp
@@ -91,7 +91,7 @@
     // into a simple 0, unless it is the C++ keyword "true", in which case it
     // turns into "1".
     if (II->getPPKeywordID() != tok::pp_defined) {
-      PP.Diag(PeekTok, diag::warn_pp_undef_identifier, II->getName());
+      PP.Diag(PeekTok, diag::warn_pp_undef_identifier) << II->getName();
       Result.Val = II->getTokenID() == tok::kw_true;
       Result.Val.setIsUnsigned(false);  // "0" is signed intmax_t 0.
       Result.setRange(PeekTok.getLocation());
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index dd5f144..d4c5c6b 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -287,9 +287,11 @@
   const DirectoryLookup *CurDir;
   const FileEntry *File = LookupFile(FilenameStart, FilenameEnd,
                                      isAngled, 0, CurDir);
-  if (File == 0)
-    return Diag(FilenameTok, diag::err_pp_file_not_found,
-                std::string(FilenameStart, FilenameEnd));
+  if (File == 0) {
+    Diag(FilenameTok, diag::err_pp_file_not_found)
+      << std::string(FilenameStart, FilenameEnd);
+    return;
+  }
   
   SourceLocation FileLoc = getCurrentFileLexer()->getFileLoc();
   const FileEntry *CurFile = SourceMgr.getFileEntryForLoc(FileLoc);
@@ -305,7 +307,7 @@
     }
     
     Message.erase(Message.end()-1);
-    Diag(FilenameTok, diag::pp_out_of_date_dependency, Message);
+    Diag(FilenameTok, diag::pp_out_of_date_dependency) << Message;
   }
 }