]> granicus.if.org Git - clang/commitdiff
Remove redundant bouncing between StringRef and a pair of 'const char *'.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 17 Jul 2015 19:51:03 +0000 (19:51 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 17 Jul 2015 19:51:03 +0000 (19:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242562 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/ASTReader.h
lib/Serialization/ASTReader.cpp

index 38a552405eb345ff0315cf1b61b5ee0f45a24f4b..029b3570c5811d41f5acdb5d9ed2cecae7e66817 100644 (file)
@@ -1755,10 +1755,7 @@ public:
   /// declarations with this name are visible from translation unit scope, their
   /// declarations will be deserialized and introduced into the declaration
   /// chain of the identifier.
-  virtual IdentifierInfo *get(const char *NameStart, const char *NameEnd);
-  IdentifierInfo *get(StringRef Name) override {
-    return get(Name.begin(), Name.end());
-  }
+  IdentifierInfo *get(StringRef Name) override;
 
   /// \brief Retrieve an iterator into the set of all identifiers
   /// in all loaded AST files.
index 9fbf55bf15d1886dcf8e51268ea95b143fbe7f46..96f6ca5cb05b21a1729476ae35d5652ac4347a8f 100644 (file)
@@ -6824,10 +6824,9 @@ void ASTReader::UpdateSema() {
     SemaObj->ActOnPragmaOptimize(/* IsOn = */ false, OptimizeOffPragmaLocation);
 }
 
-IdentifierInfo* ASTReader::get(const char *NameStart, const char *NameEnd) {
+IdentifierInfo *ASTReader::get(StringRef Name) {
   // Note that we are loading an identifier.
   Deserializing AnIdentifier(this);
-  StringRef Name(NameStart, NameEnd - NameStart);
 
   // If there is a global index, look there first to determine which modules
   // provably do not have any results for this identifier.