r324540 - [NFCi] Replace a couple of usages of const StringRef& with StringRef
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 7 15:04:38 PST 2018
Author: erichkeane
Date: Wed Feb 7 15:04:38 2018
New Revision: 324540
URL: http://llvm.org/viewvc/llvm-project?rev=324540&view=rev
Log:
[NFCi] Replace a couple of usages of const StringRef& with StringRef
No sense passing these by reference when a copy is about as free, and
saves on potential indirection later.
Modified:
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/Basic/Targets/SystemZ.cpp
cfe/trunk/lib/Basic/Targets/SystemZ.h
cfe/trunk/lib/Basic/Targets/X86.h
Modified: cfe/trunk/include/clang/Basic/TargetInfo.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TargetInfo.h?rev=324540&r1=324539&r2=324540&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h (original)
+++ cfe/trunk/include/clang/Basic/TargetInfo.h Wed Feb 7 15:04:38 2018
@@ -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 "";
}
Modified: cfe/trunk/lib/Basic/Targets/SystemZ.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/SystemZ.cpp?rev=324540&r1=324539&r2=324540&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/SystemZ.cpp (original)
+++ cfe/trunk/lib/Basic/Targets/SystemZ.cpp Wed Feb 7 15:04:38 2018
@@ -83,7 +83,7 @@ bool SystemZTargetInfo::validateAsmConst
}
}
-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)
Modified: cfe/trunk/lib/Basic/Targets/SystemZ.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/SystemZ.h?rev=324540&r1=324539&r2=324540&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/SystemZ.h (original)
+++ cfe/trunk/lib/Basic/Targets/SystemZ.h Wed Feb 7 15:04:38 2018
@@ -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;
Modified: cfe/trunk/lib/Basic/Targets/X86.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/X86.h?rev=324540&r1=324539&r2=324540&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/X86.h (original)
+++ cfe/trunk/lib/Basic/Targets/X86.h Wed Feb 7 15:04:38 2018
@@ -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))
More information about the cfe-commits
mailing list