diff options
| author | Chris Bieneman <beanz@apple.com> | 2015-01-22 01:49:59 +0000 |
|---|---|---|
| committer | Chris Bieneman <beanz@apple.com> | 2015-01-22 01:49:59 +0000 |
| commit | e71fb5ce05089b9343c6cda9663c214b9c29c52e (patch) | |
| tree | ae799ac8c7d0a54b08594e48e3c0c39803b08370 /llvm/tools/llvm-profdata/llvm-profdata.cpp | |
| parent | 5156c3857066396e744137cdadf94fb18fa29da2 (diff) | |
| download | bcm5719-llvm-e71fb5ce05089b9343c6cda9663c214b9c29c52e.tar.gz bcm5719-llvm-e71fb5ce05089b9343c6cda9663c214b9c29c52e.zip | |
Assigning and copying command line option objects shouldn't be allowed.
Summary:
The default copy and assignment operators for these objects probably don't actually do what the clients intend, so they should be deleted.
Places using the assignment operator to set the value of an option should cast to the option's data type first to call into the override for operator=. Places using the copy constructor just need to be changed to not copy (i.e. passing by const reference instead of value).
Reviewers: dexonsmith, chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7114
llvm-svn: 226762
Diffstat (limited to 'llvm/tools/llvm-profdata/llvm-profdata.cpp')
| -rw-r--r-- | llvm/tools/llvm-profdata/llvm-profdata.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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); |

