[lld] r240235 - ArrayRef-ify ParseArgs

David Blaikie dblaikie at gmail.com
Sat Jun 20 23:32:04 PDT 2015


Author: dblaikie
Date: Sun Jun 21 01:32:04 2015
New Revision: 240235

URL: http://llvm.org/viewvc/llvm-project?rev=240235&view=rev
Log:
ArrayRef-ify ParseArgs

Modified:
    lld/trunk/COFF/DriverUtils.cpp
    lld/trunk/lib/Driver/CoreDriver.cpp
    lld/trunk/lib/Driver/DarwinLdDriver.cpp
    lld/trunk/lib/Driver/GnuLdDriver.cpp
    lld/trunk/lib/Driver/UniversalDriver.cpp
    lld/trunk/lib/Driver/WinLinkDriver.cpp

Modified: lld/trunk/COFF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/DriverUtils.cpp?rev=240235&r1=240234&r2=240235&view=diff
==============================================================================
--- lld/trunk/COFF/DriverUtils.cpp (original)
+++ lld/trunk/COFF/DriverUtils.cpp Sun Jun 21 01:32:04 2015
@@ -556,8 +556,8 @@ ArgParser::parse(std::vector<const char
   COFFOptTable Table;
   unsigned MissingIndex;
   unsigned MissingCount;
-  std::unique_ptr<llvm::opt::InputArgList> Args(Table.ParseArgs(
-      Argv.data(), Argv.data() + Argv.size(), MissingIndex, MissingCount));
+  std::unique_ptr<llvm::opt::InputArgList> Args(
+      Table.ParseArgs(Argv, MissingIndex, MissingCount));
   if (MissingCount) {
     llvm::errs() << "missing arg value for \""
                  << Args->getArgString(MissingIndex)

Modified: lld/trunk/lib/Driver/CoreDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/CoreDriver.cpp?rev=240235&r1=240234&r2=240235&view=diff
==============================================================================
--- lld/trunk/lib/Driver/CoreDriver.cpp (original)
+++ lld/trunk/lib/Driver/CoreDriver.cpp Sun Jun 21 01:32:04 2015
@@ -93,8 +93,8 @@ bool CoreDriver::parse(int argc, const c
   CoreOptTable table;
   unsigned missingIndex;
   unsigned missingCount;
-  parsedArgs.reset(
-      table.ParseArgs(&argv[1], &argv[argc], missingIndex, missingCount));
+  parsedArgs.reset(table.ParseArgs(llvm::makeArrayRef(argv, argc).slice(1),
+                                   missingIndex, missingCount));
   if (missingCount) {
     diagnostics << "error: missing arg value for '"
                 << parsedArgs->getArgString(missingIndex) << "' expected "

Modified: lld/trunk/lib/Driver/DarwinLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/DarwinLdDriver.cpp?rev=240235&r1=240234&r2=240235&view=diff
==============================================================================
--- lld/trunk/lib/Driver/DarwinLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/DarwinLdDriver.cpp Sun Jun 21 01:32:04 2015
@@ -285,8 +285,8 @@ bool DarwinLdDriver::parse(int argc, con
   unsigned missingIndex;
   unsigned missingCount;
   bool globalWholeArchive = false;
-  parsedArgs.reset(
-      table.ParseArgs(&argv[1], &argv[argc], missingIndex, missingCount));
+  parsedArgs.reset(table.ParseArgs(llvm::makeArrayRef(argv, argc).slice(1),
+                                   missingIndex, missingCount));
   if (missingCount) {
     diagnostics << "error: missing arg value for '"
                 << parsedArgs->getArgString(missingIndex) << "' expected "

Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=240235&r1=240234&r2=240235&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Sun Jun 21 01:32:04 2015
@@ -347,8 +347,8 @@ bool GnuLdDriver::parse(int argc, const
   unsigned missingIndex;
   unsigned missingCount;
 
-  parsedArgs.reset(
-      table.ParseArgs(&argv[1], &argv[argc], missingIndex, missingCount));
+  parsedArgs.reset(table.ParseArgs(llvm::makeArrayRef(argv, argc).slice(1),
+                                   missingIndex, missingCount));
   if (missingCount) {
     diag << "error: missing arg value for '"
          << parsedArgs->getArgString(missingIndex) << "' expected "

Modified: lld/trunk/lib/Driver/UniversalDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/UniversalDriver.cpp?rev=240235&r1=240234&r2=240235&view=diff
==============================================================================
--- lld/trunk/lib/Driver/UniversalDriver.cpp (original)
+++ lld/trunk/lib/Driver/UniversalDriver.cpp Sun Jun 21 01:32:04 2015
@@ -174,8 +174,8 @@ bool UniversalDriver::link(int argc, con
   // Program name
   StringRef programName = llvm::sys::path::stem(argv[0]);
 
-  parsedArgs.reset(
-      table.ParseArgs(&argv[1], &argv[argc], missingIndex, missingCount));
+  parsedArgs.reset(table.ParseArgs(llvm::makeArrayRef(argv, argc).slice(1),
+                                   missingIndex, missingCount));
 
   if (missingCount) {
     diagnostics << "error: missing arg value for '"

Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=240235&r1=240234&r2=240235&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Sun Jun 21 01:32:04 2015
@@ -752,7 +752,7 @@ parseArgs(int argc, const char **argv, P
   WinLinkOptTable table;
   unsigned missingIndex;
   unsigned missingCount;
-  parsedArgs.reset(table.ParseArgs(&argv[1], &argv[argc],
+  parsedArgs.reset(table.ParseArgs(llvm::makeArrayRef(argv, argc).slice(1),
                                    missingIndex, missingCount));
   if (missingCount) {
     diag << "error: missing arg value for '"





More information about the llvm-commits mailing list