aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetRecip.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-09-21 00:18:00 +0000
committerCraig Topper <craig.topper@gmail.com>2015-09-21 00:18:00 +0000
commit4e9b03d6f92414ac20874c584183580645a6cec5 (patch)
treee7e678e56d5b488d09679db3babed89f5d9e6581 /llvm/lib/Target/TargetRecip.cpp
parent3c76c523e13d346f0092632708f53a9ce83e55fd (diff)
downloadllvm-4e9b03d6f92414ac20874c584183580645a6cec5.zip
llvm-4e9b03d6f92414ac20874c584183580645a6cec5.tar.gz
llvm-4e9b03d6f92414ac20874c584183580645a6cec5.tar.bz2
Don't pass StringRefs around by const reference. Pass by value instead per coding standards. NFC
llvm-svn: 248136
Diffstat (limited to 'llvm/lib/Target/TargetRecip.cpp')
-rw-r--r--llvm/lib/Target/TargetRecip.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/TargetRecip.cpp b/llvm/lib/Target/TargetRecip.cpp
index 42bc487..4f68f36 100644
--- a/llvm/lib/Target/TargetRecip.cpp
+++ b/llvm/lib/Target/TargetRecip.cpp
@@ -46,7 +46,7 @@ TargetRecip::TargetRecip() {
RecipMap.insert(std::make_pair(RecipOps[i], RecipParams()));
}
-static bool parseRefinementStep(const StringRef &In, size_t &Position,
+static bool parseRefinementStep(StringRef In, size_t &Position,
uint8_t &Value) {
const char RefStepToken = ':';
Position = In.find(RefStepToken);
@@ -175,7 +175,7 @@ TargetRecip::TargetRecip(const std::vector<std::string> &Args) :
parseIndividualParams(Args);
}
-bool TargetRecip::isEnabled(const StringRef &Key) const {
+bool TargetRecip::isEnabled(StringRef Key) const {
ConstRecipIter Iter = RecipMap.find(Key);
assert(Iter != RecipMap.end() && "Unknown name for reciprocal map");
assert(Iter->second.Enabled != Uninitialized &&
@@ -183,7 +183,7 @@ bool TargetRecip::isEnabled(const StringRef &Key) const {
return Iter->second.Enabled;
}
-unsigned TargetRecip::getRefinementSteps(const StringRef &Key) const {
+unsigned TargetRecip::getRefinementSteps(StringRef Key) const {
ConstRecipIter Iter = RecipMap.find(Key);
assert(Iter != RecipMap.end() && "Unknown name for reciprocal map");
assert(Iter->second.RefinementSteps != Uninitialized &&
@@ -192,7 +192,7 @@ unsigned TargetRecip::getRefinementSteps(const StringRef &Key) const {
}
/// Custom settings (previously initialized values) override target defaults.
-void TargetRecip::setDefaults(const StringRef &Key, bool Enable,
+void TargetRecip::setDefaults(StringRef Key, bool Enable,
unsigned RefSteps) {
if (Key == "all") {
for (auto &KV : RecipMap) {
@@ -213,7 +213,7 @@ void TargetRecip::setDefaults(const StringRef &Key, bool Enable,
bool TargetRecip::operator==(const TargetRecip &Other) const {
for (const auto &KV : RecipMap) {
- const StringRef &Op = KV.first;
+ StringRef Op = KV.first;
const RecipParams &RP = KV.second;
const RecipParams &OtherRP = Other.RecipMap.find(Op)->second;
if (RP.RefinementSteps != OtherRP.RefinementSteps)