Make more use of llvm::StringRef in various APIs. In particular, don't
use the deprecated forms of llvm::StringMap::GetOrCreateValue().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133515 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index 23855d4..512b024 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -326,9 +326,7 @@
   if (PLoc.isInvalid())
     return;
   
-  unsigned FilenameLen = strlen(PLoc.getFilename());
-  unsigned FilenameID = SourceMgr.getLineTableFilenameID(PLoc.getFilename(),
-                                                         FilenameLen);
+  unsigned FilenameID = SourceMgr.getLineTableFilenameID(PLoc.getFilename());
 
   // Notify the client, if desired, that we are in a new source file.
   if (Callbacks)
@@ -454,8 +452,7 @@
       return;
     }
 
-    ArgumentString = std::string(Literal.GetString(),
-                                 Literal.GetString()+Literal.GetStringLength());
+    ArgumentString = Literal.GetString();
   }
 
   // FIXME: If the kind is "compiler" warn if the string is present (it is
@@ -531,7 +528,7 @@
     return;
   }
 
-  llvm::StringRef MessageString(Literal.GetString(), Literal.GetStringLength());
+  llvm::StringRef MessageString(Literal.GetString());
 
   if (ExpectClosingParen) {
     if (Tok.isNot(tok::r_paren)) {
@@ -906,7 +903,7 @@
       return;
     }
 
-    llvm::StringRef WarningName(Literal.GetString(), Literal.GetStringLength());
+    llvm::StringRef WarningName(Literal.GetString());
 
     if (WarningName.size() < 3 || WarningName[0] != '-' ||
         WarningName[1] != 'W') {