[NFCi] Replace a couple of usages of const StringRef& with StringRef
authorErich Keane <erich.keane@intel.com>
Wed, 7 Feb 2018 23:04:38 +0000 (23:04 +0000)
committerErich Keane <erich.keane@intel.com>
Wed, 7 Feb 2018 23:04:38 +0000 (23:04 +0000)
No sense passing these by reference when a copy is about as free, and
saves on potential indirection later.

llvm-svn: 324540

clang/include/clang/Basic/TargetInfo.h
clang/lib/Basic/Targets/SystemZ.cpp
clang/lib/Basic/Targets/SystemZ.h
clang/lib/Basic/Targets/X86.h

index 0fc6223..ecc7ffb 100644 (file)
@@ -623,9 +623,9 @@ public:
   /// ReturnCanonical = true and Name = "rax", will return "ax".
   StringRef getNormalizedGCCRegisterName(StringRef Name,
                                          bool ReturnCanonical = false) const;
-  virtual StringRef getConstraintRegister(const StringRef &Constraint,
-                                          const StringRef &Expression) const {
+
+  virtual StringRef getConstraintRegister(StringRef Constraint,
+                                          StringRef Expression) const {
     return "";
   }
 
index 2dc9cdf..61f3dc6 100644 (file)
@@ -83,7 +83,7 @@ bool SystemZTargetInfo::validateAsmConstraint(
   }
 }
 
-int SystemZTargetInfo::getISARevision(const StringRef &Name) const {
+int SystemZTargetInfo::getISARevision(StringRef Name) const {
   return llvm::StringSwitch<int>(Name)
       .Cases("arch8", "z10", 8)
       .Cases("arch9", "z196", 9)
index 91a41bc..36f8535 100644 (file)
@@ -76,7 +76,7 @@ public:
     return TargetInfo::SystemZBuiltinVaList;
   }
 
-  int getISARevision(const StringRef &Name) const;
+  int getISARevision(StringRef Name) const;
 
   bool isValidCPUName(StringRef Name) const override {
     return getISARevision(Name) != -1;
index abe1001..be831ba 100644 (file)
@@ -175,8 +175,8 @@ public:
     return "~{dirflag},~{fpsr},~{flags}";
   }
 
-  StringRef getConstraintRegister(const StringRef &Constraint,
-                                  const StringRef &Expression) const override {
+  StringRef getConstraintRegister(StringRef Constraint,
+                                  StringRef Expression) const override {
     StringRef::iterator I, E;
     for (I = Constraint.begin(), E = Constraint.end(); I != E; ++I) {
       if (isalpha(*I))