summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-05-29 10:46:35 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-05-29 10:46:35 +0000
commit728f4448a91f0e19e71244efe94d894649102022 (patch)
tree81d0f5d0aacaa0cb4ce68164461451522f11fe0d
parent0da23a2713ebbbc0f257060a0a59e50c3f47d4b3 (diff)
downloadbcm5719-llvm-728f4448a91f0e19e71244efe94d894649102022.tar.gz
bcm5719-llvm-728f4448a91f0e19e71244efe94d894649102022.zip
Remove some 'const' specifiers that do nothing but prevent moving the argument.
Found by clang-tidy's misc-move-const-arg. While there drop some obsolete c_str() calls. llvm-svn: 271181
-rw-r--r--llvm/include/llvm/IR/Function.h2
-rw-r--r--llvm/include/llvm/Transforms/Utils/LoopVersioning.h2
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp2
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp2
-rw-r--r--llvm/lib/IR/Function.cpp2
-rw-r--r--llvm/lib/Transforms/Utils/LoopVersioning.cpp2
-rw-r--r--llvm/tools/obj2yaml/Error.h2
7 files changed, 7 insertions, 7 deletions
diff --git a/llvm/include/llvm/IR/Function.h b/llvm/include/llvm/IR/Function.h
index cffb9900bd4..6aeddab4311 100644
--- a/llvm/include/llvm/IR/Function.h
+++ b/llvm/include/llvm/IR/Function.h
@@ -231,7 +231,7 @@ public:
return getSubclassDataFromValue() & (1<<14);
}
const std::string &getGC() const;
- void setGC(const std::string Str);
+ void setGC(std::string Str);
void clearGC();
/// @brief adds the attribute to the list of attributes.
diff --git a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
index cb72fd2d1da..0d345a972e1 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
@@ -73,7 +73,7 @@ public:
/// \brief Sets the runtime alias checks for versioning the loop.
void setAliasChecks(
- const SmallVector<RuntimePointerChecking::PointerCheck, 4> Checks);
+ SmallVector<RuntimePointerChecking::PointerCheck, 4> Checks);
/// \brief Sets the runtime SCEV checks for versioning the loop.
void setSCEVChecks(SCEVUnionPredicate Check);
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index d1f9d4701a3..3f9ea5766bd 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -4668,7 +4668,7 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) {
Fn->setSection(Section);
Fn->setComdat(C);
Fn->setPersonalityFn(PersonalityFn);
- if (!GC.empty()) Fn->setGC(GC.c_str());
+ if (!GC.empty()) Fn->setGC(GC);
Fn->setPrefixData(Prefix);
Fn->setPrologueData(Prologue);
ForwardRefAttrGroups[Fn] = FwdRefAttrGrps;
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 157408d6240..2cd1297d902 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3863,7 +3863,7 @@ std::error_code BitcodeReader::parseModule(uint64_t ResumeBit,
if (Record.size() > 8 && Record[8]) {
if (Record[8]-1 >= GCTable.size())
return error("Invalid ID");
- Func->setGC(GCTable[Record[8]-1].c_str());
+ Func->setGC(GCTable[Record[8] - 1]);
}
bool UnnamedAddr = false;
if (Record.size() > 9)
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 36800eecf84..c8741964564 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -405,7 +405,7 @@ const std::string &Function::getGC() const {
return getContext().getGC(*this);
}
-void Function::setGC(const std::string Str) {
+void Function::setGC(std::string Str) {
setValueSubclassDataBit(14, !Str.empty());
getContext().setGC(*this, std::move(Str));
}
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index e3f711ffebc..736d79ad81c 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -44,7 +44,7 @@ LoopVersioning::LoopVersioning(const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI,
}
void LoopVersioning::setAliasChecks(
- const SmallVector<RuntimePointerChecking::PointerCheck, 4> Checks) {
+ SmallVector<RuntimePointerChecking::PointerCheck, 4> Checks) {
AliasChecks = std::move(Checks);
}
diff --git a/llvm/tools/obj2yaml/Error.h b/llvm/tools/obj2yaml/Error.h
index f4e191c872c..f5111f257ce 100644
--- a/llvm/tools/obj2yaml/Error.h
+++ b/llvm/tools/obj2yaml/Error.h
@@ -33,7 +33,7 @@ class Obj2YamlError : public ErrorInfo<Obj2YamlError> {
public:
static char ID;
Obj2YamlError(obj2yaml_error C) : Code(C) {}
- Obj2YamlError(const std::string &ErrMsg) : ErrMsg(std::move(ErrMsg)) {}
+ Obj2YamlError(std::string ErrMsg) : ErrMsg(std::move(ErrMsg)) {}
Obj2YamlError(obj2yaml_error C, std::string ErrMsg)
: ErrMsg(std::move(ErrMsg)), Code(C) {}
void log(raw_ostream &OS) const override;
OpenPOWER on IntegriCloud