summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Support/CommandLine.h16
-rw-r--r--llvm/tools/lli/lli.cpp2
-rw-r--r--llvm/tools/llvm-profdata/llvm-profdata.cpp6
-rw-r--r--llvm/tools/llvm-size/llvm-size.cpp2
4 files changed, 22 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h
index 314dd951b2c..1403b7543b5 100644
--- a/llvm/include/llvm/Support/CommandLine.h
+++ b/llvm/include/llvm/Support/CommandLine.h
@@ -1180,6 +1180,10 @@ public:
return this->getValue();
}
+ // Command line options should not be copyable
+ opt(const opt &) LLVM_DELETED_FUNCTION;
+ opt &operator=(const opt &) LLVM_DELETED_FUNCTION;
+
// One option...
template <class M0t>
explicit opt(const M0t &M0)
@@ -1374,6 +1378,10 @@ public:
void setNumAdditionalVals(unsigned n) { Option::setNumAdditionalVals(n); }
+ // Command line options should not be copyable
+ list(const list &) LLVM_DELETED_FUNCTION;
+ list &operator=(const list &) LLVM_DELETED_FUNCTION;
+
// One option...
template <class M0t>
explicit list(const M0t &M0)
@@ -1592,6 +1600,10 @@ public:
return Positions[optnum];
}
+ // Command line options should not be copyable
+ bits(const bits &) LLVM_DELETED_FUNCTION;
+ bits &operator=(const bits &) LLVM_DELETED_FUNCTION;
+
// One option...
template <class M0t>
explicit bits(const M0t &M0)
@@ -1725,6 +1737,10 @@ public:
AliasFor = &O;
}
+ // Command line options should not be copyable
+ alias(const alias &) LLVM_DELETED_FUNCTION;
+ alias &operator=(const alias &) LLVM_DELETED_FUNCTION;
+
// One option...
template <class M0t>
explicit alias(const M0t &M0)
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 730911b07c6..7a16ad0bb8d 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/tools/lli/lli.cpp
@@ -556,7 +556,7 @@ int main(int argc, char **argv, char * const *envp) {
// If the user specifically requested an argv[0] to pass into the program,
// do it now.
if (!FakeArgv0.empty()) {
- InputFile = FakeArgv0;
+ InputFile = static_cast<std::string>(FakeArgv0);
} else {
// Otherwise, if there is a .bc suffix on the executable strip it off, it
// might confuse the program.
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index 25531c776a3..0137e35c52f 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -38,7 +38,8 @@ static void exitWithError(const Twine &Message, StringRef Whence = "") {
enum ProfileKinds { instr, sample };
-void mergeInstrProfile(cl::list<std::string> Inputs, StringRef OutputFilename) {
+void mergeInstrProfile(const cl::list<std::string> &Inputs,
+ StringRef OutputFilename) {
if (OutputFilename.compare("-") == 0)
exitWithError("Cannot write indexed profdata format to stdout.");
@@ -64,7 +65,8 @@ void mergeInstrProfile(cl::list<std::string> Inputs, StringRef OutputFilename) {
Writer.write(Output);
}
-void mergeSampleProfile(cl::list<std::string> Inputs, StringRef OutputFilename,
+void mergeSampleProfile(const cl::list<std::string> &Inputs,
+ StringRef OutputFilename,
sampleprof::SampleProfileFormat OutputFormat) {
using namespace sampleprof;
auto WriterOrErr = SampleProfileWriter::create(OutputFilename, OutputFormat);
diff --git a/llvm/tools/llvm-size/llvm-size.cpp b/llvm/tools/llvm-size/llvm-size.cpp
index fc211e3180b..0e0dd59ce92 100644
--- a/llvm/tools/llvm-size/llvm-size.cpp
+++ b/llvm/tools/llvm-size/llvm-size.cpp
@@ -709,7 +709,7 @@ int main(int argc, char **argv) {
ToolName = argv[0];
if (OutputFormatShort.getNumOccurrences())
- OutputFormat = OutputFormatShort;
+ OutputFormat = static_cast<OutputFormatTy>(OutputFormatShort);
if (RadixShort.getNumOccurrences())
Radix = RadixShort;
OpenPOWER on IntegriCloud