summaryrefslogtreecommitdiff
path: root/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-02-07 19:36:01 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-02-07 19:36:01 +0000
commitebba0558c84b67f73989e174e4512f5af0c06cb1 (patch)
tree481fe713adaa79cacc9227ee93b6be1bb7b9e4f4 /lib/Support/CommandLine.cpp
parentefde86753d6f324ac9d0b42e48fd3ebf40c17905 (diff)
downloadllvm-ebba0558c84b67f73989e174e4512f5af0c06cb1.tar.gz
llvm-ebba0558c84b67f73989e174e4512f5af0c06cb1.tar.bz2
llvm-ebba0558c84b67f73989e174e4512f5af0c06cb1.tar.xz
Correct use of const in ParseCommandLineOptions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/CommandLine.cpp')
-rw-r--r--lib/Support/CommandLine.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp
index 48827aec4c..d1ec4b005b 100644
--- a/lib/Support/CommandLine.cpp
+++ b/lib/Support/CommandLine.cpp
@@ -266,8 +266,8 @@ static bool CommaSeparateAndAddOccurence(Option *Handler, unsigned pos,
/// and a null value (StringRef()). The later is accepted for arguments that
/// don't allow a value (-foo) the former is rejected (-foo=).
static inline bool ProvideOption(Option *Handler, StringRef ArgName,
- StringRef Value, int argc, char **argv,
- int &i) {
+ StringRef Value, int argc,
+ const char *const *argv, int &i) {
// Is this a multi-argument option?
unsigned NumAdditionalVals = Handler->getNumAdditionalVals();
@@ -495,10 +495,10 @@ void cl::ParseEnvironmentOptions(const char *progName, const char *envVar,
/// ExpandResponseFiles - Copy the contents of argv into newArgv,
/// substituting the contents of the response files for the arguments
/// of type @file.
-static void ExpandResponseFiles(unsigned argc, char** argv,
+static void ExpandResponseFiles(unsigned argc, const char*const* argv,
std::vector<char*>& newArgv) {
for (unsigned i = 1; i != argc; ++i) {
- char *arg = argv[i];
+ const char *arg = argv[i];
if (arg[0] == '@') {
sys::PathWithStatus respFile(++arg);
@@ -528,7 +528,7 @@ static void ExpandResponseFiles(unsigned argc, char** argv,
}
}
-void cl::ParseCommandLineOptions(int argc, char **argv,
+void cl::ParseCommandLineOptions(int argc, const char * const *argv,
const char *Overview, bool ReadResponseFiles) {
// Process all registered options.
SmallVector<Option*, 4> PositionalOpts;